Class container for the Nelder-Mead's method.
More...
#include <NelderMead.hh>
Inherits Optimist::Optimizer::Optimizer< Vector, NelderMead< Vector > >.
|
| | NelderMead () |
| | NelderMead (const Scalar delta) |
| constexpr std::string | name_impl () const |
| Method | method () const |
| void | method (const Method t_method) |
| Scalar | delta () const |
| void | delta (const Scalar t_delta) |
| Scalar | rho () const |
| void | rho (const Scalar t_rho) |
| Scalar | chi () const |
| void | chi (const Scalar t_chi) |
| Scalar | gamma () const |
| void | gamma (const Scalar t_gamma) |
| Scalar | sigma () const |
| void | sigma (const Scalar t_sigma) |
| Scalar | volume_tolerance () const |
| void | volume_tolerance (const Scalar t_volume_tolerance) |
| template<typename FunctionLambda> |
| bool | solve_impl (FunctionLambda &&function, const Vector &x_ini, Vector &x_sol) |
| | Optimizer () |
| constexpr std::string | name () const |
| Integer | gradient_evaluations () const |
| Integer | max_gradient_evaluations () const |
| Integer | hessian_evaluations () const |
| Integer | max_hessian_evaluations () const |
| | SolverBase () |
| void | reset_bounds (const Integer n=InputTrait::IsDynamic ? 0 :InputTrait::Dimension) |
| const Vector & | lower_bound () const |
| const Vector & | upper_bound () const |
| void | bounds (const Vector &t_lower_bound, const Vector &t_upper_bound) |
| constexpr Integer | input_dimension () const |
| constexpr Integer | output_dimension () const |
| Integer | function_evaluations () const |
| void | max_function_evaluations (const Integer t_max_function_evaluations) |
| Integer | iterations () const |
| Integer | max_iterations () const |
| Scalar | alpha () const |
| Integer | relaxations () const |
| Integer | max_relaxations () const |
| Scalar | tolerance () const |
| void | verbose_mode (bool t_verbose) |
| void | enable_verbose_mode () |
| void | disable_verbose_mode () |
| void | damped_mode (bool t_damped) |
| void | enable_damped_mode () |
| void | disable_damped_mode () |
| std::string | task () const |
| bool | converged () const |
| std::ostream & | ostream () const |
| bool | solve (FunctionLambda &&function, const Vector &x_ini, Vector &x_sol) |
| bool | rootfind (const FunctionBase< FunctionInput, FunctionOutput, DerivedFunction > &function, const Vector &x_ini, Vector &x_sol) |
| bool | optimize (const FunctionBase< FunctionInput, FunctionOutput, DerivedFunction > &function, const Vector &x_ini, Vector &x_sol) |
| constexpr std::string | name () const |
|
| void | replace_point (const Scalar f, const Vector &p, const Integer j) |
| template<typename FunctionLambda> |
| void | spendley (FunctionLambda &&function, const Vector x, const Scalar delta) |
| template<typename FunctionLambda> |
| void | diamond (FunctionLambda &&function, const Vector x, const Scalar delta) |
| void | simplex_volume (Integer k) |
| void | dist_init () |
| void | dist_update (Integer j) |
| template<typename FunctionLambda> |
| void | shrink (FunctionLambda &&function) |
| template<typename FunctionLambda> |
| Scalar | extrapolate (FunctionLambda &&function, const Scalar alpha, const Integer j, Vector &p) |
| template<typename FunctionLambda> |
| Scalar | reflect (FunctionLambda &&function, Vector &p) |
| template<typename FunctionLambda> |
| Scalar | expand (FunctionLambda &&function, Vector &p) |
| template<typename FunctionLambda> |
| Scalar | outside (FunctionLambda &&function, Vector &p) |
| template<typename FunctionLambda> |
| Scalar | inside (FunctionLambda &&function, Vector &p) |
|
| bool | evaluate_gradient (GradientLambda &&gradient, const Input &x, FirstDerivative &out) |
| bool | evaluate_hessian (HessianLambda &&hessian, const Input &x, SecondDerivative &out) |
| bool | solve (FunctionLambda &&function, const Input &x_ini, Output &x_sol) |
| Integer | first_derivative_evaluations () const |
| Integer | max_first_derivative_evaluations () const |
| Integer | second_derivative_evaluations () const |
| Integer | max_second_derivative_evaluations () const |
| void | reset_counters () |
| bool | evaluate_function (FunctionLambda &&function, const Vector &x, TypeTrait< Vector >::Scalar &out) |
| bool | evaluate_first_derivative (FirstDerivativeLambda &&function, const Vector &x, FirstDerivative &out) |
| bool | evaluate_second_derivative (SecondDerivativeLambda &&function, const Vector &x, SecondDerivative &out) |
| bool | damp (FunctionLambda &&function, const Vector &x_old, const Vector &function_old, const Vector &step_old, Vector &x_new, Vector &function_new, Vector &step_new) |
| void | header () |
| void | bottom () |
| void | info (Scalar residuals, const std::string ¬es="-") |
| Vector | m_lower_bound |
| Vector | m_upper_bound |
| Integer | m_function_evaluations |
| Integer | m_first_derivative_evaluations |
| Integer | m_second_derivative_evaluations |
| Integer | m_max_function_evaluations |
| Integer | m_max_first_derivative_evaluations |
| Integer | m_max_second_derivative_evaluations |
| Integer | m_iterations |
| Integer | m_max_iterations |
| Scalar | m_alpha |
| Integer | m_relaxations |
| Integer | m_max_relaxations |
| Scalar | m_tolerance |
| bool | m_verbose |
| bool | m_damped |
| std::ostream * | m_ostream |
| std::string | m_task |
| bool | m_converged |
template<typename Vector>
requires
TypeTrait<Vector>::IsEigen && (!
TypeTrait<Vector>::IsFixed ||
TypeTrait<Vector>::Dimension > 0)
class Optimist::Optimizer::NelderMead< Vector >
- Template Parameters
-
◆ Costs
template<typename Vector>
Initial value:std::conditional_t<
VectorTrait::IsFixed,
Eigen::Vector<Scalar, VectorTrait::Dimension + 1>,
std::conditional_t<VectorTrait::IsDynamic,
Eigen::Vector<Scalar, Eigen::Dynamic>,
Eigen::SparseVector<Scalar>>>
◆ Factorization
template<typename Vector>
Initial value:std::conditional_t<VectorTrait::IsSparse,
Eigen::SparseLU<Simplex>,
Eigen::FullPivLU<Simplex>>
◆ MatrixD
template<typename Vector>
Initial value:std::conditional_t<
VectorTrait::IsFixed,
VectorTrait::Dimension + 1,
VectorTrait::Dimension + 1>,
std::conditional_t<
VectorTrait::IsDynamic,
Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>,
Eigen::SparseMatrix<Scalar>>>
typename Vector::Scalar Scalar
Definition NelderMead.hh:45
◆ MatrixX
template<typename Vector>
Initial value:std::conditional_t<
VectorTrait::IsFixed,
Eigen::Matrix<Scalar, VectorTrait::Dimension, VectorTrait::Dimension>,
std::conditional_t<
VectorTrait::IsDynamic,
Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>,
Eigen::SparseMatrix<Scalar>>>
◆ Method
template<typename Vector>
Initial value:
STANDARD = 0,
SPENDLEY = 1
}
enum class Method :Integer { STANDARD=0, SPENDLEY=1 } Method
Definition NelderMead.hh:101
OPTIMIST_DEFAULT_INTEGER_TYPE Integer
The Integer type as used for the API.
Definition Optimist.hh:97
NelderMead solver type enumeration.
◆ Move
template<typename Vector>
Initial value:
INITIALIZE = 0,
REFLECT = 1,
EXPAND_E = 2,
EXPAND_R = 3,
CONTRACT_O = 4,
CONTRACT_I = 5,
SHRINK = 6,
RESTART = 7
}
enum class Move :Integer { INITIALIZE=0, REFLECT=1, EXPAND_E=2, EXPAND_R=3, CONTRACT_O=4, CONTRACT_I=5, SHRINK=6, RESTART=7 } Move
Definition NelderMead.hh:87
NelderMead move type enumeration.
◆ Scalar
template<typename Vector>
◆ Simplex
template<typename Vector>
Initial value:std::conditional_t<
VectorTrait::IsFixed,
VectorTrait::Dimension,
VectorTrait::Dimension + 1>,
std::conditional_t<
VectorTrait::IsDynamic,
Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>,
Eigen::SparseMatrix<Scalar>>>
◆ VectorTrait
template<typename Vector>
◆ NelderMead() [1/2]
template<typename Vector>
◆ NelderMead() [2/2]
template<typename Vector>
Class constructor for the NelderMead solver.
- Parameters
-
| [in] | delta | Initial simplex size. |
◆ chi() [1/2]
template<typename Vector>
Get the expansion coefficient.
- Returns
- The expansion coefficient.
◆ chi() [2/2]
template<typename Vector>
Set the expansion coefficient.
- Parameters
-
| [in] | t_chi | The expansion coefficient. |
◆ delta() [1/2]
template<typename Vector>
Get the initial simplex size.
- Returns
- The initial simplex size.
◆ delta() [2/2]
template<typename Vector>
Set the initial simplex size.
- Parameters
-
| [in] | t_delta | The initial simplex size. |
◆ diamond()
template<typename Vector>
template<typename FunctionLambda>
Initialize simplex with Diamond method.
- Template Parameters
-
- Parameters
-
| [in] | function | Function lambda. |
| [in] | x | Initial point. |
| [in] | delta | Initial simplex size. |
◆ dist_init()
template<typename Vector>
Initialize distance matrix.
◆ dist_update()
template<typename Vector>
Update distance matrix.
- Parameters
-
| [in] | j | Index of the updated point. |
◆ expand()
template<typename Vector>
template<typename FunctionLambda>
Expand simplex point.
- Template Parameters
-
- Parameters
-
| [in] | function | Function lambda. |
| [out] | p | Expanded simplex point. |
- Returns
- Function value at the expanded point.
◆ extrapolate()
template<typename Vector>
template<typename FunctionLambda>
Extrapolate simplex point by a factor alpha through the face of the simplex.
- Template Parameters
-
- Parameters
-
| [in] | function | Function lambda. |
| [in] | alpha | Extrapolation factor. |
| [in] | j | Index of the point to be extrapolated. |
| [out] | p | Extrapolated simplex point. |
- Returns
- Function value at the extrapolated point.
◆ gamma() [1/2]
template<typename Vector>
Get the contraction coefficient.
- Returns
- The contraction coefficient.
◆ gamma() [2/2]
template<typename Vector>
Set the contraction coefficient.
- Parameters
-
| [in] | t_gamma | The contraction coefficient. |
◆ inside()
template<typename Vector>
template<typename FunctionLambda>
Inside contraction simplex point.
- Template Parameters
-
- Parameters
-
| [in] | function | Function lambda. |
| [out] | p | Inside contracted simplex point. |
- Returns
- Function value at the inside contracted point.
◆ method() [1/2]
template<typename Vector>
Get the enumeration type of the NelderMead solver method.
- Returns
- The NelderMead solver enumeration type.
◆ method() [2/2]
template<typename Vector>
Set the enumeration type of the NelderMead solver method.
- Parameters
-
| [in] | t_method | The NelderMead solver enumeration type. |
◆ name_impl()
template<typename Vector>
◆ outside()
template<typename Vector>
template<typename FunctionLambda>
Outside contraction simplex point.
- Template Parameters
-
- Parameters
-
| [in] | function | Function lambda. |
| [out] | p | Outside contracted simplex point. |
- Returns
- Function value at the outside contracted point.
◆ reflect()
template<typename Vector>
template<typename FunctionLambda>
Reflect simplex point.
- Template Parameters
-
- Parameters
-
| [in] | function | Function lambda. |
| [out] | p | Reflected simplex point. |
- Returns
- Function value at the reflected point.
◆ replace_point()
template<typename Vector>
Replace simplex point.
- Parameters
-
| [in] | f | Function value at the new point. |
| [in] | p | New simplex point. |
| [in] | j | Index of the point to be replaced. |
◆ rho() [1/2]
template<typename Vector>
Get the reflection coefficient.
- Returns
- The reflection coefficient.
◆ rho() [2/2]
template<typename Vector>
Set the reflection coefficient.
- Parameters
-
| [in] | t_rho | The reflection coefficient. |
◆ shrink()
template<typename Vector>
template<typename FunctionLambda>
Shrink the simplex towards the lowest (best) point.
- Template Parameters
-
- Parameters
-
◆ sigma() [1/2]
template<typename Vector>
Get the shrink coefficient.
- Returns
- The shrink coefficient.
◆ sigma() [2/2]
template<typename Vector>
Set the shrink coefficient.
- Parameters
-
| [in] | t_sigma | The shrink coefficient. |
◆ simplex_volume()
template<typename Vector>
Compute simplex volume.
- Parameters
-
| [in] | k | Index of the point to be used as reference. |
◆ solve_impl()
template<typename Vector>
template<typename FunctionLambda>
Solve the nonlinear system of equations \( \mathbf{f}(\mathbf{x}) = 0
\), with \(\mathbf{f}: \mathbb{R}^n \rightarrow \mathbb{R}^n \).
- Template Parameters
-
- Parameters
-
| [in] | function | Function lambda. |
| [in] | jacobian | Jacobian lambda. |
| [in] | x_ini | Initialization point. |
| [out] | x_sol | Solution point. |
- Returns
- The convergence boolean flag.
◆ spendley()
template<typename Vector>
template<typename FunctionLambda>
Initialize simplex with Spendley method.
- Template Parameters
-
- Parameters
-
| [in] | function | Function lambda. |
| [in] | x | Initial point. |
| [in] | delta | Initial simplex size. |
◆ volume_tolerance() [1/2]
template<typename Vector>
Get the simplex volume tolerance.
- Returns
- The simplex volume tolerance.
◆ volume_tolerance() [2/2]
template<typename Vector>
Set the simplex volume tolerance.
- Parameters
-
| [in] | t_volume_tolerance | The simplex volume tolerance. |
◆ m_chi
template<typename Vector>
◆ m_delta
template<typename Vector>
◆ m_diameter
template<typename Vector>
◆ m_dim
template<typename Vector>
◆ m_dim_factorial
template<typename Vector>
Factorial of the problem dimension.
◆ m_dist
template<typename Vector>
Distance matrix between simplex points.
◆ m_f
template<typename Vector>
◆ m_f_work
template<typename Vector>
◆ m_gamma
template<typename Vector>
◆ m_high
template<typename Vector>
Index of the highest (worst) point.
◆ m_low
template<typename Vector>
Index of the lowest (best) point.
◆ m_method
template<typename Vector>
◆ m_mid
template<typename Vector>
Index of the middle point.
◆ m_p
template<typename Vector>
◆ m_p_c
template<typename Vector>
◆ m_p_e
template<typename Vector>
◆ m_p_r
template<typename Vector>
◆ m_p_sum
template<typename Vector>
◆ m_p_work
template<typename Vector>
◆ m_regular_simplex_volume
template<typename Vector>
Volume of a regular simplex.
◆ m_rho
template<typename Vector>
◆ m_sigma
template<typename Vector>
◆ m_simplex_volume
template<typename Vector>
◆ m_volume_tolerance
template<typename Vector>
Initial value:{
Scalar m_tolerance
Definition SolverBase.hh:128
Simplex volume tolerance.
◆ RequiresFirstDerivative
template<typename Vector>
◆ RequiresFunction
template<typename Vector>
◆ RequiresSecondDerivative
template<typename Vector>
The documentation for this class was generated from the following file: