A simplified interface for NLP modeling/solving. More...
#include <optistack_internal.hpp>
Extra doc: https://github.com/casadi/casadi/wiki/L_172
Definition at line 55 of file optistack_internal.hpp.

Public Member Functions | |
| OptiNode (const std::string &problem_type) | |
| Create Opti Context. More... | |
| ~OptiNode () | |
| Destructor. 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") |
| Create a parameter (symbol); fixed during optimization. More... | |
| 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 (const MX &g, const DM &linear_scale=1, const Dict &options=Dict()) |
| brief Add constraints More... | |
| void | subject_to () |
| Clear constraints. More... | |
| void | solver (const std::string &solver, const Dict &plugin_options=Dict(), const Dict &solver_options=Dict()) |
| Solver. More... | |
| void | set_domain (const MX &x, const std::string &domain) |
| Set domain of variable. More... | |
| void | set_linear_scale (const MX &x, const DM &scale, const DM &offset) |
| Set scale of a decision variable. More... | |
| OptiSol | solve (bool accept_limit) |
| Crunch the numbers; solve the problem. More... | |
| Opti | copy () const |
| Copy. More... | |
| Dict | stats () const |
| Get statistics. More... | |
| std::string | return_status () const |
| Get return status of solver. More... | |
| bool | return_success (bool accept_limit) const |
| Did the solver return successfully? More... | |
| Function | casadi_solver () const |
| Get the underlying CasADi solver of the Opti stack. More... | |
| Function | scale_helper (const Function &h) const |
| Scale a helper function constructed via opti.x, opti.g, ... 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 |
| void | callback_class (OptiCallback *callback) |
| void | callback_class () |
| bool | has_callback_class () const |
| bool | is_parametric (const MX &expr) const |
| return true if expression is only dependant on Opti parameters, not variables More... | |
| MetaCon | canon_expr (const MX &expr, const DM &linear_scale=1) const |
| Interpret an expression (for internal use only) More... | |
| MetaVar | get_meta (const MX &m) const |
| Get meta-data of symbol (for internal use only) More... | |
| MetaCon | get_meta_con (const MX &m) const |
| Get meta-data of symbol (for internal use only) More... | |
| void | set_meta (const MX &m, const MetaVar &meta) |
| Set meta-data of an expression. More... | |
| void | set_meta_con (const MX &m, const MetaCon &meta) |
| Set meta-data of an expression. More... | |
| void | update_user_dict (const MX &m, const Dict &meta) |
| add meta-data of an expression More... | |
| Dict | user_dict (const MX &m) const |
| MX | dual (const MX &m) const |
| get the dual variable More... | |
| void | assert_active_symbol (const MX &m) const |
| std::vector< MX > | symvar (VariableType type) const |
| std::vector< MX > | active_symvar (VariableType type) const |
| std::vector< DM > | active_values (VariableType type) const |
| std::vector< DM > | active_values (VariableType type, const std::map< VariableType, std::vector< DM > > &store) const |
| MX | x_lookup (casadi_int i) const |
| MX | g_lookup (casadi_int i) const |
| std::string | x_describe (casadi_int i, const Dict &opts=Dict()) const |
| std::string | g_describe (casadi_int i, const Dict &opts=Dict()) const |
| std::string | describe (const MX &x, casadi_int indent=0, const Dict &opts=Dict()) const |
| void | solve_prepare () |
| Function | solver_construct (bool callback=true) |
| DMDict | solve_actual (const DMDict &args) |
| DMDict | arg () const |
| void | res (const DMDict &res) |
| DMDict | res () const |
| std::vector< MX > | constraints () const |
| MX | objective () const |
| OptiAdvanced | baked_copy () const |
| std::string | class_name () const override |
| 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 |
| MX | ubg () const |
| MX | lam_g () const |
| Get dual variables as a symbolic column vector. More... | |
| DM | x_linear_scale () const |
| DM | x_linear_scale_offset () const |
| DM | g_linear_scale () const |
| double | f_linear_scale () const |
| void | assert_empty () const |
| void | show_infeasibilities (double tol=0, const Dict &opts=Dict()) const |
| 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) |
| Create a CasADi Function from the Opti solver. More... | |
| void | disp (std::ostream &stream, bool more=false) const override |
| Print representation. More... | |
| void | bake () |
| Fix the structure of the optimization problem. More... | |
| casadi_int | instance_number () const |
| void | mark_problem_dirty (bool flag=true) |
| bool | problem_dirty () const |
| void | mark_solver_dirty (bool flag=true) |
| bool | solver_dirty () const |
| void | mark_solved (bool flag=true) |
| bool | solved () const |
| void | assert_solved () const |
| void | assert_baked () const |
| casadi_int | g_index_reduce_g (casadi_int i) const |
| casadi_int | g_index_reduce_x (casadi_int i) const |
| casadi_int | g_index_unreduce_g (casadi_int i) const |
| 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... | |
| DM | value (const MX &x, const std::vector< MX > &values=std::vector< MX >(), bool scaled=false) const |
| DM | value (const DM &x, const std::vector< MX > &values=std::vector< MX >(), bool scaled=false) const |
| DM | value (const SX &x, const std::vector< MX > &values=std::vector< MX >(), bool scaled=false) const |
| std::vector< MX > | symvar () const |
| std::vector< MX > | symvar (const MX &expr) const |
| std::vector< MX > | symvar (const MX &expr, VariableType type) const |
Static Public Member Functions | |
| static OptiNode * | create (const std::string &problem_type) |
Public Attributes | |
| bool | problem_dirty_ |
| bool | solver_dirty_ |
| bool | solved_ |
Friends | |
| class | InternalOptiCallback |
| casadi::OptiNode::OptiNode | ( | const std::string & | problem_type | ) |
| casadi::OptiNode::~OptiNode | ( | ) |
| std::vector<MX> casadi::OptiNode::active_symvar | ( | VariableType | type | ) | const |
| std::vector<DM> casadi::OptiNode::active_values | ( | VariableType | type | ) | const |
| std::vector<DM> casadi::OptiNode::active_values | ( | VariableType | type, |
| const std::map< VariableType, std::vector< DM > > & | store | ||
| ) | const |
|
inline |
Definition at line 210 of file optistack_internal.hpp.
| void casadi::OptiNode::assert_active_symbol | ( | const MX & | m | ) | const |
| void casadi::OptiNode::assert_baked | ( | ) | const |
| void casadi::OptiNode::assert_empty | ( | ) | const |
| void casadi::OptiNode::assert_solved | ( | ) | const |
| void casadi::OptiNode::bake | ( | ) |
|
inline |
Definition at line 216 of file optistack_internal.hpp.
| void casadi::OptiNode::callback_class | ( | ) |
| void casadi::OptiNode::callback_class | ( | OptiCallback * | callback | ) |
| Function casadi::OptiNode::casadi_solver | ( | ) | const |
|
inlineoverride |
Definition at line 222 of file optistack_internal.hpp.
|
inline |
Definition at line 213 of file optistack_internal.hpp.
| Opti casadi::OptiNode::copy | ( | ) | const |
|
static |
| std::string casadi::OptiNode::describe | ( | const MX & | x, |
| casadi_int | indent = 0, |
||
| const Dict & | opts = Dict() |
||
| ) | const |
|
override |
|
inline |
Definition at line 261 of file optistack_internal.hpp.
|
inline |
Definition at line 294 of file optistack_internal.hpp.
|
inline |
Definition at line 255 of file optistack_internal.hpp.
| casadi_int casadi::OptiNode::g_index_reduce_g | ( | casadi_int | i | ) | const |
| casadi_int casadi::OptiNode::g_index_reduce_x | ( | casadi_int | i | ) | const |
| casadi_int casadi::OptiNode::g_index_unreduce_g | ( | casadi_int | i | ) | const |
|
inline |
Definition at line 290 of file optistack_internal.hpp.
| MX casadi::OptiNode::g_lookup | ( | casadi_int | i | ) | const |
| bool casadi::OptiNode::has_callback_class | ( | ) | const |
| std::vector<MX> casadi::OptiNode::initial | ( | ) | const |
| casadi_int casadi::OptiNode::instance_number | ( | ) | const |
| bool casadi::OptiNode::is_parametric | ( | const MX & | expr | ) | const |
|
inline |
Definition at line 277 of file optistack_internal.hpp.
|
inline |
Definition at line 266 of file optistack_internal.hpp.
|
inline |
Definition at line 322 of file optistack_internal.hpp.
|
inline |
Definition at line 330 of file optistack_internal.hpp.
|
inline |
Definition at line 326 of file optistack_internal.hpp.
| void casadi::OptiNode::minimize | ( | const MX & | f, |
| double | linear_scale = 1 |
||
| ) |
|
inline |
Definition at line 237 of file optistack_internal.hpp.
|
inline |
Definition at line 231 of file optistack_internal.hpp.
|
inline |
Definition at line 225 of file optistack_internal.hpp.
|
inline |
Definition at line 214 of file optistack_internal.hpp.
|
inline |
Definition at line 249 of file optistack_internal.hpp.
| MX casadi::OptiNode::parameter | ( | casadi_int | n = 1, |
| casadi_int | m = 1, |
||
| const std::string & | attribute = "full" |
||
| ) |
|
inline |
Definition at line 323 of file optistack_internal.hpp.
|
inline |
Definition at line 212 of file optistack_internal.hpp.
| void casadi::OptiNode::res | ( | const DMDict & | res | ) |
| std::string casadi::OptiNode::return_status | ( | ) | const |
| bool casadi::OptiNode::return_success | ( | bool | accept_limit | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2cd
| void casadi::OptiNode::set_domain | ( | const MX & | x, |
| const std::string & | domain | ||
| ) |
Set initial value for decision variables
| void casadi::OptiNode::set_initial | ( | const std::vector< MX > & | assignments | ) |
Set initial value for decision variables
Each parameter must be given a value before 'solve' can be called
Extra doc: https://github.com/casadi/casadi/wiki/L_173
| void casadi::OptiNode::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_173
| OptiSol casadi::OptiNode::solve | ( | bool | accept_limit | ) |
| void casadi::OptiNode::solve_prepare | ( | ) |
|
inline |
Definition at line 331 of file optistack_internal.hpp.
| void casadi::OptiNode::solver | ( | const std::string & | solver, |
| const Dict & | plugin_options = Dict(), |
||
| const Dict & | solver_options = Dict() |
||
| ) |
| Function casadi::OptiNode::solver_construct | ( | bool | callback = true | ) |
|
inline |
Definition at line 327 of file optistack_internal.hpp.
| Dict casadi::OptiNode::stats | ( | ) | const |
| void casadi::OptiNode::subject_to | ( | ) |
| void casadi::OptiNode::subject_to | ( | const MX & | g, |
| const DM & | linear_scale = 1, |
||
| const Dict & | options = Dict() |
||
| ) |
| std::vector<MX> casadi::OptiNode::symvar | ( | ) | const |
Get symbols present in expression
| std::vector<MX> casadi::OptiNode::symvar | ( | const MX & | expr, |
| VariableType | type | ||
| ) | const |
Get symbols present in expression
| std::vector<MX> casadi::OptiNode::symvar | ( | VariableType | type | ) | const |
| Function casadi::OptiNode::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 | ||
| ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_174
|
inline |
Definition at line 271 of file optistack_internal.hpp.
|
inline |
Obtain value of expression at the current value
Definition at line 121 of file optistack_internal.hpp.
| DM casadi::OptiNode::value | ( | const MX & | x, |
| const std::vector< MX > & | values = std::vector< MX >(), |
||
| bool | scaled = false |
||
| ) | const |
Obtain value of expression at the current value
|
inline |
Obtain value of expression at the current value
Definition at line 123 of file optistack_internal.hpp.
| std::vector<MX> casadi::OptiNode::value_parameters | ( | ) | const |
| std::vector<MX> casadi::OptiNode::value_variables | ( | ) | const |
| MX casadi::OptiNode::variable | ( | casadi_int | n = 1, |
| casadi_int | m = 1, |
||
| const std::string & | attribute = "full" |
||
| ) |
|
inline |
Definition at line 243 of file optistack_internal.hpp.
|
inline |
Definition at line 282 of file optistack_internal.hpp.
|
inline |
Definition at line 286 of file optistack_internal.hpp.
| MX casadi::OptiNode::x_lookup | ( | casadi_int | i | ) | const |
|
friend |
Definition at line 57 of file optistack_internal.hpp.
| bool casadi::OptiNode::problem_dirty_ |
Definition at line 321 of file optistack_internal.hpp.
| bool casadi::OptiNode::solved_ |
Definition at line 329 of file optistack_internal.hpp.
| bool casadi::OptiNode::solver_dirty_ |
Definition at line 325 of file optistack_internal.hpp.