13 assert(x.rows() == ncols);
18 Eigen::MatrixXd output(nrows,x.cols());
20 for(
int i=0; i<
blocks.size(); ++i)
22 output.block(currRow, 0,
blocks.at(i)->rows(), x.cols()) =
blocks.at(i)->Apply( x.block(currCol, 0,
blocks.at(i)->cols(), x.cols()) );
23 currRow +=
blocks.at(i)->rows();
24 currCol +=
blocks.at(i)->cols();
33 assert(x.rows() == nrows);
38 Eigen::MatrixXd output(ncols,x.cols());
40 for(
int i=0; i<
blocks.size(); ++i)
42 output.block(currRow, 0,
blocks.at(i)->cols(), x.cols()) =
blocks.at(i)->ApplyTranspose( x.block(currCol, 0,
blocks.at(i)->rows(), x.cols()) );
43 currRow +=
blocks.at(i)->cols();
44 currCol +=
blocks.at(i)->rows();
53 Eigen::MatrixXd output = Eigen::MatrixXd::Zero(nrows,ncols);
57 for(
int i=0; i<
blocks.size(); ++i)
59 output.block(currRow, currCol,
blocks.at(i)->rows(),
blocks.at(i)->cols()) =
blocks.at(i)->GetMatrix();
60 currRow +=
blocks.at(i)->rows();
61 currCol +=
blocks.at(i)->cols();
71 for(
auto& block : blocksIn)
79 for(
auto& block : blocksIn)
virtual Eigen::MatrixXd GetMatrix() override
static int SumRows(std::vector< std::shared_ptr< LinearOperator >> const &blocksIn)
BlockDiagonalOperator(std::vector< std::shared_ptr< LinearOperator >> const &blocksIn)
std::vector< std::shared_ptr< LinearOperator > > blocks
virtual Eigen::MatrixXd Apply(Eigen::Ref< const Eigen::MatrixXd > const &x) override
static int SumCols(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.