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 {
807  NL_X,
809  NL_P,
811  NL_NUM_IN
812 };
813 
815 const std::vector<std::string> NL_INPUTS = {"x", "p"};
816 
818 enum NLPOutput {
820  NL_F,
822  NL_G,
824  NL_NUM_OUT
825 };
826 
828 const std::vector<std::string> NL_OUTPUTS = {"f", "g"};
829 
831 enum NlpsolInput {
833  NLPSOL_X0,
835  NLPSOL_P,
837  NLPSOL_LBX,
839  NLPSOL_UBX,
841  NLPSOL_LBG,
843  NLPSOL_UBG,
845  NLPSOL_LAM_X0,
847  NLPSOL_LAM_G0,
848  NLPSOL_NUM_IN
849 };
850 
852 enum NlpsolOutput {
854  NLPSOL_X,
856  NLPSOL_F,
858  NLPSOL_G,
861  NLPSOL_LAM_X,
863  NLPSOL_LAM_G,
866  NLPSOL_LAM_P,
867  NLPSOL_NUM_OUT
868 };
869 #endif // SWIG
870 
871 } // namespace casadi
872 
873 #endif // CASADI_NLPSOL_HPP
Function object.
Definition: function.hpp:126
Importer.
Definition: importer.hpp:86
A symbolic NLP representation.
Definition: nlp_builder.hpp:41
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 of an NLP solver plugin.
CASADI_EXPORT std::vector< std::string > nlpsol_in()
Get the input scheme of NLP solvers.
CASADI_EXPORT std::string doc_nlpsol(const std::string &name)
Get the documentation string of an NLP solver plugin.
CASADI_EXPORT bool has_nlpsol(const std::string &name)
Check if an NLP solver plugin is available.
CASADI_EXPORT void load_nlpsol(const std::string &name)
Explicitly load an NLP solver plugin.
CASADI_EXPORT 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.
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 the type of an option of an NLP solver plugin.
CASADI_EXPORT std::vector< std::string > nlpsol_out()
Get the 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 value of an NLP solver input.
The casadi namespace.
Definition: archiver.hpp:32
std::map< std::string, MX > MXDict
Definition: mx.hpp:5151
std::map< std::string, SX > SXDict
Definition: sx_fwd.hpp:40
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.