nlpsol.hpp
1 /*
2  * This file is part of CasADi.
3  *
4  * CasADi -- A symbolic framework for dynamic optimization.
5  * Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl,
6  * KU Leuven. All rights reserved.
7  * Copyright (C) 2011-2014 Greg Horn
8  *
9  * CasADi is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 3 of the License, or (at your option) any later version.
13  *
14  * CasADi is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with CasADi; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  *
23  */
24 
25 
26 #ifndef CASADI_NLPSOL_HPP
27 #define CASADI_NLPSOL_HPP
28 
29 #include "function.hpp"
30 
31 namespace casadi {
32 
72  CASADI_EXPORT Function nlpsol(const std::string& name, const std::string& solver,
73  const SXDict& nlp, const Dict& opts=Dict());
74  CASADI_EXPORT Function nlpsol(const std::string& name, const std::string& solver,
75  const MXDict& nlp, const Dict& opts=Dict());
76  CASADI_EXPORT Function nlpsol(const std::string& name, const std::string& solver,
77  const std::string& fname, const Dict& opts=Dict());
78  CASADI_EXPORT Function nlpsol(const std::string& name, const std::string& solver,
79  const Importer& compiler, const Dict& opts=Dict());
80  CASADI_EXPORT Function nlpsol(const std::string& name, const std::string& solver,
81  const NlpBuilder& nl, const Dict& opts=Dict());
82  CASADI_EXPORT Function nlpsol(const std::string& name, const std::string& solver,
83  const Function& nlp, const Dict& opts=Dict());
85 
93  CASADI_EXPORT std::vector<std::string> nlpsol_in();
94 
102  CASADI_EXPORT std::vector<std::string> nlpsol_out();
103 
111  CASADI_EXPORT std::string nlpsol_in(casadi_int ind);
112 
120  CASADI_EXPORT std::string nlpsol_out(casadi_int ind);
121 
125  CASADI_EXPORT casadi_int nlpsol_n_in();
126 
130  CASADI_EXPORT casadi_int nlpsol_n_out();
131 
133 
136  CASADI_EXPORT double nlpsol_default_in(casadi_int ind);
137  CASADI_EXPORT std::vector<double> nlpsol_default_in();
139 
143  CASADI_EXPORT std::vector<std::string> nlpsol_options(const std::string& name);
144 
148  CASADI_EXPORT std::string nlpsol_option_type(const std::string& name, const std::string& op);
149 
153  CASADI_EXPORT std::string nlpsol_option_info(const std::string& name, const std::string& op);
154 
156  CASADI_EXPORT bool has_nlpsol(const std::string& name);
157 
159  CASADI_EXPORT void load_nlpsol(const std::string& name);
160 
162  CASADI_EXPORT std::string doc_nlpsol(const std::string& name);
163 
166 #ifndef SWIG
168 enum NLPInput {
174  NL_NUM_IN
175 };
176 
178 const std::vector<std::string> NL_INPUTS = {"x", "p"};
179 
181 enum NLPOutput {
187  NL_NUM_OUT
188 };
189 
191 const std::vector<std::string> NL_OUTPUTS = {"f", "g"};
192 
212 };
213 
229 };
230 #endif // SWIG
231 
232 } // namespace casadi
233 
234 #endif // CASADI_NLPSOL_HPP
std::string doc_nlpsol(const std::string &name)
Get the documentation string for a plugin.
Definition: nlpsol.cpp:42
bool has_nlpsol(const std::string &name)
Check if a particular plugin is available.
Definition: nlpsol.cpp:34
void load_nlpsol(const std::string &name)
Explicitly load a plugin dynamically.
Definition: nlpsol.cpp:38
std::string nlpsol_option_info(const std::string &name, const std::string &op)
Get documentation for a particular option.
Definition: nlpsol.cpp:838
casadi_int nlpsol_n_in()
Number of NLP solver inputs.
Definition: nlpsol.cpp:259
std::string nlpsol_option_type(const std::string &name, const std::string &op)
Get type info for a particular option.
Definition: nlpsol.cpp:834
std::vector< std::string > nlpsol_options(const std::string &name)
Get all options for a plugin.
Definition: nlpsol.cpp:830
std::vector< std::string > nlpsol_in()
Get input scheme of NLP solvers.
Definition: nlpsol.cpp:200
Function nlpsol(const std::string &name, const std::string &solver, const SXDict &nlp, const Dict &opts)
Definition: nlpsol.cpp:118
casadi_int nlpsol_n_out()
Number of NLP solver outputs.
Definition: nlpsol.cpp:263
std::vector< std::string > nlpsol_out()
Get NLP solver output scheme of NLP solvers.
Definition: nlpsol.cpp:206
double nlpsol_default_in(casadi_int ind)
Default input for an NLP solver.
Definition: nlpsol.cpp:212
The casadi namespace.
Definition: archiver.cpp:28
NlpsolInput
Input arguments of an NLP Solver.
Definition: nlpsol.hpp:194
@ NLPSOL_P
Value of fixed parameters (np x 1)
Definition: nlpsol.hpp:198
@ NLPSOL_UBX
Decision variables upper bound (nx x 1), default +inf.
Definition: nlpsol.hpp:202
@ NLPSOL_X0
Decision variables, initial guess (nx x 1)
Definition: nlpsol.hpp:196
@ NLPSOL_LAM_G0
Lagrange multipliers for bounds on G, initial guess (ng x 1)
Definition: nlpsol.hpp:210
@ NLPSOL_UBG
Constraints upper bound (ng x 1), default +inf.
Definition: nlpsol.hpp:206
@ NLPSOL_LAM_X0
Lagrange multipliers for bounds on X, initial guess (nx x 1)
Definition: nlpsol.hpp:208
@ NLPSOL_NUM_IN
Definition: nlpsol.hpp:211
@ NLPSOL_LBG
Constraints lower bound (ng x 1), default -inf.
Definition: nlpsol.hpp:204
@ NLPSOL_LBX
Decision variables lower bound (nx x 1), default -inf.
Definition: nlpsol.hpp:200
std::map< std::string, MX > MXDict
Definition: mx.hpp:1009
NlpsolOutput
Output arguments of an NLP Solver.
Definition: nlpsol.hpp:215
@ NLPSOL_G
Constraints function at the optimal solution (ng x 1)
Definition: nlpsol.hpp:221
@ NLPSOL_X
Decision variables at the optimal solution (nx x 1)
Definition: nlpsol.hpp:217
@ NLPSOL_NUM_OUT
Definition: nlpsol.hpp:228
@ NLPSOL_LAM_P
Lagrange multipliers for bounds on P at the solution (np x 1)
Definition: nlpsol.hpp:227
@ NLPSOL_F
Cost function value at the optimal solution (1 x 1)
Definition: nlpsol.hpp:219
@ NLPSOL_LAM_G
Lagrange multipliers for bounds on G at the solution (ng x 1)
Definition: nlpsol.hpp:225
@ NLPSOL_LAM_X
Lagrange multipliers for bounds on X at the solution (nx x 1)
Definition: nlpsol.hpp:223
NLPInput
Input arguments of an NLP function.
Definition: nlpsol.hpp:168
@ NL_X
Decision variable.
Definition: nlpsol.hpp:170
@ NL_P
Fixed parameter.
Definition: nlpsol.hpp:172
@ NL_NUM_IN
Number of NLP inputs.
Definition: nlpsol.hpp:174
NLPOutput
Output arguments of an NLP function.
Definition: nlpsol.hpp:181
@ NL_F
Objective function.
Definition: nlpsol.hpp:183
@ NL_G
Constraint function.
Definition: nlpsol.hpp:185
@ NL_NUM_OUT
Number of NLP outputs.
Definition: nlpsol.hpp:187
std::map< std::string, SX > SXDict
Definition: sx_fwd.hpp:40
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.
const std::vector< std::string > NL_INPUTS
Shortname for onput arguments of an NLP function.
Definition: nlpsol.hpp:178
const std::vector< std::string > NL_OUTPUTS
Shortname for output arguments of an NLP function.
Definition: nlpsol.hpp:191