41 using namespace wrapper;
42 using namespace eigen;
50 vector<double> vector(vec.data(), vec.data()+vec.rows()*vec.cols());
60 vector<vector<double>> matrix;
62 for (
int i=0; i<mat.rows(); i++)
74 return Eigen::VectorXd::Map(vec.data(), vec.size());
83 const int rows =
static_cast<int>(mat.size());
84 const int cols =
static_cast<int>(mat[0].size());
86 Eigen::MatrixXd matrix(rows, cols);
88 for (
int i=0; i<matrix.rows(); i++)
89 matrix.row(i) = Eigen::VectorXd::Map(mat[i].data(), mat.size());
100 int order = sqrt(mat.size());
functions that wrap Eigen routines
Eigen::MatrixXd MatrixToEigen(const std::vector< std::vector< double >> mat)
convert a std::vector<std::vector<double>> to an Eigen::MatrixXd object
Eigen::MatrixXd VectorToEigen(const std::vector< double > vec)
convert a std::vector<double> to an Eigen::MatrixXd object
std::vector< double > EigenToVector(const Eigen::MatrixXd vec)
convert an Eigen::MatrixXd to a std::vector<double>
Eigen::MatrixXd SquareMatrixToEigen(const std::vector< double > mat)
convert a std::vector<double> to an Eigen::MatrixXd object
std::vector< std::vector< double > > EigenToMatrix(const Eigen::MatrixXd mat)
convert an Eigen::MatrixXd to a std::vector<std::vector<double>>
The global namespace of the CosmoBolognaLib
std::vector< std::vector< T > > reshape(std::vector< T > vec, const int size1, const int size2)
reshape a vector into a matrix of given number of rows and columns