sqic_interface.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_SQIC_INTERFACE_HPP
27 #define CASADI_SQIC_INTERFACE_HPP
28 
29 #include "casadi/core/conic.hpp"
30 #include <casadi/interfaces/sqic/casadi_conic_sqic_export.h>
31 
42 namespace casadi {
43 
52  class CASADI_CONIC_SQIC_EXPORT SqicInterface : public Conic {
53  public:
55  explicit SqicInterface();
56 
58  static Conic* creator(const std::map<std::string, Sparsity>& st) {
59  return new SqicInterface(st);
60  }
61 
63  explicit SqicInterface(const std::map<std::string, Sparsity>& st);
64 
66  ~SqicInterface() override;
67 
68  // Get name of the plugin
69  const char* plugin_name() const override { return "sqic";}
70 
71  // Get name of the class
72  std::string class_name() const override { return "SqicInterface";}
73 
75  virtual void init();
76 
78  virtual void generateNativeCode(std::ostream& file) const;
79 
80  virtual void evaluate();
81 
83  static void sqic_error(const std::string& module, casadi_int flag);
84 
86  static std::map<casadi_int, std::string> calc_flagmap();
87 
89  static std::map<casadi_int, std::string> flagmap;
90 
92  static const std::string meta_doc;
93 
94  protected:
95 
97  bool is_init_;
98 
100  std::vector<double> bl_;
102  std::vector<double> bu_;
104  std::vector<double> x_;
106  std::vector<casadi_int> locA_;
108  std::vector<casadi_int> indA_;
110  std::vector<casadi_int> hs_;
112  std::vector<casadi_int> hEtype_;
114  std::vector<casadi_int> indH_;
116  std::vector<casadi_int> locH_;
118  std::vector<double> rc_;
120  std::vector<double> pi_;
121 
124 
126  double inf_;
127  };
128 
129 
130 } // namespace casadi
131 
133 #endif // CASADI_SQIC_INTERFACE_HPP
Internal class.
Definition: conic_impl.hpp:44
Function object.
Definition: function.hpp:60
'sqic' plugin for Conic
bool is_init_
Flag: is already initialized.
static Conic * creator(const std::map< std::string, Sparsity > &st)
Create a new QP Solver.
std::vector< casadi_int > hEtype_
Storage space for sqic hEtype variable.
std::vector< double > pi_
Storage space for sqic rc variable.
std::vector< double > rc_
Storage space for sqic rc variable.
SqicInterface()
Constructor.
std::string class_name() const override
Readable name of the internal class.
static const std::string meta_doc
A documentation string.
std::vector< casadi_int > locH_
Storage space for sqic locH variable.
std::vector< casadi_int > locA_
Storage space for sqic locA variable.
const char * plugin_name() const override
std::vector< casadi_int > indA_
Storage space for sqic indA variable.
static std::map< casadi_int, std::string > flagmap
Error message map.
std::vector< casadi_int > indH_
Storage space for sqic indH variable.
std::vector< double > bu_
Storage space for sqic bu variable.
std::vector< casadi_int > hs_
Storage space for sqic hs variable.
Function formatA_
Helper function to bring A into correct format.
std::vector< double > x_
Storage space for sqic x variable.
std::vector< double > bl_
Storage space for sqic bl variable.
The casadi namespace.
Definition: archiver.cpp:28