Simple optimization problem formulation (callback based configuration) More...
#include <simple_optimization_problem.h>
Public Member Functions | |
double | computeValueNonLsqObjective () override |
void | computeValuesEquality (Eigen::Ref< Eigen::VectorXd > values) override |
Compute the equality constraint values ceq(x) for the current parameter set. More... | |
void | computeValuesInequality (Eigen::Ref< Eigen::VectorXd > values) override |
Compute the inequality constraint values c(x) for the current parameter set. More... | |
void | computeValuesLsqObjective (Eigen::Ref< Eigen::VectorXd > values) override |
Compute the objective function values f(x) for the current parameter set. More... | |
int | getEqualityDimension () override |
Total dimension of equality constraints. More... | |
int | getInequalityDimension () override |
Total dimension of general inequality constraints. More... | |
int | getLsqObjectiveDimension () override |
Total dimension of least-squares objective function terms. More... | |
int | getNonLsqObjectiveDimension () override |
Total dimension of objective function terms. More... | |
int | getObjectiveDimension () override |
Get dimension of the objective (should be zero or one, includes Lsq objectives if present) More... | |
bool | isLeastSquaresProblem () const override |
Check if the underlying problem is defined in the least squares form. More... | |
SimpleOptimizationProblemWithCallbacks () | |
Default constructor (do not forget to initialize the parameter vector dimension manually) More... | |
SimpleOptimizationProblemWithCallbacks (int param_dim) | |
Construct Optimization Problem with a given parameter vector dimension. More... | |
Set callbacks for the objective function and constraints | |
void | setObjectiveFunction (std::function< void(const Eigen::VectorXd &, Eigen::Ref< Eigen::VectorXd >)> obj_fun, int obj_dim, bool lsq_form=false) |
Set objective function callback. More... | |
void | setEqualityConstraint (std::function< void(const Eigen::VectorXd &, Eigen::Ref< Eigen::VectorXd >)> eq_fun, int eq_dim) |
Set equality constraint callback. More... | |
void | setInequalityConstraint (std::function< void(const Eigen::VectorXd &, Eigen::Ref< Eigen::VectorXd >)> ineq_fun, int ineq_dim) |
Set inequality constraint callback. More... | |
![]() | |
SimpleOptimizationProblem () | |
SimpleOptimizationProblem (int parameter_dim) | |
void | resizeParameterVector (int parameter_dim) |
Resize the dimension of the parameter vector. More... | |
void | setX (const Eigen::Ref< const Eigen::VectorXd > &x) |
Eigen::VectorXd & | getXRef () |
const Eigen::VectorXd & | getX () const |
void | setLowerBounds (const Eigen::Ref< const Eigen::VectorXd > &lb) |
Eigen::VectorXd & | getLowerBoundsRef () |
const Eigen::VectorXd & | getLowerBounds () const |
void | setUpperBounds (const Eigen::Ref< const Eigen::VectorXd > &ub) |
Eigen::VectorXd & | getUpperBoundsRef () |
const Eigen::VectorXd & | getUpperBounds () const |
double | getParameterValue (int idx) override |
Return specific value of the parameter vector. More... | |
void | setParameterValue (int idx, double x) override |
Set specific value of the parameter vector. More... | |
void | getBounds (Eigen::Ref< Eigen::VectorXd > lb, Eigen::Ref< Eigen::VectorXd > ub) override |
Get lower and upper bound vector. More... | |
void | setBounds (const Eigen::Ref< const Eigen::VectorXd > &lb, const Eigen::Ref< const Eigen::VectorXd > &ub) override |
Set lower and upper bound vector. More... | |
double | getLowerBound (int idx) override |
Return specific lower bound value of a parameter. More... | |
double | getUpperBound (int idx) override |
Return specific upper bound of a parameter. More... | |
void | setLowerBound (int idx, double lb) override |
Set specific lower bound of a parameter. More... | |
void | setUpperBound (int idx, double ub) override |
Set specific upper bound of a parameter. More... | |
void | getParameterVector (Eigen::Ref< Eigen::VectorXd > x) override |
Same as getX() but less efficient (overrides interface method, but here x must not be pre-allocated) More... | |
void | setParameterVector (const Eigen::Ref< const Eigen::VectorXd > &x) override |
Same as setX() (overrides interface method) More... | |
int | getParameterDimension () override |
Effictive dimension of the optimization parameter set (changeable, non-fixed part) More... | |
void | applyIncrement (const Eigen::Ref< const Eigen::VectorXd > &increment) override |
Apply increment to the current parameter set. More... | |
void | applyIncrement (int idx, double increment) override |
Apply increment to the current parameter set (single element overload) More... | |
void | backupParameters () override |
Restore parameter set from the last backup and keep backup if desired. More... | |
void | restoreBackupParameters (bool keep_backup) override |
Discard last backup (or all) More... | |
void | discardBackupParameters (bool all=false) override |
![]() | |
virtual bool | checkIfAllUnfixedParam (std::function< bool(double, int)> fun) |
Check if a function taking the parameter value and unfixed-idx is true for all unfixed parameter values. More... | |
virtual void | clear () |
virtual void | computeCombinedSparseJacobian (Eigen::SparseMatrix< double > &jacobian, bool objective_lsq, bool equality, bool inequality, bool finite_combined_bounds, bool active_ineq=false, double weight_eq=1.0, double weight_ineq=1.0, double weight_bounds=1.0, const Eigen::VectorXd *values=nullptr, const Eigen::VectorXi *col_nnz=nullptr) |
virtual int | computeCombinedSparseJacobiansNNZ (bool objective_lsq=true, bool equality=true, bool inequality=true) |
virtual void | computeCombinedSparseJacobiansStructure (Eigen::Ref< Eigen::VectorXi > i_row, Eigen::Ref< Eigen::VectorXi > j_col, bool objective_lsq=true, bool equality=true, bool inequality=true) |
virtual void | computeCombinedSparseJacobiansValues (Eigen::Ref< Eigen::VectorXd > values, bool objective_lsq=true, bool equality=true, bool inequality=true, const double *multipliers_obj=nullptr, const double *multipliers_eq=nullptr, const double *multipliers_ineq=nullptr) |
virtual void | computeDenseHessianEqualities (Eigen::Ref< Eigen::MatrixXd > hessian, const double *multipliers=nullptr) |
virtual void | computeDenseHessianInequalities (Eigen::Ref< Eigen::MatrixXd > hessian, const double *multipliers=nullptr) |
virtual void | computeDenseHessianObjective (const Eigen::Ref< const Eigen::MatrixXd > &jacobian, Eigen::Ref< Eigen::MatrixXd > hessian, const double *multipliers=nullptr, bool jacob_scaled=true) |
Compute the objective Hessian Hf(x) for the current parameter set. More... | |
virtual void | computeDenseHessianObjective (Eigen::Ref< Eigen::MatrixXd > hessian, double multiplier=1.0) |
virtual void | computeDenseHessians (Eigen::Ref< Eigen::MatrixXd > hessian_obj, Eigen::Ref< Eigen::MatrixXd > hessian_eq, Eigen::Ref< Eigen::MatrixXd > hessian_ineq, double multiplier_obj=1.0, const double *multipliers_eq=nullptr, const double *multipliers_ineq=nullptr) |
virtual void | computeDenseJacobianActiveInequalities (Eigen::Ref< Eigen::MatrixXd > jacobian, double weight=1.0) |
Compute the Jacobian Jc(x) with non-zeros for active constraints c(x)>= 0 and zeros for inactive ones. More... | |
virtual void | computeDenseJacobianEqualities (Eigen::Ref< Eigen::MatrixXd > jacobian, const double *multipliers=nullptr) |
Compute the equality constraint Jacobian Jceq(x) for the current parameter set. More... | |
virtual void | computeDenseJacobianFiniteCombinedBounds (Eigen::Ref< Eigen::MatrixXd > jacobian, double weight=1.0) |
Compute the Jacobian for finite combined bounds. More... | |
virtual void | computeDenseJacobianFiniteCombinedBoundsIdentity (Eigen::Ref< Eigen::MatrixXd > jacobian) |
Compute the Jacobian for finite combined bounds. More... | |
virtual void | computeDenseJacobianInequalities (Eigen::Ref< Eigen::MatrixXd > jacobian, const double *multipliers=nullptr) |
Compute the inequality constraint Jacobian Jc(x) for the current parameter set. More... | |
virtual void | computeDenseJacobianLsqObjective (Eigen::Ref< Eigen::MatrixXd > jacobian, const double *multipliers=nullptr) |
Compute the objective Jacobian Jf(x) for the current parameter set. More... | |
virtual void | computeDenseJacobians (Eigen::Ref< Eigen::VectorXd > gradient_non_lsq_obj, Eigen::Ref< Eigen::MatrixXd > jacobian_lsq_obj, Eigen::Ref< Eigen::MatrixXd > jacobian_eq, Eigen::Ref< Eigen::MatrixXd > jacobian_ineq, const double *multipliers_lsq_obj=nullptr, const double *multipliers_eq=nullptr, const double *multipliers_ineq=nullptr, bool active_ineq=false, double active_ineq_weight=1.0) |
Compute the objective and constraint Jacobians at once. More... | |
virtual void | computeDistanceFiniteCombinedBounds (Eigen::Ref< Eigen::VectorXd > values) |
Compute the distance to finite bound values (combined lower and upper) More... | |
virtual void | computeGradientNonLsqObjective (Eigen::Ref< Eigen::VectorXd > gradient) |
virtual void | computeGradientObjective (Eigen::Ref< Eigen::VectorXd > gradient) |
virtual void | computeGradientObjectiveAndCombinedSparseJacobiansValues (Eigen::Ref< Eigen::VectorXd > gradient, Eigen::Ref< Eigen::VectorXd > jac_values, bool equality=true, bool inequality=true, const double *multipliers_eq=nullptr, const double *multipliers_ineq=nullptr) |
virtual void | computeLowerAndUpperBoundDiff (Eigen::Ref< Eigen::VectorXd > lb_minus_x, Eigen::Ref< Eigen::VectorXd > ub_minus_x) |
Compute the distance between parameters and bounds. More... | |
virtual void | computeSparseHessianEqualities (Eigen::SparseMatrix< double > &hessian, const double *multipliers=nullptr) |
virtual int | computeSparseHessianEqualitiesNNZ (bool lower_part_only=false) |
virtual void | computeSparseHessianEqualitiesStructure (Eigen::Ref< Eigen::VectorXi > i_row, Eigen::Ref< Eigen::VectorXi > j_col, bool lower_part_only=false) |
virtual void | computeSparseHessianEqualitiesValues (Eigen::Ref< Eigen::VectorXd > values, const double *multipliers=nullptr, bool lower_part_only=false) |
virtual void | computeSparseHessianInequalities (Eigen::SparseMatrix< double > &hessian, const double *multipliers=nullptr) |
virtual int | computeSparseHessianInequalitiesNNZ (bool lower_part_only=false) |
virtual void | computeSparseHessianInequalitiesStructure (Eigen::Ref< Eigen::VectorXi > i_row, Eigen::Ref< Eigen::VectorXi > j_col, bool lower_part_only=false) |
virtual void | computeSparseHessianInequalitiesValues (Eigen::Ref< Eigen::VectorXd > values, const double *multipliers=nullptr, bool lower_part_only=false) |
virtual void | computeSparseHessianLagrangian (Eigen::SparseMatrix< double, Eigen::ColMajor, long long > &H, const double *multipliers_eq, const double *multipliers_ineq, const Eigen::VectorXi *col_nnz=nullptr, bool upper_part_only=false) |
Compute the hessian of the lagrangian L(x) = f(x) + lambda1 * c(x) + lambda2 * ceq(x) More... | |
virtual void | computeSparseHessianLagrangianNNZperCol (Eigen::Ref< Eigen::VectorXi > col_nnz, bool upper_part_only) |
virtual void | computeSparseHessianObjective (Eigen::SparseMatrix< double > &hessian, double multiplier=1.0) |
virtual void | computeSparseHessianObjectiveLL (Eigen::SparseMatrix< double, Eigen::ColMajor, long long > &H, const Eigen::VectorXi *col_nnz=nullptr, bool upper_part_only=false) |
virtual int | computeSparseHessianObjectiveNNZ (bool lower_part_only=false) |
virtual void | computeSparseHessianObjectiveNNZperCol (Eigen::Ref< Eigen::VectorXi > col_nnz, bool upper_part_only=false) |
virtual void | computeSparseHessianObjectiveStructure (Eigen::Ref< Eigen::VectorXi > i_row, Eigen::Ref< Eigen::VectorXi > j_col, bool lower_part_only=false) |
virtual void | computeSparseHessianObjectiveValues (Eigen::Ref< Eigen::VectorXd > values, double multiplier=1.0, bool lower_part_only=false) |
virtual void | computeSparseHessians (Eigen::SparseMatrix< double > &hessian_obj, Eigen::SparseMatrix< double > &hessian_eq, Eigen::SparseMatrix< double > &hessian_ineq, double multiplier_obj=1.0, const double *multipliers_eq=nullptr, const double *multipliers_ineq=nullptr) |
virtual void | computeSparseHessiansNNZ (int &nnz_obj, int &nnz_eq, int &nnz_ineq, bool lower_part_only=false) |
virtual void | computeSparseHessiansStructure (Eigen::Ref< Eigen::VectorXi > i_row_obj, Eigen::Ref< Eigen::VectorXi > j_col_obj, Eigen::Ref< Eigen::VectorXi > i_row_eq, Eigen::Ref< Eigen::VectorXi > j_col_eq, Eigen::Ref< Eigen::VectorXi > i_row_ineq, Eigen::Ref< Eigen::VectorXi > j_col_ineq, bool lower_part_only=false) |
virtual void | computeSparseHessiansValues (Eigen::Ref< Eigen::VectorXd > values_obj, Eigen::Ref< Eigen::VectorXd > values_eq, Eigen::Ref< Eigen::VectorXd > values_ineq, double multiplier_obj=1.0, const double *multipliers_eq=nullptr, const double *multipliers_ineq=nullptr, bool lower_part_only=false) |
virtual void | computeSparseJacobianActiveInequalities (Eigen::SparseMatrix< double > &jacobian, double weight=1.0) |
virtual void | computeSparseJacobianActiveInequalitiesValues (Eigen::Ref< Eigen::VectorXd > values, double weight=1.0) |
virtual void | computeSparseJacobianEqualities (Eigen::SparseMatrix< double > &jacobian, const double *multipliers=nullptr) |
virtual int | computeSparseJacobianEqualitiesNNZ () |
virtual void | computeSparseJacobianEqualitiesStructure (Eigen::Ref< Eigen::VectorXi > i_row, Eigen::Ref< Eigen::VectorXi > j_col) |
virtual void | computeSparseJacobianEqualitiesValues (Eigen::Ref< Eigen::VectorXd > values, const double *multipliers=nullptr) |
virtual void | computeSparseJacobianFiniteCombinedBounds (Eigen::SparseMatrix< double > &jacobian, double weight=1.0) |
virtual int | computeSparseJacobianFiniteCombinedBoundsNNZ () |
virtual void | computeSparseJacobianFiniteCombinedBoundsStructure (Eigen::Ref< Eigen::VectorXi > i_row, Eigen::Ref< Eigen::VectorXi > j_col) |
virtual void | computeSparseJacobianFiniteCombinedBoundsValues (Eigen::Ref< Eigen::VectorXd > values, double weight=1.0) |
virtual void | computeSparseJacobianInequalities (Eigen::SparseMatrix< double > &jacobian, const double *multipliers=nullptr) |
virtual int | computeSparseJacobianInequalitiesNNZ () |
virtual void | computeSparseJacobianInequalitiesStructure (Eigen::Ref< Eigen::VectorXi > i_row, Eigen::Ref< Eigen::VectorXi > j_col) |
virtual void | computeSparseJacobianInequalitiesValues (Eigen::Ref< Eigen::VectorXd > values, const double *multipliers=nullptr) |
virtual void | computeSparseJacobianLsqObjective (Eigen::SparseMatrix< double > &jacobian, const double *multipliers=nullptr) |
virtual int | computeSparseJacobianLsqObjectiveNNZ () |
virtual void | computeSparseJacobianLsqObjectiveStructure (Eigen::Ref< Eigen::VectorXi > i_row, Eigen::Ref< Eigen::VectorXi > j_col) |
virtual void | computeSparseJacobianLsqObjectiveValues (Eigen::Ref< Eigen::VectorXd > values, const double *multipliers=nullptr) |
virtual void | computeSparseJacobians (Eigen::SparseMatrix< double > &jacobian_lsq_obj, Eigen::SparseMatrix< double > &jacobian_eq, Eigen::SparseMatrix< double > &jacobian_ineq, const double *multipliers_lsq_obj=nullptr, const double *multipliers_eq=nullptr, const double *multipliers_ineq=nullptr, bool active_ineq=false, double active_ineq_weight=1.0) |
virtual void | computeSparseJacobiansNNZ (int &nnz_lsq_obj, int &nnz_eq, int &nnz_ineq) |
virtual void | computeSparseJacobiansStructure (Eigen::Ref< Eigen::VectorXi > i_row_obj, Eigen::Ref< Eigen::VectorXi > j_col_obj, Eigen::Ref< Eigen::VectorXi > i_row_eq, Eigen::Ref< Eigen::VectorXi > j_col_eq, Eigen::Ref< Eigen::VectorXi > i_row_ineq, Eigen::Ref< Eigen::VectorXi > j_col_ineq) |
virtual void | computeSparseJacobiansValues (Eigen::Ref< Eigen::VectorXd > values_obj, Eigen::Ref< Eigen::VectorXd > values_eq, Eigen::Ref< Eigen::VectorXd > values_ineq, const double *multipliers_obj=nullptr, const double *multipliers_eq=nullptr, const double *multipliers_ineq=nullptr, bool active_ineq=false, double active_ineq_weight=1.0) |
virtual void | computeSparseJacobianTwoSideBoundedLinearFormAndHessianObjective (Eigen::SparseMatrix< double, Eigen::ColMajor, long long > &H, Eigen::SparseMatrix< double, Eigen::ColMajor, long long > &A, bool include_finite_bounds, const Eigen::VectorXi *col_nnz_H, const Eigen::VectorXi *col_nnz_A, bool upper_part_only_H) |
virtual void | computeValuesActiveInequality (Eigen::Ref< Eigen::VectorXd > values, double weight=1.0) |
Compute the values of the active inequality constraints (elementwise max(0, c(x))) More... | |
virtual void | getParametersAndBoundsFinite (Eigen::Ref< Eigen::VectorXd > lb_finite_bounds, Eigen::Ref< Eigen::VectorXd > ub_finite_bounds, Eigen::Ref< Eigen::VectorXd > x_finite_bounds) |
Return bound and parameter vectors only for finite boudns. More... | |
virtual | ~OptimizationProblemInterface () |
virtual double | computeValueObjective () |
virtual void | computeValues (double &non_lsq_obj_value, Eigen::Ref< Eigen::VectorXd > lsq_obj_values, Eigen::Ref< Eigen::VectorXd > eq_values, Eigen::Ref< Eigen::VectorXd > ineq_values) |
virtual int | finiteCombinedBoundsDimension () |
Dimension of the set of finite bounds (combined such that each ub and lb component define a single dimension) More... | |
virtual int | finiteBoundsDimension () |
Dimension of the set of finite bounds (individual bounds ub and lb) More... | |
virtual void | computeSparseJacobianTwoSideBoundedLinearForm (Eigen::SparseMatrix< double, Eigen::ColMajor, long long > &A, bool include_finite_bounds, const Eigen::VectorXi *col_nnz=nullptr) |
Compute the jacobian A for the linear form lbA <= A x <= lbB. More... | |
virtual void | computeSparseJacobianTwoSideBoundedLinearFormNNZPerColumn (Eigen::Ref< Eigen::VectorXi > col_nnz, bool include_finite_bounds) |
virtual int | computeSparseJacobianTwoSideBoundedLinearFormNNZ (bool include_finite_bounds) |
virtual void | computeSparseJacobianTwoSideBoundedLinearFormStructure (Eigen::Ref< Eigen::VectorXi > i_row, Eigen::Ref< Eigen::VectorXi > j_col, bool include_finite_bounds) |
virtual void | computeSparseJacobianTwoSideBoundedLinearFormValues (Eigen::Ref< Eigen::VectorXd > values, bool include_finite_bounds) |
virtual void | computeSparseJacobianTwoSideBoundedLinearFormAndHessianLagrangian (Eigen::SparseMatrix< double, Eigen::ColMajor, long long > &H, const double *multipliers_eq, const double *multipliers_ineq, Eigen::SparseMatrix< double, Eigen::ColMajor, long long > &A, bool include_finite_bounds, const Eigen::VectorXi *col_nnz_H=nullptr, const Eigen::VectorXi *col_nnz_A=nullptr, bool upper_part_only_H=false) |
Compute the Jacobian and Hessian of the lagrangian. More... | |
virtual void | computeBoundsForTwoSideBoundedLinearForm (Eigen::Ref< Eigen::VectorXd > lbA, Eigen::Ref< Eigen::VectorXd > ubA, bool include_finite_bounds) |
Compute lower and upper bounds lbA and ubA for the linear form lbA <= A x <= ubA. More... | |
Private Attributes | |
int | _eq_dim = 0 |
std::function< void(const Eigen::VectorXd &, Eigen::Ref< Eigen::VectorXd >)> | _eq_fun |
int | _ineq_dim = 0 |
std::function< void(const Eigen::VectorXd &, Eigen::Ref< Eigen::VectorXd >)> | _ineq_fun |
bool | _lsq_form = false |
int | _obj_dim = 0 |
std::function< void(const Eigen::VectorXd &, Eigen::Ref< Eigen::VectorXd >)> | _obj_fun |
Additional Inherited Members | |
![]() | |
using | Ptr = std::shared_ptr< OptimizationProblemInterface > |
using | UPtr = std::unique_ptr< OptimizationProblemInterface > |
![]() | |
bool | _warn_if_not_specialized = true |
Simple optimization problem formulation (callback based configuration)
This class defines a standard optimization problem in which the optimization vector x is represented as a simple vector. In comparison to SimpleOptimizationProblem, the objective function and constraints are integrated via callbacks rather then implementing interface methods.
For the mathematical description refer to the OptimizationProblemInterface.
Definition at line 203 of file simple_optimization_problem.h.
|
inline |
Default constructor (do not forget to initialize the parameter vector dimension manually)
Definition at line 207 of file simple_optimization_problem.h.
|
inlineexplicit |
Construct Optimization Problem with a given parameter vector dimension.
Definition at line 209 of file simple_optimization_problem.h.
|
inlineoverridevirtual |
Implements corbo::SimpleOptimizationProblem.
Definition at line 283 of file simple_optimization_problem.h.
|
inlineoverridevirtual |
Compute the equality constraint values ceq(x) for the current parameter set.
[out] | values | The resulting value vector [equalityDimension() x 1]. Warning: the size must be pre-allocated! |
Implements corbo::SimpleOptimizationProblem.
Definition at line 298 of file simple_optimization_problem.h.
|
inlineoverridevirtual |
Compute the inequality constraint values c(x) for the current parameter set.
[out] | values | The resulting value vector [inequalityDimension() x 1]. Warning: the size must be pre-allocated! |
Implements corbo::SimpleOptimizationProblem.
Definition at line 304 of file simple_optimization_problem.h.
|
inlineoverridevirtual |
Compute the objective function values f(x) for the current parameter set.
[out] | values | The resulting value vector [objectiveDimension() x 1]. Warning: the size must be pre-allocated! |
Implements corbo::SimpleOptimizationProblem.
Definition at line 292 of file simple_optimization_problem.h.
|
inlineoverridevirtual |
Total dimension of equality constraints.
Implements corbo::SimpleOptimizationProblem.
Definition at line 275 of file simple_optimization_problem.h.
|
inlineoverridevirtual |
Total dimension of general inequality constraints.
Implements corbo::SimpleOptimizationProblem.
Definition at line 277 of file simple_optimization_problem.h.
|
inlineoverridevirtual |
Total dimension of least-squares objective function terms.
Implements corbo::SimpleOptimizationProblem.
Definition at line 271 of file simple_optimization_problem.h.
|
inlineoverridevirtual |
Total dimension of objective function terms.
Implements corbo::SimpleOptimizationProblem.
Definition at line 269 of file simple_optimization_problem.h.
|
inlineoverridevirtual |
Get dimension of the objective (should be zero or one, includes Lsq objectives if present)
Implements corbo::SimpleOptimizationProblem.
Definition at line 273 of file simple_optimization_problem.h.
|
inlineoverridevirtual |
Check if the underlying problem is defined in the least squares form.
Least-squares problems are defined as and the function values and Jacobian are computed for
rather than for
. Specialiezed least-squares solvers require the optimization problem to be defined in this particular form.
In summary, the solver computes the squared l2-norm of the objective function value (scalar) if set to true.
Implements corbo::SimpleOptimizationProblem.
Definition at line 280 of file simple_optimization_problem.h.
void corbo::SimpleOptimizationProblemWithCallbacks::setEqualityConstraint | ( | std::function< void(const Eigen::VectorXd &, Eigen::Ref< Eigen::VectorXd >)> | eq_fun, |
int | eq_dim | ||
) |
Set equality constraint callback.
The prototype is as follows:
void equality(const Eigen::VectorXd& x, Eigen::Ref<Eigen::VectorXd> values);
in which x
contains the current parameter values [parameterDimension() x 1] and values
should be filled with the corresponding equality constraint values (output argument). Please note, values
is assumed to be pre-allocated with size [eq_dim x 1].
[in] | eq_fun | Set callback for the equality constraint computation |
[in] | eq_dim | Dimension of the equality constraint vector |
Definition at line 64 of file simple_optimization_problem.cpp.
void corbo::SimpleOptimizationProblemWithCallbacks::setInequalityConstraint | ( | std::function< void(const Eigen::VectorXd &, Eigen::Ref< Eigen::VectorXd >)> | ineq_fun, |
int | ineq_dim | ||
) |
Set inequality constraint callback.
The prototype is as follows:
void inequality(const Eigen::VectorXd& x, Eigen::Ref<Eigen::VectorXd> values);
in which x
contains the current parameter values [parameterDimension() x 1] and values
should be filled with the corresponding inequality constraint values (output argument). Please note, values
is assumed to be pre-allocated with size [ineq_dim x 1].
[in] | ineq_fun | Set callback for the inequality constraint computation |
[in] | ineq_dim | Dimension of the inequality constraint vector |
Definition at line 71 of file simple_optimization_problem.cpp.
void corbo::SimpleOptimizationProblemWithCallbacks::setObjectiveFunction | ( | std::function< void(const Eigen::VectorXd &, Eigen::Ref< Eigen::VectorXd >)> | obj_fun, |
int | obj_dim, | ||
bool | lsq_form = false |
||
) |
Set objective function callback.
The prototype is as follows:
void objective(const Eigen::VectorXd& x, Eigen::Ref<Eigen::VectorXd> values);
in which x
contains the current parameter values [parameterDimension() x 1] and values
should be filled with the corresponding objective functin values (output argument). Please note, values
is assumed to be pre-allocated with size [obj_dim x 1].
Argument lsq_form
indicates that the solver should take the squared l2-norm of the objective function vector: e.g., . Hereby,
denotes the objective function value vector with size [obj_dim x 1].
[in] | obj_fun | Set callback for the objective function computation |
[in] | obj_dim | Dimension of the objective function vector |
[in] | lsq_form | If true, the solver takes the squared l2-norm of the obejctive function value. |
Definition at line 56 of file simple_optimization_problem.cpp.
|
private |
Definition at line 311 of file simple_optimization_problem.h.
|
private |
Definition at line 316 of file simple_optimization_problem.h.
|
private |
Definition at line 312 of file simple_optimization_problem.h.
|
private |
Definition at line 317 of file simple_optimization_problem.h.
|
private |
Definition at line 313 of file simple_optimization_problem.h.
|
private |
Definition at line 310 of file simple_optimization_problem.h.
|
private |
Definition at line 315 of file simple_optimization_problem.h.