pysolver_view.optimization.problems.rosenbrock module#
- class pysolver_view.optimization.problems.rosenbrock.RosenbrockProblem(dim)[source]#
Bases:
OptimizationProblemImplementation of the Rosenbrock problem.
The Rosenbrock problem, also known as Rosenbrock’s valley or banana function, is defined as:
\[\begin{split}\begin{align} \text{minimize} \quad & f(\mathbf{x}) = \sum_{i=1}^{n-1} \left[ 100(x_{i+1} - x_i^2)^2 + (x_i - 1)^2 \right] \\ \end{align}\end{split}\]Methods
evaluate_problem(x)
Evaluates the Rosenbrock function and its constraints.
get_bounds()
Returns the bounds for the problem.
get_n_eq()
Returns the number of equality constraints.
get_n_ineq()
Returns the number of inequality constraints.
- get_bounds()[source]#
Get the bounds for each decision variable (Pygmo format)
- Returns:
- boundstuple of lists
A tuple of two items where the first item is the list of lower bounds and the second item of the list of upper bounds for the vector of decision variables. For example, ([-2 -1], [2, 1]) indicates that the first decision variable has bounds between -2 and 2, and the second has bounds between -1 and 1.
- get_nec()[source]#
Return the number of equality constraints associated with the problem.
- Returns:
- neqint
Number of equality constraints.