MUQ  0.4.3
SplitVector.h
Go to the documentation of this file.
1 #ifndef SPLITVECTOR_H_
2 #define SPLITVECTOR_H_
3 
5 
6 namespace muq {
7  namespace Modeling {
8 
42  class SplitVector : public ModPiece {
43  public:
44 
50  SplitVector(std::vector<int> const& ind,std::vector<int> const& size, unsigned int const insize);
51 
57  SplitVector(Eigen::VectorXi const& ind, Eigen::VectorXi const& size, unsigned int const insize);
58 
59  virtual ~SplitVector() = default;
60 
64  Eigen::VectorXi StartIndices() const{return ind;};
65 
66  private:
67 
68  virtual void EvaluateImpl(ref_vector<Eigen::VectorXd> const& inputs) override;
69 
70  virtual void JacobianImpl(unsigned int const outwrt, unsigned int const inwrt, ref_vector<Eigen::VectorXd> const& inputs) override;
71 
72  virtual void GradientImpl(unsigned int const outwrt, unsigned int const inwrt, ref_vector<Eigen::VectorXd> const& inputs, Eigen::VectorXd const& sens) override;
73 
74  virtual void ApplyJacobianImpl(unsigned int const outwrt, unsigned int const inwrt, ref_vector<Eigen::VectorXd> const& inputs, Eigen::VectorXd const& targ) override;
75 
76  virtual void ApplyHessianImpl(unsigned int const outwrt, unsigned int const inwrt1,unsigned int const inwrt2, ref_vector<Eigen::VectorXd> const& inputs, Eigen::VectorXd const& sens, Eigen::VectorXd const& targ) override;
77 
78  const Eigen::VectorXi ind;
79 
80  const Eigen::VectorXi size;
81 
82  };
83  } // namespace Modeling
84 } // namespace muq
85 
86 #endif
Provides an abstract interface for defining vector-valued model components.
Definition: ModPiece.h:148
Provides a mechanism for splitting a vector into multiple pieces.
Definition: SplitVector.h:42
virtual ~SplitVector()=default
SplitVector(std::vector< int > const &ind, std::vector< int > const &size, unsigned int const insize)
Definition: SplitVector.cpp:5
virtual void JacobianImpl(unsigned int const outwrt, unsigned int const inwrt, ref_vector< Eigen::VectorXd > const &inputs) override
Definition: SplitVector.cpp:30
const Eigen::VectorXi size
Definition: SplitVector.h:80
const Eigen::VectorXi ind
Definition: SplitVector.h:78
virtual void EvaluateImpl(ref_vector< Eigen::VectorXd > const &inputs) override
Definition: SplitVector.cpp:21
virtual void GradientImpl(unsigned int const outwrt, unsigned int const inwrt, ref_vector< Eigen::VectorXd > const &inputs, Eigen::VectorXd const &sens) override
Definition: SplitVector.cpp:36
Eigen::VectorXi StartIndices() const
Definition: SplitVector.h:64
virtual void ApplyJacobianImpl(unsigned int const outwrt, unsigned int const inwrt, ref_vector< Eigen::VectorXd > const &inputs, Eigen::VectorXd const &targ) override
Definition: SplitVector.cpp:43
virtual void ApplyHessianImpl(unsigned int const outwrt, unsigned int const inwrt1, unsigned int const inwrt2, ref_vector< Eigen::VectorXd > const &inputs, Eigen::VectorXd const &sens, Eigen::VectorXd const &targ) override
Definition: SplitVector.cpp:49
std::vector< std::reference_wrapper< const T > > ref_vector
A vector of references to something ...
Definition: WorkPiece.h:37