3 #include <fluxionum/DiffDesignMatrix.h>
4 #include <fluxionum/LinearPiecesFunction.h>
5 #include <fluxionum/ParametricLinearPiecesFunction.h>
6 #include <fluxionum/FixedIterativeEulerMethod.h>
7 #include <fluxionum/FixedParametricIterativeEulerMethod.h>
8 #include <fluxionum/ClosestLesserSampleFunction.h>
9 #include <fluxionum/ParametricClosestLesserSampleFunction.h>
10 #include <fluxionum/FluxionumException.h>
21 namespace DiffDesignMatrixInterpolator{
36 template <
typename A,
typename B>
39 arma::Col<B>
const &slope,
40 arma::Col<B>
const &intercept
54 template <
typename A,
typename B>
59 arma::Col<B> *intercept,
63 case DiffDesignMatrixType::FORWARD_FINITE_DIFFERENCES:{
65 *slope = ddm.
getA().col(colIdx);
72 case DiffDesignMatrixType::CENTRAL_FINITE_DIFFERENCES:{
74 "DiffDesignMatrixInterpolator::makeLinearPiecesFunction:\n"
75 "\tCentral finite differences not supported"
80 "DiffDesignMatrixInterpolator::makeLinearPiecesFunction:\n"
81 "\tUnexpected differential type"
97 template <
typename A,
typename B>
100 arma::Mat<B>
const &intercepts
114 template <
typename A,
typename B>
120 case DiffDesignMatrixType::FORWARD_FINITE_DIFFERENCES:{
126 case DiffDesignMatrixType::CENTRAL_FINITE_DIFFERENCES:{
128 "DiffDesignMatrixInterpolator::"
129 "makeParametricLinearPiecesFunction:\n"
130 "\tCentral finite differences not supported"
135 "DiffDesignMatrixInterpolator::"
136 "makeParametricLinearPiecesFunction:\n"
137 "\tUnexpected differential type"
153 template <
typename A,
typename B>
156 arma::Col<B>
const &y,
175 template <
typename A,
typename B>
182 arma::Col<B> *dydtSamples
185 *dydtSamples = ddm.
getA().col(colIdx);
192 case DiffDesignMatrixType::FORWARD_FINITE_DIFFERENCES:{
199 case DiffDesignMatrixType::CENTRAL_FINITE_DIFFERENCES:{
201 "DiffDesignMatrixInterpolator::"
202 "makeFixedIterativeEulerMethod:\n"
203 "\tCentral finite differences not supported"
208 "DiffDesignMatrixInterpolator::"
209 "makeFixedIterativeEulerMethod:\n"
210 "\tUnexpected differential type"
228 template <
typename A,
typename B>
232 arma::Mat<B>
const &y,
253 template <
typename A,
typename B>
266 case DiffDesignMatrixType::FORWARD_FINITE_DIFFERENCES:{
273 case DiffDesignMatrixType::CENTRAL_FINITE_DIFFERENCES:{
275 "DiffDesignMatrixInterpolator::"
276 "makeFixedParametricIterativeEulerMethod:\n"
277 "\tCentral finite differences not supported"
282 "DiffDesignMatrixInterpolator::"
283 "makeFixedParametricIterativeEulerMethod:\n"
284 "\tUnexpected differential type"
Closest lesser sample function.
Definition: ClosestLesserSampleFunction.h:28
This class represents a DesignMatrix .
Definition: DesignMatrix.h:41
arma::Col< T > getColumnCopy(size_t const j) const
Like DesignMatrix::getColumn(size_t const) but returning a copy by value instead of a view-like refer...
Definition: DesignMatrix.h:279
size_t getNumRows() const override
Obtain the number of rows of the DesignMatrix .
Definition: DesignMatrix.h:237
arma::Mat< T > const & getX() const
Obtain a constant/read reference to the matrix.
Definition: DesignMatrix.h:219
arma::subview_col< T > const getColumn(size_t const j) const
Obtain the -th column of the DesignMatrix .
Definition: DesignMatrix.h:272
The heart of a differential design matrix is the idea that the columns are defining the values of var...
Definition: DiffDesignMatrix.h:169
arma::Mat< VarType > const & getA() const
Obtain a constant/read reference to the matrix.
Definition: DiffDesignMatrix.h:481
arma::Col< TimeType > const & getTimeVector() const
Obtain the sorted series of time values DiffDesignMatrix::t.
Definition: DiffDesignMatrix.h:475
DiffDesignMatrixType getDiffType() const
Obtain the type of differential of the DiffDesignMatrix.
Definition: DiffDesignMatrix.h:463
Fixed iterative Euler method.
Definition: FixedIterativeEulerMethod.h:25
Fixed parametric iterative Euler method.
Definition: FixedParametricIterativeEulerMethod.h:27
Base class for fluxionum exceptions.
Definition: FluxionumException.h:16
Abstract class representing a function.
Definition: Function.h:27
Linear pieces function.
Definition: LinearPiecesFunction.h:28
Definition: ParametricClosestLesserSampleFunction.h:10
Parametric linear pieces function.
Definition: ParametricLinearPiecesFunction.h:35
FixedParametricIterativeEulerMethod< A, B > makeFixedParametricIterativeEulerMethod(DiffDesignMatrix< A, B > const &ddm, arma::Mat< B > const &y, Function< A, arma::Col< B >> &dydt)
Obtain a function representing a fixed parametric iterative Euler method from given DiffDesignMatrix,...
Definition: DiffDesignMatrixInterpolator.h:230
ParametricLinearPiecesFunction< A, B > makeParametricLinearPiecesFunction(DiffDesignMatrix< A, B > const &ddm, arma::Mat< B > const &intercepts)
Obtain a parametric linear pieces function from given DiffDesignMatrix and known values.
Definition: DiffDesignMatrixInterpolator.h:98
FixedIterativeEulerMethod< A, B > makeFixedIterativeEulerMethod(DiffDesignMatrix< A, B > const &ddm, arma::Col< B > const &y, Function< A, B > &dydt)
Obtain a function representing a fixed iterative Euler method from given DiffDesignMatrix,...
Definition: DiffDesignMatrixInterpolator.h:154
LinearPiecesFunction< A, B > makeLinearPiecesFunction(DiffDesignMatrix< A, B > const &ddm, arma::Col< B > const &slope, arma::Col< B > const &intercept)
Obtain a linear pieces function from given DiffDesignMatrix and known values.
Definition: DiffDesignMatrixInterpolator.h:37