MUQ  0.4.3
muq::Approximation::KernelImpl< ChildType > Class Template Reference

Base class in CRTP pattern for covariance kernels. More...

#include <KernelImpl.h>

Inheritance diagram for muq::Approximation::KernelImpl< ChildType >:

Detailed Description

template<typename ChildType>
class muq::Approximation::KernelImpl< ChildType >

Base class in CRTP pattern for covariance kernels.

This class provides common functionality (such as computing Covariance matrices) for all covariance kernels. It uses the curiously recurring template pattern and requires that child classes implement the following functions

  • void EvaluateImpl(VectorType1, VectorType2, MatType)
  • void GetDerivative(VectorType1, VectorType2, MatType)
  • Eigen::VectorXd GetParams()
  • void SetParams(Eigen::VectorXd)

Definition at line 25 of file KernelImpl.h.

Public Member Functions

 KernelImpl (unsigned inputDimIn, unsigned coDimIn, unsigned numParamsIn)
 
 KernelImpl (unsigned inputDimIn, std::vector< unsigned > dimIndsIn, unsigned coDimIn, unsigned numParamsIn)
 
virtual ~KernelImpl ()
 
virtual std::shared_ptr< KernelBaseClone () const override
 
virtual void FillBlock (Eigen::Ref< const Eigen::VectorXd > const &x1, Eigen::Ref< const Eigen::VectorXd > const &x2, Eigen::Ref< const Eigen::VectorXd > const &params, Eigen::Ref< Eigen::MatrixXd > block) const override
 
virtual void FillPosDerivBlock (Eigen::Ref< const Eigen::VectorXd > const &x1, Eigen::Ref< const Eigen::VectorXd > const &x2, Eigen::Ref< const Eigen::VectorXd > const &params, std::vector< int > const &wrts, Eigen::Ref< Eigen::MatrixXd > block) const override
 
void FillPosDerivBlockImpl (Eigen::Ref< const Eigen::VectorXd > const &x1, Eigen::Ref< const Eigen::VectorXd > const &x2, Eigen::Ref< const Eigen::VectorXd > const &params, std::vector< int > const &wrts, Eigen::Ref< Eigen::MatrixXd > block) const
 
template<typename ScalarType >
Eigen::Matrix< ScalarType, Eigen::Dynamic, 1 > GetSegment (Eigen::Ref< const Eigen::Matrix< ScalarType, Eigen::Dynamic, 1 >> const &input) const
 
- Public Member Functions inherited from muq::Approximation::KernelBase
 KernelBase (unsigned int inputDimIn, unsigned int coDimIn, unsigned int numParamsIn)
 
 KernelBase (unsigned int inputDimIn, std::vector< unsigned int > dimIndsIn, unsigned int coDimIn, unsigned int numParamsIn)
 
virtual ~KernelBase ()
 
virtual std::vector< std::shared_ptr< KernelBase > > GetSeperableComponents ()
 Overridden by ProductKernel. More...
 
virtual Eigen::MatrixXd Evaluate (Eigen::VectorXd const &x1, Eigen::VectorXd const &x2) const
 
virtual Eigen::MatrixXd BuildCovariance (Eigen::MatrixXd const &x) const
 
virtual Eigen::MatrixXd BuildCovariance (Eigen::MatrixXd const &x1, Eigen::MatrixXd const &x2) const
 
virtual void FillCovariance (Eigen::MatrixXd const &xs, Eigen::MatrixXd const &ys, Eigen::Ref< Eigen::MatrixXd > cov) const
 
virtual void FillCovariance (Eigen::MatrixXd const &xs, Eigen::Ref< Eigen::MatrixXd > cov) const
 
virtual void FillDerivCovariance (Eigen::MatrixXd const &xs, Eigen::MatrixXd const &ys, std::vector< int > const &wrts, Eigen::Ref< Eigen::MatrixXd > cov) const
 
virtual Eigen::MatrixXd GetPosDerivative (Eigen::VectorXd const &x1, Eigen::VectorXd const &x2, std::vector< int > const &wrts) const
 Returns derivatives of the kernel with respect to the first input, x1. More...
 
virtual Eigen::MatrixXd GetParamBounds () const
 
