Loading...
Searching...
No Matches
gpr::ConditionedKernel::State Struct Reference

Public Member Functions

template<typename Derived>
Eigen::Matrix< double, Eigen::Dynamic, Derived::ColsAtCompileTime > factorRows (const Eigen::MatrixBase< Derived > &right) const
template<typename Derived>
Eigen::Matrix< double, Eigen::Dynamic, Derived::ColsAtCompileTime > whiten (const Eigen::MatrixBase< Derived > &right) const
template<typename Derived>
Eigen::Matrix< double, Eigen::Dynamic, Derived::ColsAtCompileTime > solve (const Eigen::MatrixBase< Derived > &right) const

Public Attributes

std::shared_ptr< const KernelOperator > kernel
Coord anchors
linalg::CholeskyPanels lower
bool observation_major = false
CrossCovarianceFunction anchor_covariance

Detailed Description

Definition at line 64 of file ConditionedKernel.cpp.

Member Function Documentation

◆ factorRows()

template<typename Derived>
Eigen::Matrix< double, Eigen::Dynamic, Derived::ColsAtCompileTime > gpr::ConditionedKernel::State::factorRows ( const Eigen::MatrixBase< Derived > & right) const
inline

Definition at line 73 of file ConditionedKernel.cpp.

74 {
75 Eigen::Matrix<double, Eigen::Dynamic, Derived::ColsAtCompileTime>
76 result(right.rows(), right.cols());
78 const Eigen::Index channels = anchors.cols() + 1;
79 for (Eigen::Index row = 0; row < right.rows(); ++row)
80 result.row(row) = right.row((row % channels) * anchors.rows() +
81 row / channels);
82 } else {
83 result = right;
84 }
85 return result;
86 }

◆ solve()

template<typename Derived>
Eigen::Matrix< double, Eigen::Dynamic, Derived::ColsAtCompileTime > gpr::ConditionedKernel::State::solve ( const Eigen::MatrixBase< Derived > & right) const
inline

Definition at line 98 of file ConditionedKernel.cpp.

100 {
101 auto result = factorRows(right);
102 lower.solveInPlace(result);
103 if (observation_major) {
104 Eigen::VectorXd ordered(result.rows());
105 const Eigen::Index channels = anchors.cols() + 1;
106 for (Eigen::Index column = 0; column < result.cols(); ++column) {
107 ordered = result.col(column);
108 for (Eigen::Index row = 0; row < result.rows(); ++row)
109 result((row % channels) * anchors.rows() + row / channels,
110 column) = ordered(row);
111 }
112 }
113 return result;
114 }
Eigen::Matrix< double, Eigen::Dynamic, Derived::ColsAtCompileTime > factorRows(const Eigen::MatrixBase< Derived > &right) const

◆ whiten()

template<typename Derived>
Eigen::Matrix< double, Eigen::Dynamic, Derived::ColsAtCompileTime > gpr::ConditionedKernel::State::whiten ( const Eigen::MatrixBase< Derived > & right) const
inline

Definition at line 89 of file ConditionedKernel.cpp.

91 {
92 auto result = factorRows(right);
93 lower.forwardSolveInPlace(result);
94 return result;
95 }

Member Data Documentation

◆ anchor_covariance

CrossCovarianceFunction gpr::ConditionedKernel::State::anchor_covariance

Definition at line 69 of file ConditionedKernel.cpp.

◆ anchors

Coord gpr::ConditionedKernel::State::anchors

Definition at line 66 of file ConditionedKernel.cpp.

◆ kernel

std::shared_ptr<const KernelOperator> gpr::ConditionedKernel::State::kernel

Definition at line 65 of file ConditionedKernel.cpp.

◆ lower

linalg::CholeskyPanels gpr::ConditionedKernel::State::lower

Definition at line 67 of file ConditionedKernel.cpp.

◆ observation_major

bool gpr::ConditionedKernel::State::observation_major = false

Definition at line 68 of file ConditionedKernel.cpp.


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