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 {
170  NL_X,
172  NL_P,
174  NL_NUM_IN
175 };
176 
178 const std::vector<std::string> NL_INPUTS = {"x", "p"};
179 
181 enum NLPOutput {
183  NL_F,
185  NL_G,
187  NL_NUM_OUT
188 };
189 
191 const std::vector<std::string> NL_OUTPUTS = {"f", "g"};
192 
194 enum NlpsolInput {
196  NLPSOL_X0,
198  NLPSOL_P,
200  NLPSOL_LBX,
202  NLPSOL_UBX,
204  NLPSOL_LBG,
206  NLPSOL_UBG,
208  NLPSOL_LAM_X0,
210  NLPSOL_LAM_G0,
211  NLPSOL_NUM_IN
212 };
213 
215 enum NlpsolOutput {
217  NLPSOL_X,
219  NLPSOL_F,
221  NLPSOL_G,
223  NLPSOL_LAM_X,
225  NLPSOL_LAM_G,
227  NLPSOL_LAM_P,
228  NLPSOL_NUM_OUT
229 };
230 #endif // SWIG
231 
232 } // namespace casadi
233 
234 #endif // CASADI_NLPSOL_HPP
Function object.
Definition: function.hpp:60
Importer.
Definition: importer.hpp:86
A symbolic NLP representation.
Definition: nlp_builder.hpp:40
CASADI_EXPORT Function nlpsol(const std::string &name, const std::string &solver, const SXDict &nlp, const Dict &opts=Dict())
CASADI_EXPORT std::vector< std::string > nlpsol_options(const std::string &name)
Get all options for a plugin.
CASADI_EXPORT std::vector< std::string > nlpsol_in()
Get input scheme of NLP solvers.
CASADI_EXPORT std::string doc_nlpsol(const std::string &name)
Get the documentation string for a plugin.
CASADI_EXPORT bool has_nlpsol(const std::string &name)
Check if a particular plugin is available.
CASADI_EXPORT void load_nlpsol(const std::string &name)
Explicitly load a plugin dynamically.
CASADI_EXPORT std::string nlpsol_option_info(const std::string &name, const std::string &op)
Get documentation for a particular option.
CASADI_EXPORT casadi_int nlpsol_n_in()
Number of NLP solver inputs.
CASADI_EXPORT std::string nlpsol_option_type(const std::string &name, const std::string &op)
Get type info for a particular option.
CASADI_EXPORT std::vector< std::string > nlpsol_out()
Get NLP solver output scheme of NLP solvers.
CASADI_EXPORT casadi_int nlpsol_n_out()
Number of NLP solver outputs.
CASADI_EXPORT double nlpsol_default_in(casadi_int ind)
Default input for an NLP solver.
The casadi namespace.
std::map< std::string, MX > MXDict
Definition: mx.hpp:943
std::map< std::string, SX > SXDict
Definition: sx_fwd.hpp:40
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.