virtual Eigen::VectorXd GetParams () const
 
virtual void SetParams (Eigen::VectorXd const &params)
 
virtual std::tuple< std::shared_ptr< muq::Modeling::LinearSDE >, std::shared_ptr< muq::Modeling::LinearOperator >, Eigen::MatrixXd > GetStateSpace (boost::property_tree::ptree sdeOptions=boost::property_tree::ptree()) const
 Returns a state space representation of the covariance kernel. More...
 

Additional Inherited Members

- Public Attributes inherited from muq::Approximation::KernelBase
const std::vector< unsigned int > dimInds
 
const unsigned int inputDim
 
const unsigned int coDim
 
const unsigned int numParams
 

Constructor & Destructor Documentation

◆ KernelImpl() [1/2]

template<typename ChildType >
muq::Approximation::KernelImpl< ChildType >::KernelImpl ( unsigned  inputDimIn,
unsigned  coDimIn,
unsigned  numParamsIn 
)
inline

Definition at line 31 of file KernelImpl.h.

◆ KernelImpl() [2/2]

template<typename ChildType >
muq::Approximation::KernelImpl< ChildType >::KernelImpl ( unsigned  inputDimIn,
std::vector< unsigned >  dimIndsIn,
unsigned  coDimIn,
unsigned  numParamsIn 
)
inline

Definition at line 35 of file KernelImpl.h.

◆ ~KernelImpl()

template<typename ChildType >
virtual muq::Approximation::KernelImpl< ChildType >::~KernelImpl ( )
inlinevirtual

Definition at line 41 of file KernelImpl.h.

Member Function Documentation

◆ Clone()

template<typename ChildType >
virtual std::shared_ptr<KernelBase> muq::Approximation::KernelImpl< ChildType >::Clone ( ) const
inlineoverridevirtual

Implements muq::Approximation::KernelBase.

Definition at line 43 of file KernelImpl.h.

◆ FillBlock()

template<typename ChildType >
virtual void muq::Approximation::KernelImpl< ChildType >::FillBlock ( Eigen::Ref< const Eigen::VectorXd > const &  x1,
Eigen::Ref< const Eigen::VectorXd > const &  x2,
Eigen::Ref< const Eigen::VectorXd > const &  params,
Eigen::Ref< Eigen::MatrixXd >  block 
) const
inlineoverridevirtual

For particular points and parameters, this function fills in one block of the covariance matrix.

Implements muq::Approximation::KernelBase.

Definition at line 48 of file KernelImpl.h.

References muq::Approximation::KernelImpl< ChildType >::GetSegment().

◆ FillPosDerivBlock()

template<typename ChildType >
virtual void muq::Approximation::KernelImpl< ChildType >::FillPosDerivBlock ( Eigen::Ref< const Eigen::VectorXd > const &  x1,
Eigen::Ref< const Eigen::VectorXd > const &  x2,
Eigen::Ref< const Eigen::VectorXd > const &  params,
std::vector< int > const &  wrts,
Eigen::Ref< Eigen::MatrixXd >  block 
) const
inlineoverridevirtual

Evaluates a first or higher order derivative of the covariance kernel with respect to one of the position variables.

Implements muq::Approximation::KernelBase.

Definition at line 60 of file KernelImpl.h.

References muq::Approximation::KernelImpl< ChildType >::FillPosDerivBlockImpl().

◆ FillPosDerivBlockImpl()

template<typename ChildType >
void muq::Approximation::KernelImpl< ChildType >::FillPosDerivBlockImpl ( Eigen::Ref< const Eigen::VectorXd > const &  x1,
Eigen::Ref< const Eigen::VectorXd > const &  x2,
Eigen::Ref< const Eigen::VectorXd > const &  params,
std::vector< int > const &  wrts,
Eigen::Ref< Eigen::MatrixXd >  block 
) const
inline

◆ GetSegment()

template<typename ChildType >
template<typename ScalarType >
Eigen::Matrix<ScalarType, Eigen::Dynamic, 1> muq::Approximation::KernelImpl< ChildType >::GetSegment ( Eigen::Ref< const Eigen::Matrix< ScalarType, Eigen::Dynamic, 1 >> const &  input) const
inline

The documentation for this class was generated from the following file: