1 #ifndef ROOTFINDINGIVP_H_
2 #define ROOTFINDINGIVP_H_
4 #include "MUQ/Modeling/ODEBase.h"
48 RootfindingIVP(std::shared_ptr<WorkPiece> rhs, std::shared_ptr<WorkPiece>
root, boost::property_tree::ptree
const& pt, std::shared_ptr<muq::Utilities::AnyAlgebra> algebra = std::make_shared<muq::Utilities::AnyAlgebra>());
76 Eigen::VectorXi
FindRoot(
ref_vector<boost::any> const& inputs,
int const wrtIn = -1,
int const wrtOut = -1, DerivativeMode
const& mode = DerivativeMode::Jac);
91 static int EvaluateRoot(realtype t, N_Vector state, realtype *
root,
void *user_data);
94 std::shared_ptr<WorkPiece>
root;
A rootfinding initial value problem — find the root of a function along an orbit of an ODE.
const unsigned int maxSteps
The maximum number of steps the timesteper can take.
std::shared_ptr< WorkPiece > root
The root function.
virtual void JacobianImpl(unsigned int const wrtIn, unsigned int const wrtOut, ref_vector< boost::any > const &inputs) override
Compute the Jacobian of the state at the root.
const unsigned int maxErrorTests
The maximum number of error test failures.
RootfindingIVP(std::shared_ptr< WorkPiece > rhs, std::shared_ptr< WorkPiece > root, boost::property_tree::ptree const &pt, std::shared_ptr< muq::Utilities::AnyAlgebra > algebra=std::make_shared< muq::Utilities::AnyAlgebra >())
virtual ~RootfindingIVP()
Eigen::VectorXi FindRoot(ref_vector< boost::any > const &inputs, int const wrtIn=-1, int const wrtOut=-1, DerivativeMode const &mode=DerivativeMode::Jac)
Run the CVODES integrator.
const double maxTime
The maximum amount of time to integrate.
virtual void EvaluateImpl(ref_vector< boost::any > const &inputs) override
Integrate the ODE until we find a root.
static int EvaluateRoot(realtype t, N_Vector state, realtype *root, void *user_data)
Evaluate the root function.
void UpdateInputOutputTypes()
Update the input and output types based on the rhs and root muq::Modeling::WorkPiece's.
std::vector< std::reference_wrapper< const T > > ref_vector
A vector of references to something ...