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 
27 #ifndef CASADI_NLPSOL_HPP
28 #define CASADI_NLPSOL_HPP
29 
30 #include "function.hpp"
31 
32 namespace casadi {
33 
334  CASADI_EXPORT Function nlpsol(const std::string& name, const std::string& solver,
335  const SXDict& nlp, const Dict& opts=Dict());
336  CASADI_EXPORT Function nlpsol(const std::string& name, const std::string& solver,
337  const MXDict& nlp, const Dict& opts=Dict());
338  CASADI_EXPORT Function nlpsol(const std::string& name, const std::string& solver,
339  const std::string& fname, const Dict& opts=Dict());
340  CASADI_EXPORT Function nlpsol(const std::string& name, const std::string& solver,
341  const Importer& compiler, const Dict& opts=Dict());
342  CASADI_EXPORT Function nlpsol(const std::string& name, const std::string& solver,
343  const NlpBuilder& nl, const Dict& opts=Dict());
344  CASADI_EXPORT Function nlpsol(const std::string& name, const std::string& solver,
345  const Function& nlp, const Dict& opts=Dict());
347 
396  CASADI_EXPORT std::vector<std::string> nlpsol_in();
397 
442  CASADI_EXPORT std::vector<std::string> nlpsol_out();
443 
476  CASADI_EXPORT std::string nlpsol_in(casadi_int ind);
477 
510  CASADI_EXPORT std::string nlpsol_out(casadi_int ind);
511 
536  CASADI_EXPORT casadi_int nlpsol_n_in();
537 
562  CASADI_EXPORT casadi_int nlpsol_n_out();
563 
565 
608  CASADI_EXPORT double nlpsol_default_in(casadi_int ind);
609  CASADI_EXPORT std::vector<double> nlpsol_default_in();
611 
644  CASADI_EXPORT std::vector<std::string> nlpsol_options(const std::string& name);
645 
676  CASADI_EXPORT std::string nlpsol_option_type(const std::string& name, const std::string& op);
677 
705  CASADI_EXPORT std::string nlpsol_option_info(const std::string& name, const std::string& op);
706 
734  CASADI_EXPORT bool has_nlpsol(const std::string& name);
735 
771  CASADI_EXPORT void load_nlpsol(const std::string& name);
772 
799  CASADI_EXPORT std::string doc_nlpsol(const std::string& name);
800 
803 #ifndef SWIG
805 enum NLPInput {
811  NL_NUM_IN
812 };
813 
815 const std::vector<std::string> NL_INPUTS = {"x", "p"};
816 
818 enum NLPOutput {
824  NL_NUM_OUT
825 };
826 
828 const std::vector<std::string> NL_OUTPUTS = {"f", "g"};
829 
849 };
850 
868 };
869 #endif // SWIG
870 
871 } // namespace casadi
872 
873 #endif // CASADI_NLPSOL_HPP
std::string doc_nlpsol(const std::string &name)
Get the documentation string of an NLP solver plugin.
Definition: nlpsol.cpp:44
bool has_nlpsol(const std::string &name)
Check if an NLP solver plugin is available.
Definition: nlpsol.cpp:36
void load_nlpsol(const std::string &name)
Explicitly load an NLP solver plugin.
Definition: nlpsol.cpp:40
std::string nlpsol_option_info(const std::string &name, const std::string &op)
Get the documentation string of an option of an NLP solver plugin.
Definition: nlpsol.cpp:939
casadi_int nlpsol_n_in()
Number of NLP solver inputs.
Definition: nlpsol.cpp:343
std::string nlpsol_option_type(const std::string &name, const std::string &op)
Get the type of an option of an NLP solver plugin.
Definition: nlpsol.cpp:935
std::vector< std::string > nlpsol_options(const std::string &name)
Get all options of an NLP solver plugin.
Definition: nlpsol.cpp:931
std::vector< std::string > nlpsol_in()
Get the input scheme of NLP solvers.
Definition: nlpsol.cpp:284
Function nlpsol(const std::string &name, const std::string &solver, const SXDict &nlp, const Dict &opts)
Definition: nlpsol.cpp:196
casadi_int nlpsol_n_out()
Number of NLP solver outputs.
Definition: nlpsol.cpp:347
std::vector< std::string > nlpsol_out()
Get the output scheme of NLP solvers.
Definition: nlpsol.cpp:290
double nlpsol_default_in(casadi_int ind)
Default value of an NLP solver input.
Definition: nlpsol.cpp:296
The casadi namespace.
Definition: archiver.cpp:28
NlpsolInput
Input arguments of an NLP Solver.
Definition: nlpsol.hpp:831
@ NLPSOL_P
Value of fixed parameters (np x 1), default 0.
Definition: nlpsol.hpp:835
@ NLPSOL_UBX
Decision variables upper bound (nx x 1), default +inf.
Definition: nlpsol.hpp:839
@ NLPSOL_X0
Decision variables, initial guess (nx x 1), default 0.
Definition: nlpsol.hpp:833
@ NLPSOL_LAM_G0
Lagrange multipliers for bounds on G, initial guess (ng x 1), default 0.
Definition: nlpsol.hpp:847
@ NLPSOL_UBG
Constraints upper bound (ng x 1), default +inf.
Definition: nlpsol.hpp:843
@ NLPSOL_LAM_X0
Lagrange multipliers for bounds on X, initial guess (nx x 1), default 0.
Definition: nlpsol.hpp:845
@ NLPSOL_NUM_IN
Definition: nlpsol.hpp:848
@ NLPSOL_LBG
Constraints lower bound (ng x 1), default -inf.
Definition: nlpsol.hpp:841
@ NLPSOL_LBX
Decision variables lower bound (nx x 1), default -inf.
Definition: nlpsol.hpp:837
std::map< std::string, MX > MXDict
Definition: mx.hpp:5151
NlpsolOutput
Output arguments of an NLP Solver.
Definition: nlpsol.hpp:852
@ NLPSOL_G
Constraints function at the optimal solution (ng x 1)
Definition: nlpsol.hpp:858
@ NLPSOL_X
Decision variables at the optimal solution (nx x 1)
Definition: nlpsol.hpp:854
@ NLPSOL_NUM_OUT
Definition: nlpsol.hpp:867
@ NLPSOL_LAM_P
Definition: nlpsol.hpp:866
@ NLPSOL_F
Cost function value at the optimal solution (1 x 1)
Definition: nlpsol.hpp:856
@ NLPSOL_LAM_G
Lagrange multipliers for bounds on G at the solution (ng x 1); same sign convention.
Definition: nlpsol.hpp:863
@ NLPSOL_LAM_X
Definition: nlpsol.hpp:861
NLPInput
Input arguments of an NLP function.
Definition: nlpsol.hpp:805
@ NL_X
Decision variable.
Definition: nlpsol.hpp:807
@ NL_P
Fixed parameter.
Definition: nlpsol.hpp:809
@ NL_NUM_IN
Number of NLP inputs.
Definition: nlpsol.hpp:811
NLPOutput
Output arguments of an NLP function.
Definition: nlpsol.hpp:818
@ NL_F
Objective function.
Definition: nlpsol.hpp:820
@ NL_G
Constraint function.
Definition: nlpsol.hpp:822
@ NL_NUM_OUT
Number of NLP outputs.
Definition: nlpsol.hpp:824
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:815
const std::vector< std::string > NL_OUTPUTS
Shortname for output arguments of an NLP function.
Definition: nlpsol.hpp:828