A simplified interface for NLP modeling/solving. More...
#include <optistack.hpp>
This class offers a view with model description facilities The API is guaranteed to be stable.
Example NLP:
opti = casadi.Opti(); x = opti.variable(); y = opti.variable(); opti.minimize( (y-x^2)^2 ); opti.subject_to( x^2+y^2==1 ); opti.subject_to( x+y>=1 ); opti.solver('ipopt'); sol = opti.solve(); sol.value(x) sol.value(y)
Example parametric NLP:
opti = casadi.Opti(); x = opti.variable(2,1); p = opti.parameter(); opti.minimize( (p*x(2)-x(1)^2)^2 ); opti.subject_to( 1<=sum(x)<=2 ); opti.solver('ipopt'); opti.set_value(p, 3); sol = opti.solve(); sol.value(x) opti.set_value(p, 5); sol = opti.solve(); sol.value(x)
Extra doc: https://github.com/casadi/casadi/wiki/L_16
Definition at line 88 of file optistack.hpp.
Public Types | |
using | internal_base_type = SharedObjectInternal |
using | base_type = SharedObject |
Public Member Functions | |
Opti (const std::string &problem_type="nlp") | |
Create Opti Context. More... | |
MX | variable (casadi_int n=1, casadi_int m=1, const std::string &attribute="full") |
Create a decision variable (symbol) More... | |
MX | variable (const Sparsity &sp, const std::string &attribute="full") |
MX | variable (const MX &symbol, const std::string &attribute="full") |
MX | parameter (casadi_int n=1, casadi_int m=1, const std::string &attribute="full") |
Create a parameter (symbol); fixed during optimization. More... | |
MX | parameter (const Sparsity &sp, const std::string &attribute="full") |
MX | parameter (const MX &symbol, const std::string &attribute="full") |
void | minimize (const MX &f, double linear_scale=1) |
Set objective. More... | |
void | subject_to () |
Clear constraints. More... | |
void | solver (const std::string &solver, const Dict &plugin_options=Dict(), const Dict &solver_options=Dict()) |
Set a solver. More... | |
Dict | stats () const |
Get statistics. More... | |
std::string | return_status () const |
Get return status of solver. More... | |
std::vector< MX > | initial () const |
get assignment expressions for initial values More... | |
std::vector< MX > | value_variables () const |
get assignment expressions for latest values More... | |
std::vector< MX > | value_parameters () const |
Function | scale_helper (const Function &h) const |
Scale a helper function constructed via opti.x, opti.g, ... More... | |
MX | dual (const MX &m) const |
get the dual variable More... | |
casadi_int | nx () const |
Number of (scalarised) decision variables. More... | |
casadi_int | np () const |
Number of (scalarised) parameters. More... | |
casadi_int | ng () const |
Number of (scalarised) constraints. More... | |
MX | x () const |
Get all (scalarised) decision variables as a symbolic column vector. More... | |
MX | p () const |
Get all (scalarised) parameters as a symbolic column vector. More... | |
MX | g () const |
Get all (scalarised) constraint expressions as a column vector. More... | |
MX | f () const |
Get objective expression. More... | |
MX | lbg () const |
Get all (scalarised) bounds on constraints as a column vector. More... | |
MX | ubg () const |
DM | x_linear_scale () const |
DM | x_linear_scale_offset () const |
DM | g_linear_scale () const |
double | f_linear_scale () const |
MX | lam_g () const |
Get all (scalarised) dual variables as a symbolic column vector. More... | |
OptiAdvanced | debug () const |
Get a copy with advanced functionality. More... | |
OptiAdvanced | advanced () const |
Get a copy with advanced functionality. More... | |
Opti | copy () const |
Get a copy of the. More... | |
void | update_user_dict (const MX &m, const Dict &meta) |
add user data More... | |
void | update_user_dict (const std::vector< MX > &m, const Dict &meta) |
Dict | user_dict (const MX &m) const |
Get user data. More... | |
std::string | type_name () const |
Readable name of the class. More... | |
void | disp (std::ostream &stream, bool more=false) const |
Print representation. More... | |
std::string | get_str (bool more=false) const |
Get string representation. More... | |
Opti (const Opti &x) | |
~Opti () | |
Destructor. More... | |
Opti (OptiNode *node) | |
std::string | class_name () const |
Get class name. More... | |
void | print_ptr (std::ostream &stream=casadi::uout()) const |
void | own (SharedObjectInternal *node) |
void | assign (SharedObjectInternal *node) |
Assign the node to a node class pointer without reference counting. More... | |
SharedObjectInternal * | get () const |
Get a const pointer to the node. More... | |
casadi_int | getCount () const |
Get the reference count. More... | |
void | swap (GenericShared &other) |
Swap content with another instance. More... | |
std::string | debug_repr () const |
bool | is_null () const |
Is a null pointer? More... | |
casadi_int | __hash__ () const |
Returns a number that is unique for a given Node. More... | |
GenericWeakRef< SharedObject, SharedObjectInternal > * | weak () |
Get a weak reference to the object. More... | |
void | subject_to (const MX &g, const Dict &options=Dict()) |
Add constraints. More... | |
void | subject_to (const std::vector< MX > &g, const Dict &options=Dict()) |
Add constraints. More... | |
void | subject_to (const MX &g, const DM &linear_scale, const Dict &options=Dict()) |
Add constraints. More... | |
void | subject_to (const std::vector< MX > &g, const DM &linear_scale, const Dict &options=Dict()) |
Add constraints. More... | |
void | set_initial (const MX &x, const DM &v) |
void | set_initial (const std::vector< MX > &assignments) |
void | set_value (const MX &x, const DM &v) |
Set value of parameter. More... | |
void | set_value (const std::vector< MX > &assignments) |
Set value of parameter. More... | |
void | set_domain (const MX &x, const std::string &domain) |
Set domain of a decision variable. More... | |
void | set_linear_scale (const MX &x, const DM &scale, const DM &offset=0) |
Set scale of a decision variable. More... | |
OptiSol | solve () |
Crunch the numbers; solve the problem. More... | |
OptiSol | solve_limited () |
Crunch the numbers; solve the problem. More... | |
native_DM | value (const MX &x, const std::vector< MX > &values=std::vector< MX >()) const |
native_DM | value (const DM &x, const std::vector< MX > &values=std::vector< MX >()) const |
Set domain of a decision variable. More... | |
native_DM | value (const SX &x, const std::vector< MX > &values=std::vector< MX >()) const |
Set domain of a decision variable. More... | |
Function | to_function (const std::string &name, const std::vector< MX > &args, const std::vector< MX > &res, const Dict &opts=Dict()) |
Create a CasADi Function from the Opti solver. More... | |
Function | to_function (const std::string &name, const std::vector< MX > &args, const std::vector< MX > &res, const std::vector< std::string > &name_in, const std::vector< std::string > &name_out, const Dict &opts=Dict()) |
Create a CasADi Function from the Opti solver. More... | |
Function | to_function (const std::string &name, const std::map< std::string, MX > &dict, const std::vector< std::string > &name_in, const std::vector< std::string > &name_out, const Dict &opts=Dict()) |
Create a CasADi Function from the Opti solver. More... | |
void | callback_class (OptiCallback *callback) |
Helper methods for callback() More... | |
void | callback_class () |
Helper methods for callback() More... | |
OptiNode * | operator-> () |
Access a member of the node. More... | |
const OptiNode * | operator-> () const |
Const access a member of the node. More... | |
Static Public Member Functions | |
static MX | bounded (const MX &lb, const MX &expr, const MX &ub) |
Construct a double inequality. More... | |
static Opti | create (OptiNode *node) |
Protected Member Functions | |
void | count_up () |
void | count_down () |
Friends | |
class | InternalOptiCallback |
|
inherited |
Definition at line 103 of file shared_object.hpp.
|
inherited |
Definition at line 102 of file shared_object.hpp.
casadi::Opti::Opti | ( | const std::string & | problem_type = "nlp" | ) |
[in] | problem_type | of optimization 'nlp' or 'conic' (default nlp) |
Extra doc: https://github.com/casadi/casadi/wiki/L_17
Definition at line 47 of file optistack.cpp.
References casadi::OptiNode::create(), and casadi::GenericShared< SharedObject, SharedObjectInternal >::own().
Referenced by create().
casadi::Opti::Opti | ( | const Opti & | x | ) |
Definition at line 79 of file optistack.cpp.
References callback_class().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_1q
Definition at line 464 of file optistack.hpp.
casadi::Opti::Opti | ( | OptiNode * | node | ) |
Definition at line 75 of file optistack.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::own().
|
inherited |
If the Object does not point to any node, "0" is returned.
Extra doc: https://github.com/casadi/casadi/wiki/L_av
Definition at line 124 of file generic_shared_impl.hpp.
OptiAdvanced casadi::Opti::advanced | ( | ) | const |
You get access to more methods, but you have no guarantees about API stability
The copy is effectively a deep copy: Updating the state of the copy does not update the original.
Extra doc: https://github.com/casadi/casadi/wiki/L_1m
Definition at line 850 of file optistack.cpp.
References copy().
|
inherited |
improper use will cause memory leaks!
Extra doc: https://github.com/casadi/casadi/wiki/L_at
Definition at line 97 of file generic_shared_impl.hpp.
Constructs: lb(p) <= g(x,p) <= ub(p)
Python prohibits such syntax directly
Extra doc: https://github.com/casadi/casadi/wiki/L_1k
Definition at line 397 of file optistack.hpp.
void casadi::Opti::callback_class | ( | ) |
Do not use directly.
Extra doc: https://github.com/casadi/casadi/wiki/L_1p
Definition at line 471 of file optistack.cpp.
Referenced by Opti().
void casadi::Opti::callback_class | ( | OptiCallback * | callback | ) |
Do not use directly.
Extra doc: https://github.com/casadi/casadi/wiki/L_1p
Definition at line 463 of file optistack.cpp.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_au
Definition at line 31 of file shared_object.cpp.
Referenced by casadi::FmuFunction::check_mem_count(), casadi::MXFunction::export_code_body(), and casadi::BlazingSplineFunction::merge().
Opti casadi::Opti::copy | ( | ) | const |
The copy is effectively a deep copy: Updating the state of the copy does not update the original.
Extra doc: https://github.com/casadi/casadi/wiki/L_1n
Definition at line 853 of file optistack.cpp.
References casadi::OptiNode::copy().
Referenced by advanced(), and debug().
|
protectedinherited |
Definition at line 134 of file generic_shared_impl.hpp.
|
protectedinherited |
Definition at line 133 of file generic_shared_impl.hpp.
Definition at line 86 of file optistack.cpp.
References Opti().
Referenced by casadi::OptiNode::copy().
OptiAdvanced casadi::Opti::debug | ( | ) | const |
You get access to more methods, but you have no guarantees about API stability
The copy is effectively a deep copy: Updating the state of the copy does not update the original.
Extra doc: https://github.com/casadi/casadi/wiki/L_1l
Definition at line 847 of file optistack.cpp.
References copy().
Referenced by disp().
|
inherited |
Definition at line 113 of file generic_shared_impl.hpp.
void casadi::Opti::disp | ( | std::ostream & | stream, |
bool | more = false |
||
) | const |
Definition at line 750 of file optistack.cpp.
References casadi::OptiAdvanced::active_symvar(), casadi::OptiAdvanced::bake(), debug(), casadi::OptiAdvanced::instance_number(), ng(), np(), nx(), casadi::OPTI_DUAL_G, casadi::OPTI_PAR, casadi::OPTI_VAR, casadi::OptiAdvanced::problem_dirty(), return_status(), casadi::OptiAdvanced::solved(), and casadi::OptiAdvanced::solver_dirty().
Referenced by casadi::OptiSol::disp(), and get_str().
m must be a constraint expression. The returned value is still a symbolic expression. Use value
on it to obtain the numerical value.
Extra doc: https://github.com/casadi/casadi/wiki/L_1h
Definition at line 302 of file optistack.cpp.
MX casadi::Opti::f | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_26e
Definition at line 358 of file optistack.cpp.
Referenced by minimize(), and casadi::OptiAdvanced::objective().
double casadi::Opti::f_linear_scale | ( | ) | const |
Definition at line 415 of file optistack.cpp.
MX casadi::Opti::g | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_26d
Definition at line 350 of file optistack.cpp.
Referenced by subject_to().
DM casadi::Opti::g_linear_scale | ( | ) | const |
Definition at line 407 of file optistack.cpp.
|
inherited |
Definition at line 100 of file generic_shared_impl.hpp.
std::string casadi::Opti::get_str | ( | bool | more = false | ) | const |
Definition at line 772 of file optistack.cpp.
References disp().
Referenced by casadi::OptiSol::get_str().
|
inherited |
Definition at line 103 of file generic_shared_impl.hpp.
std::vector< MX > casadi::Opti::initial | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_266
Definition at line 278 of file optistack.cpp.
|
inherited |
Definition at line 117 of file generic_shared_impl.hpp.
MX casadi::Opti::lam_g | ( | ) | const |
Useful for obtaining the Lagrange Hessian:
* sol.value(hessian(opti.f+opti.lam_g'*opti.g,opti.x)) % MATLAB * sol.value(hessian(opti.f+dot(opti.lam_g,opti.g),opti.x)[0]) # Python *
Extra doc: https://github.com/casadi/casadi/wiki/L_1i
Definition at line 383 of file optistack.cpp.
MX casadi::Opti::lbg | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_26f
Definition at line 366 of file optistack.cpp.
void casadi::Opti::minimize | ( | const MX & | f, |
double | linear_scale = 1 |
||
) |
Objective must be a scalar. Default objective: 0 When method is called multiple times, the last call takes effect
Extra doc: https://github.com/casadi/casadi/wiki/L_1a
Definition at line 114 of file optistack.cpp.
References f().
casadi_int casadi::Opti::ng | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_26a
Definition at line 326 of file optistack.cpp.
Referenced by disp().
casadi_int casadi::Opti::np | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_269
Definition at line 318 of file optistack.cpp.
Referenced by disp().
casadi_int casadi::Opti::nx | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_268
Definition at line 310 of file optistack.cpp.
Referenced by disp().
OptiNode * casadi::Opti::operator-> | ( | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_1r
Definition at line 38 of file optistack.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::operator->().
const OptiNode * casadi::Opti::operator-> | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_1s
Definition at line 42 of file optistack.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::operator->().
|
inherited |
Assign the node to a node class pointer (or null)
Definition at line 90 of file generic_shared_impl.hpp.
MX casadi::Opti::p | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_26c
Definition at line 342 of file optistack.cpp.
MX casadi::Opti::parameter | ( | casadi_int | n = 1 , |
casadi_int | m = 1 , |
||
const std::string & | attribute = "full" |
||
) |
The order of creation does not matter. It is not required for parameter to actualy appear in the optimization problem. Parameters that do appear, must be given a value before the problem can be solved.
[in] | n | number of rows (default 1) |
[in] | m | number of columnss (default 1) |
[in] | attribute | 'full' (default) or 'symmetric' |
Extra doc: https://github.com/casadi/casadi/wiki/L_19
Definition at line 90 of file optistack.cpp.
Definition at line 106 of file optistack.cpp.
Definition at line 98 of file optistack.cpp.
|
inherited |
Print the pointer to the internal class
Definition at line 43 of file shared_object.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::get().
std::string casadi::Opti::return_status | ( | ) | const |
passed as-is from nlpsol
No stability can be guaranteed about this part of the API
Extra doc: https://github.com/casadi/casadi/wiki/L_1g
Definition at line 270 of file optistack.cpp.
Referenced by disp().
Extra doc: https://github.com/casadi/casadi/wiki/L_2ci
Definition at line 254 of file optistack.cpp.
Referenced by casadi::OptiNode::scale_helper().
void casadi::Opti::set_domain | ( | const MX & | x, |
const std::string & | domain | ||
) |
[in] | x | decision variable |
[in] | type | 'real', 'integer' (default: real) |
* opti.set_domain(x, "real") * opti.set_domain(x, "integer") *
Extra doc: https://github.com/casadi/casadi/wiki/L_27t
Definition at line 189 of file optistack.cpp.
References x().
Set initial guess for decision variables
* opti.set_initial(x, 2) * opti.set_initial(10*x(1), 2) *
Definition at line 165 of file optistack.cpp.
References x().
void casadi::Opti::set_initial | ( | const std::vector< MX > & | assignments | ) |
Set initial guess for decision variables
* opti.set_initial(x, 2) * opti.set_initial(10*x(1), 2) *
Definition at line 172 of file optistack.cpp.
(x-offset)/scale will be used in the optimization problem
[in] | x | decision variable |
[in] | scale | scaling value (default: 1) |
[in] | offset | scaling value (default: 0) |
* opti.set_linear_scale(x, 20) * opti.set_linear_scale(x, 20, 273.15) *
Extra doc: https://github.com/casadi/casadi/wiki/L_2bs
Definition at line 197 of file optistack.cpp.
References x().
Each parameter must be given a value before 'solve' can be called
Extra doc: https://github.com/casadi/casadi/wiki/L_1d
Definition at line 181 of file optistack.cpp.
References x().
void casadi::Opti::set_value | ( | const std::vector< MX > & | assignments | ) |
Each parameter must be given a value before 'solve' can be called
Extra doc: https://github.com/casadi/casadi/wiki/L_1d
Definition at line 205 of file optistack.cpp.
OptiSol casadi::Opti::solve | ( | ) |
Definition at line 213 of file optistack.cpp.
OptiSol casadi::Opti::solve_limited | ( | ) |
Allows the solver to return without error when an iteration or time limit is reached
Extra doc: https://github.com/casadi/casadi/wiki/L_1e
Definition at line 221 of file optistack.cpp.
void casadi::Opti::solver | ( | const std::string & | solver, |
const Dict & | plugin_options = Dict() , |
||
const Dict & | solver_options = Dict() |
||
) |
[in] | solver | any of the nlpsol plugins can be used here In practice, not all nlpsol plugins may be supported yet |
[in] | options | passed on to nlpsol plugin No stability can be guaranteed about this part of the API |
[in] | options | to be passed to nlpsol solver No stability can be guaranteed about this part of the API |
Extra doc: https://github.com/casadi/casadi/wiki/L_1c
Definition at line 155 of file optistack.cpp.
Dict casadi::Opti::stats | ( | ) | const |
nlpsol stats are passed as-is. No stability can be guaranteed about this part of the API
Extra doc: https://github.com/casadi/casadi/wiki/L_1f
Definition at line 262 of file optistack.cpp.
Referenced by casadi::OptiSol::stats().
void casadi::Opti::subject_to | ( | ) |
Examples:
* \begin{itemize} * opti.subject_to( sqrt(x+y) >= 1); * opti.subject_to( sqrt(x+y) > 1)}: same as above * opti.subject_to( 1<= sqrt(x+y) )}: same as above * opti.subject_to( 5*x+y==1 )}: equality * * Python * opti.subject_to([x*y>=1,x==3]) * opti.subject_to(opti.bounded(0,x,1)) * * MATLAB * opti.subject_to({x*y>=1,x==3}) * opti.subject_to( 0<=x<=1 ) *
Related functionalities:
opti.debug.show_infeasibilities() may be used to inspect which constraints are violated
Extra doc: https://github.com/casadi/casadi/wiki/L_1b
Definition at line 122 of file optistack.cpp.
References g().
void casadi::Opti::subject_to | ( | const MX & | g, |
const DM & | linear_scale, | ||
const Dict & | options = Dict() |
||
) |
Examples:
* \begin{itemize} * opti.subject_to( sqrt(x+y) >= 1); * opti.subject_to( sqrt(x+y) > 1)}: same as above * opti.subject_to( 1<= sqrt(x+y) )}: same as above * opti.subject_to( 5*x+y==1 )}: equality * * Python * opti.subject_to([x*y>=1,x==3]) * opti.subject_to(opti.bounded(0,x,1)) * * MATLAB * opti.subject_to({x*y>=1,x==3}) * opti.subject_to( 0<=x<=1 ) *
Related functionalities:
opti.debug.show_infeasibilities() may be used to inspect which constraints are violated
Extra doc: https://github.com/casadi/casadi/wiki/L_1b
Definition at line 134 of file optistack.cpp.
References g().
Examples:
* \begin{itemize} * opti.subject_to( sqrt(x+y) >= 1); * opti.subject_to( sqrt(x+y) > 1)}: same as above * opti.subject_to( 1<= sqrt(x+y) )}: same as above * opti.subject_to( 5*x+y==1 )}: equality * * Python * opti.subject_to([x*y>=1,x==3]) * opti.subject_to(opti.bounded(0,x,1)) * * MATLAB * opti.subject_to({x*y>=1,x==3}) * opti.subject_to( 0<=x<=1 ) *
Related functionalities:
opti.debug.show_infeasibilities() may be used to inspect which constraints are violated
Extra doc: https://github.com/casadi/casadi/wiki/L_1b
Definition at line 130 of file optistack.cpp.
References g(), and subject_to().
void casadi::Opti::subject_to | ( | const std::vector< MX > & | g, |
const DM & | linear_scale, | ||
const Dict & | options = Dict() |
||
) |
Examples:
* \begin{itemize} * opti.subject_to( sqrt(x+y) >= 1); * opti.subject_to( sqrt(x+y) > 1)}: same as above * opti.subject_to( 1<= sqrt(x+y) )}: same as above * opti.subject_to( 5*x+y==1 )}: equality * * Python * opti.subject_to([x*y>=1,x==3]) * opti.subject_to(opti.bounded(0,x,1)) * * MATLAB * opti.subject_to({x*y>=1,x==3}) * opti.subject_to( 0<=x<=1 ) *
Related functionalities:
opti.debug.show_infeasibilities() may be used to inspect which constraints are violated
Extra doc: https://github.com/casadi/casadi/wiki/L_1b
Definition at line 142 of file optistack.cpp.
References g(), and subject_to().
|
inherited |
Definition at line 106 of file generic_shared_impl.hpp.
Function casadi::Opti::to_function | ( | const std::string & | name, |
const std::map< std::string, MX > & | dict, | ||
const std::vector< std::string > & | name_in, | ||
const std::vector< std::string > & | name_out, | ||
const Dict & | opts = Dict() |
||
) |
[in] | name | Name of the resulting CasADi Function |
[in] | args | List of parameters and decision/dual variables (which can be given an initial guess) with the resulting Function |
[in] | res | List of expressions that will get evaluated at the optimal solution |
[in] | opts | Standard CasADi Funcion options |
Extra doc: https://github.com/casadi/casadi/wiki/L_1j
Definition at line 441 of file optistack.cpp.
References casadi::find(), and to_function().
Function casadi::Opti::to_function | ( | const std::string & | name, |
const std::vector< MX > & | args, | ||
const std::vector< MX > & | res, | ||
const Dict & | opts = Dict() |
||
) |
[in] | name | Name of the resulting CasADi Function |
[in] | args | List of parameters and decision/dual variables (which can be given an initial guess) with the resulting Function |
[in] | res | List of expressions that will get evaluated at the optimal solution |
[in] | opts | Standard CasADi Funcion options |
Extra doc: https://github.com/casadi/casadi/wiki/L_1j
Definition at line 435 of file optistack.cpp.
Referenced by to_function(), and casadi::OptiNode::to_function().
Function casadi::Opti::to_function | ( | const std::string & | name, |
const std::vector< MX > & | args, | ||
const std::vector< MX > & | res, | ||
const std::vector< std::string > & | name_in, | ||
const std::vector< std::string > & | name_out, | ||
const Dict & | opts = Dict() |
||
) |
[in] | name | Name of the resulting CasADi Function |
[in] | args | List of parameters and decision/dual variables (which can be given an initial guess) with the resulting Function |
[in] | res | List of expressions that will get evaluated at the optimal solution |
[in] | opts | Standard CasADi Funcion options |
Extra doc: https://github.com/casadi/casadi/wiki/L_1j
Definition at line 423 of file optistack.cpp.
|
inline |
Definition at line 440 of file optistack.hpp.
MX casadi::Opti::ubg | ( | ) | const |
Definition at line 374 of file optistack.cpp.
Add arbitrary data in the form of a dictionary to symbols or constraints
Extra doc: https://github.com/casadi/casadi/wiki/L_1o
Definition at line 479 of file optistack.cpp.
Referenced by update_user_dict().
Definition at line 487 of file optistack.cpp.
References update_user_dict().
Definition at line 492 of file optistack.cpp.
[in] | x | decision variable |
[in] | type | 'real', 'integer' (default: real) |
* opti.set_domain(x, "real") * opti.set_domain(x, "integer") *
Extra doc: https://github.com/casadi/casadi/wiki/L_27t
Definition at line 238 of file optistack.cpp.
References x().
Obtain value of expression at the current value
In regular mode, teh current value is the converged solution In debug mode, the value can be non-converged
[in] | values | Optional assignment expressions (e.g. x==3) to overrule the current value |
Definition at line 229 of file optistack.cpp.
References x().
Referenced by casadi::OptiSol::value().
[in] | x | decision variable |
[in] | type | 'real', 'integer' (default: real) |
* opti.set_domain(x, "real") * opti.set_domain(x, "integer") *
Extra doc: https://github.com/casadi/casadi/wiki/L_27t
Definition at line 246 of file optistack.cpp.
References x().
std::vector< MX > casadi::Opti::value_parameters | ( | ) | const |
std::vector< MX > casadi::Opti::value_variables | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_267
Definition at line 286 of file optistack.cpp.
Referenced by casadi::OptiSol::value_variables().
MX casadi::Opti::variable | ( | casadi_int | n = 1 , |
casadi_int | m = 1 , |
||
const std::string & | attribute = "full" |
||
) |
The order of creation matters. The order will be reflected in the optimization problem. It is not required for decision variables to actualy appear in the optimization problem.
[in] | n | number of rows (default 1) |
[in] | m | number of columnss (default 1) |
[in] | attribute | 'full' (default) or 'symmetric' |
Extra doc: https://github.com/casadi/casadi/wiki/L_18
Definition at line 51 of file optistack.cpp.
Definition at line 67 of file optistack.cpp.
Definition at line 59 of file optistack.cpp.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_aw
Definition at line 131 of file generic_shared_impl.hpp.
MX casadi::Opti::x | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_26b
Definition at line 334 of file optistack.cpp.
Referenced by casadi::OptiAdvanced::describe(), set_domain(), set_initial(), set_linear_scale(), set_value(), and value().
DM casadi::Opti::x_linear_scale | ( | ) | const |
Definition at line 391 of file optistack.cpp.
DM casadi::Opti::x_linear_scale_offset | ( | ) | const |
Definition at line 399 of file optistack.cpp.
|
friend |
Definition at line 91 of file optistack.hpp.