9 std::shared_ptr<ModPiece>
const& noiseModelIn,
10 std::vector<Eigen::VectorXd>
const& inputsIn,
13 double nuggetIn) :
LinearOperator(forwardModelIn->inputSizes(inWrtIn), forwardModelIn->inputSizes(inWrtIn)),
14 forwardModel(forwardModelIn),
15 noiseModel(noiseModelIn),
17 noiseInputs(forwardModelIn->Evaluate(inputsIn)),
22 assert(noiseModelIn->inputSizes.size()==1);
23 assert(noiseModelIn->outputSizes.size()==1);
24 assert(noiseModelIn->outputSizes(0)==1);
27 assert(
forwardModel->outputSizes(0)==noiseModelIn->inputSizes(0));
34 Eigen::MatrixXd output(rows(),x.cols());
35 Eigen::VectorXd sens = Eigen::VectorXd::Ones(1);
37 for(
unsigned int i=0; i<x.cols(); ++i){
41 output.col(i) *=
scale;
42 output.col(i) +=
nugget*x.col(i);
const std::vector< Eigen::VectorXd > noiseInputs
virtual Eigen::MatrixXd Apply(Eigen::Ref< const Eigen::MatrixXd > const &x) override
const std::vector< Eigen::VectorXd > inputs
virtual Eigen::MatrixXd ApplyTranspose(Eigen::Ref< const Eigen::MatrixXd > const &x) override
GaussNewtonOperator(std::shared_ptr< ModPiece > const &forwardModelIn, std::shared_ptr< ModPiece > const &noiseModelIn, std::vector< Eigen::VectorXd > const &inputsIn, unsigned int inWrt, double scaleIn=1.0, double nuggetIn=0.0)
std::shared_ptr< ModPiece > forwardModel
std::shared_ptr< ModPiece > noiseModel
Generic linear operator base class.