Stan Math Library
5.0.0
Automatic Differentiation
|
Eigen::Matrix< value_type_t< T2 >, Eigen::Dynamic, 1 > stan::math::algebra_solver | ( | const F & | f, |
const T1 & | x, | ||
const T2 & | y, | ||
const std::vector< double > & | dat, | ||
const std::vector< int > & | dat_int, | ||
std::ostream * | msgs = nullptr , |
||
const double | relative_tolerance = 1e-10 , |
||
const double | function_tolerance = 1e-6 , |
||
const int64_t | max_num_steps = 1e+3 |
||
) |
Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system.
Use Powell's dogleg solver.
The user can also specify the relative tolerance (xtol in Eigen's code), the function tolerance, and the maximum number of steps (maxfev in Eigen's code).
Signature to maintain backward compatibility, will be removed in the future.
F | type of equation system function |
T1 | type of elements in the x vector |
T2 | type of elements in the y vector |
[in] | f | Functor that evaluates the system of equations. |
[in] | x | Vector of starting values (initial guess). |
[in] | y | parameter vector for the equation system. |
[in] | dat | continuous data vector for the equation system. |
[in] | dat_int | integer data vector for the equation system. |
[in,out] | msgs | the print stream for warning messages. |
[in] | relative_tolerance | determines the convergence criteria for the solution. |
[in] | function_tolerance | determines whether roots are acceptable. |
[in] | max_num_steps | maximum number of function evaluations. |
<code>std::invalid_argument</code> | if x has size zero. |
<code>std::invalid_argument</code> | if x has non-finite elements. |
<code>std::invalid_argument</code> | if y has non-finite elements. |
<code>std::invalid_argument</code> | if dat has non-finite elements. |
<code>std::invalid_argument</code> | if dat_int has non-finite elements. |
<code>std::invalid_argument</code> | if relative_tolerance is strictly negative. |
<code>std::invalid_argument</code> | if function_tolerance is strictly negative. |
<code>std::invalid_argument</code> | if max_num_steps is not positive. |
<code>boost::math::evaluation_error</code> | (which is a subclass of std::domain_error ) if solver exceeds max_num_steps. |
<code>boost::math::evaluation_error</code> | (which is a subclass of std::domain_error ) if the norm of the solution exceeds the function tolerance. |
Definition at line 251 of file solve_powell.hpp.