List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
casadi::OptiSol Class Reference

A simplified interface for NLP modeling/solving. More...

#include <optistack.hpp>

Detailed Description

This class offers a view with solution retrieval facilities The API is guaranteed to be stable.

Date
2017
Author
Joris Gillis, Erik Lambrechts

Extra doc: https://github.com/casadi/casadi/wiki/L_1v

Definition at line 662 of file optistack.hpp.

Inheritance diagram for casadi::OptiSol:
Inheritance graph
[legend]
Collaboration diagram for casadi::OptiSol:
Collaboration graph
[legend]

Public Member Functions

std::string type_name () const
 
void disp (std::ostream &stream, bool more=false) const
 
std::string get_str (bool more=false) const
 
std::vector< MXvalue_variables () const
 get assignment expressions for the optimal solution More...
 
std::vector< MXvalue_parameters () const
 
Dict stats () const
 Get statistics. More...
 
Opti opti () const
 
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
 
native_DM value (const SX &x, const std::vector< MX > &values=std::vector< MX >()) const
 

Protected Member Functions

 OptiSol (const Opti &opti)
 

Protected Attributes

OptiAdvanced optistack_
 

Friends

class OptiNode
 

Constructor & Destructor Documentation

◆ OptiSol()

casadi::OptiSol::OptiSol ( const Opti opti)
protected

Definition at line 857 of file optistack.cpp.

857  : optistack_(opti) {
858 }
Opti opti() const
Definition: optistack.hpp:694
OptiAdvanced optistack_
Definition: optistack.hpp:698

Member Function Documentation

◆ disp()

void casadi::OptiSol::disp ( std::ostream &  stream,
bool  more = false 
) const

Definition at line 860 of file optistack.cpp.

860  {
861  optistack_.disp(stream, more);
862 }
void disp(std::ostream &stream, bool more=false) const
Print representation.
Definition: optistack.cpp:750

References casadi::Opti::disp(), and optistack_.

◆ get_str()

std::string casadi::OptiSol::get_str ( bool  more = false) const

Definition at line 864 of file optistack.cpp.

864  {
865  return optistack_.get_str(more);
866 }
std::string get_str(bool more=false) const
Get string representation.
Definition: optistack.cpp:772

References casadi::Opti::get_str(), and optistack_.

◆ opti()

Opti casadi::OptiSol::opti ( ) const
inline

Definition at line 694 of file optistack.hpp.

694 { return optistack_; } // NOLINT(cppcoreguidelines-slicing)

◆ stats()

Dict casadi::OptiSol::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_1w

Definition at line 886 of file optistack.cpp.

886  {
887  return optistack_.stats();
888 }
Dict stats() const
Get statistics.
Definition: optistack.cpp:262

References optistack_, and casadi::Opti::stats().

◆ type_name()

std::string casadi::OptiSol::type_name ( ) const
inline

Definition at line 665 of file optistack.hpp.

665 {return "OptiSol";}

◆ value() [1/3]

DM casadi::OptiSol::value ( const DM x,
const std::vector< MX > &  values = std::vector<MX>() 
) const

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

Parameters
[in]valuesOptional assignment expressions (e.g. x==3) to overrule the current value

Definition at line 871 of file optistack.cpp.

871  {
872  return optistack_.value(x, values);
873 }
native_DM value(const MX &x, const std::vector< MX > &values=std::vector< MX >()) const
Definition: optistack.cpp:229

References optistack_, and casadi::Opti::value().

◆ value() [2/3]

DM casadi::OptiSol::value ( const MX x,
const std::vector< MX > &  values = std::vector<MX>() 
) const

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

Parameters
[in]valuesOptional assignment expressions (e.g. x==3) to overrule the current value

Definition at line 868 of file optistack.cpp.

868  {
869  return optistack_.value(x, values);
870 }

References optistack_, and casadi::Opti::value().

◆ value() [3/3]

DM casadi::OptiSol::value ( const SX x,
const std::vector< MX > &  values = std::vector<MX>() 
) const

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

Parameters
[in]valuesOptional assignment expressions (e.g. x==3) to overrule the current value

Definition at line 874 of file optistack.cpp.

874  {
875  return optistack_.value(x, values);
876 }

References optistack_, and casadi::Opti::value().

◆ value_parameters()

std::vector< MX > casadi::OptiSol::value_parameters ( ) const

Definition at line 882 of file optistack.cpp.

882  {
883  return optistack_.value_parameters();
884 }
std::vector< MX > value_parameters() const
Definition: optistack.cpp:294

References optistack_, and casadi::Opti::value_parameters().

◆ value_variables()

std::vector< MX > casadi::OptiSol::value_variables ( ) const

Definition at line 878 of file optistack.cpp.

878  {
879  return optistack_.value_variables();
880 }
std::vector< MX > value_variables() const
get assignment expressions for latest values
Definition: optistack.cpp:286

References optistack_, and casadi::Opti::value_variables().

Friends And Related Function Documentation

◆ OptiNode

friend class OptiNode
friend

Definition at line 663 of file optistack.hpp.

Member Data Documentation

◆ optistack_

OptiAdvanced casadi::OptiSol::optistack_
protected

Definition at line 698 of file optistack.hpp.

Referenced by disp(), get_str(), stats(), value(), value_parameters(), and value_variables().


The documentation for this class was generated from the following files: