MUQ  0.4.3
SumPiece.h
Go to the documentation of this file.
1 #ifndef SUMPIECE_H_
2 #define SUMPIECE_H_
3 
5 
6 namespace muq{
7 namespace Modeling{
8 
13  class SumPiece : public ModPiece {
14  public:
15 
16 
20  SumPiece(unsigned int dim, unsigned int numInputs=2);
21 
22  virtual ~SumPiece() = default;
23 
24  protected:
25  virtual void EvaluateImpl(ref_vector<Eigen::VectorXd> const& input) override;
26 
27  virtual void GradientImpl(unsigned int const outputDimWrt,
28  unsigned int const inputDimWrt,
29  ref_vector<Eigen::VectorXd> const& input,
30  Eigen::VectorXd const& sensitivity) override;
31 
32  virtual void JacobianImpl(unsigned int const outputDimWrt,
33  unsigned int const inputDimWrt,
34  ref_vector<Eigen::VectorXd> const& input) override;
35 
36  virtual void ApplyJacobianImpl(unsigned int const outputDimWrt,
37  unsigned int const inputDimWrt,
38  ref_vector<Eigen::VectorXd> const& input,
39  Eigen::VectorXd const& vec) override;
40 
41  virtual void ApplyHessianImpl(unsigned int const outWrt,
42  unsigned int const inWrt1,
43  unsigned int const inWrt2,
44  ref_vector<Eigen::VectorXd> const& input,
45  Eigen::VectorXd const& sens,
46  Eigen::VectorXd const& vec) override;
47  }; // class SumPiece
48 
49 }
50 }
51 
52 
53 
54 #endif // #ifndef SumPiece_H_
Provides an abstract interface for defining vector-valued model components.
Definition: ModPiece.h:148
Componentwise addition of two or more vectors.
Definition: SumPiece.h:13
virtual void GradientImpl(unsigned int const outputDimWrt, unsigned int const inputDimWrt, ref_vector< Eigen::VectorXd > const &input, Eigen::VectorXd const &sensitivity) override
Definition: SumPiece.cpp:25
virtual void ApplyJacobianImpl(unsigned int const outputDimWrt, unsigned int const inputDimWrt, ref_vector< Eigen::VectorXd > const &input, Eigen::VectorXd const &vec) override
Definition: SumPiece.cpp:40
SumPiece(unsigned int dim, unsigned int numInputs=2)
Definition: SumPiece.cpp:7
virtual void ApplyHessianImpl(unsigned int const outWrt, unsigned int const inWrt1, unsigned int const inWrt2, ref_vector< Eigen::VectorXd > const &input, Eigen::VectorXd const &sens, Eigen::VectorXd const &vec) override
Definition: SumPiece.cpp:48
virtual ~SumPiece()=default
virtual void EvaluateImpl(ref_vector< Eigen::VectorXd > const &input) override
Definition: SumPiece.cpp:15
virtual void JacobianImpl(unsigned int const outputDimWrt, unsigned int const inputDimWrt, ref_vector< Eigen::VectorXd > const &input) override
Definition: SumPiece.cpp:33
int numInputs
The number of inputs.
Definition: WorkPiece.h:501
std::vector< std::reference_wrapper< const T > > ref_vector
A vector of references to something ...
Definition: WorkPiece.h:37