List of all members | Public Member Functions
casadi::NlpBuilder Class Reference

A symbolic NLP representation. More...

#include <nlp_builder.hpp>

Detailed Description

Date
2012-2015
Author
Joel Andersson
Extra doc: https://github.com/casadi/casadi/wiki/L_1e2 

Definition at line 39 of file nlp_builder.hpp.

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

Public Member Functions

void import_nl (const std::string &filename, const Dict &opts=Dict())
 Import an .nl file. More...
 
std::string type_name () const
 Readable name of the class. More...
 
void disp (std::ostream &stream, bool more=false) const
 Print a description of the object. More...
 
std::string get_str (bool more=false) const
 Get string representation. More...
 

Public Attributes

Symbolic representation of the NLP

Data members

std::vector< MXx
 Variables. More...
 
MX f
 Objective. More...
 
std::vector< MXg
 Constraints. More...
 
std::vector< double > x_lb
 Bounds on x. More...
 
std::vector< double > x_ub
 Variables. More...
 
std::vector< double > g_lb
 Bounds on g. More...
 
std::vector< double > g_ub
 Variables. More...
 
std::vector< double > x_init
 Primal initial guess. More...
 
std::vector< double > lambda_init
 Dual initial guess. More...
 
std::vector< bool > discrete
 Discrete variables. More...
 

Member Function Documentation

◆ disp()

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

Definition at line 37 of file nlp_builder.cpp.

37  {
38  stream << "#x=" << this->x.size() << ", #g=" << this->g.size();
39  if (more) {
40  stream << std::endl;
41  stream << "x = " << this->x << std::endl;
42  stream << "f = " << this->f << std::endl;
43  stream << "g = " << this->g << std::endl;
44  }
45  }
std::vector< MX > x
Variables.
Definition: nlp_builder.hpp:49
std::vector< MX > g
Constraints.
Definition: nlp_builder.hpp:55
MX f
Objective.
Definition: nlp_builder.hpp:52

References f, g, and x.

◆ get_str()

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

Definition at line 83 of file nlp_builder.hpp.

83  {
84  std::stringstream ss;
85  disp(ss, more);
86  return ss.str();
87  }
void disp(std::ostream &stream, bool more=false) const
Print a description of the object.
Definition: nlp_builder.cpp:37

◆ import_nl()

void casadi::NlpBuilder::import_nl ( const std::string &  filename,
const Dict opts = Dict() 
)

Definition at line 32 of file nlp_builder.cpp.

32  {
33  // Redirect to helper class
34  NlImporter(*this, filename, opts);
35  }
std::string filename(const std::string &path)
Definition: ghc.cpp:55

References casadi::filename().

◆ type_name()

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

Definition at line 77 of file nlp_builder.hpp.

77 {return "NlpBuilder";}

Member Data Documentation

◆ discrete

std::vector<bool> casadi::NlpBuilder::discrete

Definition at line 70 of file nlp_builder.hpp.

Referenced by casadi::NlImporter::NlImporter().

◆ f

MX casadi::NlpBuilder::f

Definition at line 52 of file nlp_builder.hpp.

Referenced by disp(), casadi::NlImporter::NlImporter(), and casadi::nlpsol().

◆ g

std::vector<MX> casadi::NlpBuilder::g

Definition at line 55 of file nlp_builder.hpp.

Referenced by disp(), casadi::NlImporter::NlImporter(), and casadi::nlpsol().

◆ g_lb

std::vector<double> casadi::NlpBuilder::g_lb

Definition at line 61 of file nlp_builder.hpp.

Referenced by casadi::NlImporter::NlImporter().

◆ g_ub

std::vector<double> casadi::NlpBuilder::g_ub

Definition at line 61 of file nlp_builder.hpp.

Referenced by casadi::NlImporter::NlImporter().

◆ lambda_init

std::vector<double> casadi::NlpBuilder::lambda_init

Definition at line 67 of file nlp_builder.hpp.

Referenced by casadi::NlImporter::NlImporter().

◆ x

std::vector<MX> casadi::NlpBuilder::x

Definition at line 49 of file nlp_builder.hpp.

Referenced by disp(), casadi::NlImporter::NlImporter(), and casadi::nlpsol().

◆ x_init

std::vector<double> casadi::NlpBuilder::x_init

Definition at line 64 of file nlp_builder.hpp.

Referenced by casadi::NlImporter::NlImporter().

◆ x_lb

std::vector<double> casadi::NlpBuilder::x_lb

Definition at line 58 of file nlp_builder.hpp.

Referenced by casadi::NlImporter::NlImporter().

◆ x_ub

std::vector<double> casadi::NlpBuilder::x_ub

Definition at line 58 of file nlp_builder.hpp.

Referenced by casadi::NlImporter::NlImporter().


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