Stan Math Library  2.20.0
reverse mode automatic differentiation
Public Member Functions | Public Attributes | List of all members
stan::math::hybrj_functor_solver< S, F, T0, T1 > Struct Template Reference

A functor with the required operators to call Eigen's algebraic solver. More...

#include <algebra_system.hpp>

Inheritance diagram for stan::math::hybrj_functor_solver< S, F, T0, T1 >:
stan::math::nlo_functor< double >

Public Member Functions

 hybrj_functor_solver (const S &fs, const F &f, const Eigen::Matrix< T0, Eigen::Dynamic, 1 > &x, const Eigen::Matrix< T1, Eigen::Dynamic, 1 > &y, const std::vector< double > &dat, const std::vector< int > &dat_int, std::ostream *msgs)
 
int operator() (const Eigen::VectorXd &iv, Eigen::VectorXd &fvec)
 Computes the value the algebraic function, f, when pluging in the independent variables, and the Jacobian w.r.t unknowns. More...
 
int df (const Eigen::VectorXd &iv, Eigen::MatrixXd &fjac) const
 Assign the Jacobian to fjac (signature required by Eigen). More...
 
Eigen::MatrixXd get_jacobian (const Eigen::VectorXd &iv)
 Performs the same task as the operator(), but returns the Jacobian, instead of saving it inside an argument passed by reference. More...
 
Eigen::VectorXd get_value (const Eigen::VectorXd &iv) const
 Performs the same task as df(), but returns the value of algebraic function, instead of saving it inside an argument passed by reference. More...
 
- Public Member Functions inherited from stan::math::nlo_functor< double >
 nlo_functor ()
 
 nlo_functor (int inputs, int values)
 
int inputs () const
 
int values () const
 

Public Attributes

fs_
 Wrapper around algebraic system. More...
 
int x_size_
 number of unknowns More...
 
Eigen::MatrixXd J_
 Jacobian of algebraic function wrt unknowns. More...
 
- Public Attributes inherited from stan::math::nlo_functor< double >
const int m_inputs
 
const int m_values
 

Detailed Description

template<typename S, typename F, typename T0, typename T1>
struct stan::math::hybrj_functor_solver< S, F, T0, T1 >

A functor with the required operators to call Eigen's algebraic solver.

Template Parameters
Swrapper around the algebraic system functor. Has the signature required for jacobian (i.e takes only one argument).
Falgebraic system functor
T0scalar type for unknowns
T1scalar type for auxiliary parameters

Definition at line 94 of file algebra_system.hpp.

Constructor & Destructor Documentation

◆ hybrj_functor_solver()

template<typename S , typename F , typename T0 , typename T1 >
stan::math::hybrj_functor_solver< S, F, T0, T1 >::hybrj_functor_solver ( const S &  fs,
const F &  f,
const Eigen::Matrix< T0, Eigen::Dynamic, 1 > &  x,
const Eigen::Matrix< T1, Eigen::Dynamic, 1 > &  y,
const std::vector< double > &  dat,
const std::vector< int > &  dat_int,
std::ostream *  msgs 
)
inline

Definition at line 102 of file algebra_system.hpp.

Member Function Documentation

◆ df()

template<typename S , typename F , typename T0 , typename T1 >
int stan::math::hybrj_functor_solver< S, F, T0, T1 >::df ( const Eigen::VectorXd &  iv,
Eigen::MatrixXd &  fjac 
) const
inline

Assign the Jacobian to fjac (signature required by Eigen).

Required by Eigen.

Parameters
[in]ivindependent variables.
[in,out]fjacmatrix container for jacobian

Definition at line 127 of file algebra_system.hpp.

◆ get_jacobian()

template<typename S , typename F , typename T0 , typename T1 >
Eigen::MatrixXd stan::math::hybrj_functor_solver< S, F, T0, T1 >::get_jacobian ( const Eigen::VectorXd &  iv)
inline

Performs the same task as the operator(), but returns the Jacobian, instead of saving it inside an argument passed by reference.

Parameters
[in]ivindepdent variable.

Definition at line 138 of file algebra_system.hpp.

◆ get_value()

template<typename S , typename F , typename T0 , typename T1 >
Eigen::VectorXd stan::math::hybrj_functor_solver< S, F, T0, T1 >::get_value ( const Eigen::VectorXd &  iv) const
inline

Performs the same task as df(), but returns the value of algebraic function, instead of saving it inside an argument passed by reference.

Template Parameters
[in]iv independent variable.

Definition at line 150 of file algebra_system.hpp.

◆ operator()()

template<typename S , typename F , typename T0 , typename T1 >
int stan::math::hybrj_functor_solver< S, F, T0, T1 >::operator() ( const Eigen::VectorXd &  iv,
Eigen::VectorXd &  fvec 
)
inline

Computes the value the algebraic function, f, when pluging in the independent variables, and the Jacobian w.r.t unknowns.

Required by Eigen.

Parameters
[in]ivindependent variables
[in,out]fvecvalue of algebraic function when plugging in iv.

Definition at line 116 of file algebra_system.hpp.

Member Data Documentation

◆ fs_

template<typename S , typename F , typename T0 , typename T1 >
S stan::math::hybrj_functor_solver< S, F, T0, T1 >::fs_

Wrapper around algebraic system.

Definition at line 96 of file algebra_system.hpp.

◆ J_

template<typename S , typename F , typename T0 , typename T1 >
Eigen::MatrixXd stan::math::hybrj_functor_solver< S, F, T0, T1 >::J_

Jacobian of algebraic function wrt unknowns.

Definition at line 100 of file algebra_system.hpp.

◆ x_size_

template<typename S , typename F , typename T0 , typename T1 >
int stan::math::hybrj_functor_solver< S, F, T0, T1 >::x_size_

number of unknowns

Definition at line 98 of file algebra_system.hpp.


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

     [ Stan Home Page ] © 2011–2018, Stan Development Team.