To declare a vector of dense matrix in Eigen I am using the following format
std::vector<Eigen::MatrixXd> AMAT(idx, Eigen::MatrixXd::Zero(1000,1000));
where idx is the vector size. Is there an equivalent declaration to define a sparse matrix? I am currently declaring a sparse matrix as
Eigen::SparseMatrix<double> BMAT(1000,1000);
It will be more efficient for to me define a vector of such matrix instead of declaring separate sparse matrix for each index. Any help is appreciated.
std::vector<Eigen::SparseMatrix<double>> BMATvec(idx, BMAT);. Is that sufficient for you? - JHBonariusstd::vector<Eigen::MatrixXd> AMAT(idx, Eigen::MatrixXd::Zero(x,x));where x can be different for each idx - pk68std::vector<Eigen::SparseMatrix<double>> BMAT(idx, Eigen::SparseMatrix<double> (x,x));. Thanks for your help JHBonarius - pk68