bnmf-algs
defs.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Eigen/Dense>
4 #include <gsl/gsl_randist.h>
5 #include <unsupported/Eigen/CXX11/Tensor>
6 
12 #ifdef BUILD_TESTING
13 #include <stdexcept>
14 #define BNMF_ASSERT(condition, msg) \
15  if (not(condition)) \
16  throw std::invalid_argument(msg)
17 #else
18 #include <cassert>
19 #define BNMF_ASSERT(condition, msg) (assert((condition) && msg))
20 #endif
21 
22 namespace bnmf_algs {
26 template <typename Scalar>
27 using vector_t = Eigen::Matrix<Scalar, 1, Eigen::Dynamic, Eigen::RowMajor>;
28 
33 
39 template <typename Scalar>
40 using matrix_t =
41  Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
42 
47 
51 template <typename Scalar, size_t N>
52 using tensor_t = Eigen::Tensor<Scalar, N, Eigen::RowMajor>;
53 
57 template <size_t N> using tensord = tensor_t<double, N>;
58 
66 template <size_t N> using shape = Eigen::array<size_t, N>;
67 
68 namespace util {
69 
74 
75 } // namespace util
76 } // namespace bnmf_algs
Eigen::Tensor< Scalar, N, Eigen::RowMajor > tensor_t
Tensor type used in the computations.
Definition: defs.hpp:52
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > matrix_t
Matrix type used in the computations.
Definition: defs.hpp:41
matrix_t< double > matrixd
Matrix type specialization using double as Scalar value.
Definition: defs.hpp:46
Eigen::array< size_t, N > shape
Shape of vectors, matrices, tensors, etc.
Definition: defs.hpp:66
vector_t< double > vectord
Vector type specialization using double as Scalar value.
Definition: defs.hpp:32
tensor_t< double, N > tensord
Tensor type specialization using double as Scalar value.
Definition: defs.hpp:57
Eigen::Matrix< Scalar, 1, Eigen::Dynamic, Eigen::RowMajor > vector_t
Vector type used in the computations.
Definition: defs.hpp:27
Main namespace for bnmf-algs library.
Definition: alloc_model_funcs.hpp:12