MUQ  0.4.3
ReplicateOperator.cpp
Go to the documentation of this file.
3 
4 using namespace muq::Modeling;
5 
6 
7 ReplicateOperator::ReplicateOperator(unsigned int vectorDim,
8  unsigned int numRepeat) : ModPiece(int(vectorDim)*Eigen::VectorXi::Ones(1),
9  int(vectorDim*numRepeat)*Eigen::VectorXi::Ones(1)),
10  numRepl(numRepeat)
11 {}
12 
14  outputs.resize(1);
15  outputs.at(0).resize(outputSizes(0));
16 
17  unsigned int vectorDim = inputs.at(0).get().size();
18 
19  for(int i=0; i<numRepl; ++i)
20  outputs.at(0).segment(i*vectorDim, vectorDim) = inputs.at(0).get();
21 }
Provides an abstract interface for defining vector-valued model components.
Definition: ModPiece.h:148
std::vector< Eigen::VectorXd > outputs
Definition: ModPiece.h:503
const Eigen::VectorXi outputSizes
Definition: ModPiece.h:472
ReplicateOperator(unsigned int vectorDim, unsigned int numRepeat)
virtual void EvaluateImpl(muq::Modeling::ref_vector< Eigen::VectorXd > const &inputs) override
std::vector< std::reference_wrapper< const T > > ref_vector
A vector of references to something ...
Definition: WorkPiece.h:37