carl  24.04
Computer ARithmetic Library
LPVariables.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <carl-common/config.h>
4 #ifdef USE_LIBPOLY
5 
7 #include <map>
8 #include <optional>
9 #include "../../core/Variable.h"
10 #include <poly/poly.h>
11 #include <poly/variable_db.h>
12 #include <poly/polynomial_context.h>
13 
14 namespace carl {
15 
16 class LPVariables : public Singleton<LPVariables> {
17  friend Singleton<LPVariables>;
18 
19  // mapping from carl variables to libpoly variables
20  std::map<carl::Variable, lp_variable_t> vars_carl_libpoly;
21  // mapping from libpoly variables to carl variables
22  std::map<lp_variable_t, carl::Variable> vars_libpoly_carl;
23 
24 public:
25  lp_variable_db_t* lp_var_db;
26 
27  #define TEMP_VARIABLE_SIZE 10
28 
29  lp_variable_t lp_var_tmp[TEMP_VARIABLE_SIZE];
30 
31  LPVariables();
32  ~LPVariables();
33  std::optional<carl::Variable> carl_variable(lp_variable_t var) const;
34  std::optional<lp_variable_t> lp_variable_opt(carl::Variable var) const;
35  lp_variable_t lp_variable(carl::Variable var);
36 };
37 
38 } // namespace carl
39 
40 #endif
carl is the main namespace for the library.
A Variable represents an algebraic variable that can be used throughout carl.
Definition: Variable.h:85