10 for(
int i=0; i<
blocks.size(); ++i)
11 assert(
blocks.at(i)->rows()==nrows);
19 assert(x.rows() == ncols);
23 Eigen::MatrixXd output = Eigen::MatrixXd::Zero(nrows,x.cols());
25 for(
int i=0; i<
blocks.size(); ++i)
27 output +=
blocks.at(i)->Apply( x.block(currCol, 0,
blocks.at(i)->cols(), x.cols()) );
28 currCol +=
blocks.at(i)->cols();
37 assert(x.rows() == nrows);
42 Eigen::MatrixXd output = Eigen::MatrixXd::Zero(ncols,x.cols());
44 for(
int i=0; i<
blocks.size(); ++i)
46 output.block(currRow, 0,
blocks.at(i)->cols(), x.cols()) =
blocks.at(i)->ApplyTranspose( x );
47 currRow +=
blocks.at(i)->cols();
48 currCol +=
blocks.at(i)->rows();
57 Eigen::MatrixXd output = Eigen::MatrixXd::Zero(nrows,ncols);
60 for(
int i=0; i<
blocks.size(); ++i)
62 output.block(0, currCol, nrows,
blocks.at(i)->cols()) =
blocks.at(i)->GetMatrix();
63 currCol +=
blocks.at(i)->cols();
72 for(
auto& block : blocksIn)
static int SumCols(std::vector< std::shared_ptr< LinearOperator >> const &blocksIn)
virtual Eigen::MatrixXd GetMatrix() override
virtual Eigen::MatrixXd Apply(Eigen::Ref< const Eigen::MatrixXd > const &x) override
std::vector< std::shared_ptr< LinearOperator > > blocks
BlockRowOperator(std::vector< std::shared_ptr< LinearOperator >> const &blocksIn)
virtual Eigen::MatrixXd ApplyTranspose(Eigen::Ref< const Eigen::MatrixXd > const &x) override
Generic linear operator base class.