global_options.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_GLOBAL_OPTIONS_HPP
27 #define CASADI_GLOBAL_OPTIONS_HPP
28 
29 #include <fstream>
30 #include <iostream>
31 
32 #include "casadi/core/casadi_common.hpp"
33 #include <casadi/core/casadi_export.h>
34 
35 namespace casadi {
36 
48  class CASADI_EXPORT GlobalOptions {
49  private:
51  GlobalOptions();
52  public:
53 
54 #ifndef SWIG
61  static bool simplification_on_the_fly;
62 
63  static std::string casadipath;
64 
65  static std::string casadi_include_path;
66 
67  static bool hierarchical_sparsity;
68 
69  static casadi_int max_num_dir;
70 
71  static casadi_int start_index;
72 
73  static bool julia_initialized;
74 
75 #endif //SWIG
76  // Setter and getter for simplification_on_the_fly
77  static void setSimplificationOnTheFly(bool flag) { simplification_on_the_fly = flag; }
78  static bool getSimplificationOnTheFly() { return simplification_on_the_fly; }
79 
80  // Setter and getter for hierarchical_sparsity
81  static void setHierarchicalSparsity(bool flag) { hierarchical_sparsity = flag; }
82  static bool getHierarchicalSparsity() { return hierarchical_sparsity; }
83 
84  static void setCasadiPath(const std::string & path) { casadipath = path; }
85  static std::string getCasadiPath() { return casadipath; }
86 
87  static void setCasadiIncludePath(const std::string & path) { casadi_include_path = path; }
88  static std::string getCasadiIncludePath() { return casadi_include_path; }
89 
90  static void setMaxNumDir(casadi_int ndir) { max_num_dir=ndir; }
91  static casadi_int getMaxNumDir() { return max_num_dir; }
92 
93  };
94 
95 } // namespace casadi
96 
97 #endif // CASADI_GLOBAL_OPTIONS_HPP
Collects global CasADi options.
static bool getHierarchicalSparsity()
static std::string getCasadiIncludePath()
static std::string getCasadiPath()
static void setCasadiPath(const std::string &path)
static void setCasadiIncludePath(const std::string &path)
static void setSimplificationOnTheFly(bool flag)
static void setHierarchicalSparsity(bool flag)
static casadi_int getMaxNumDir()
static bool getSimplificationOnTheFly()
static void setMaxNumDir(casadi_int ndir)
The casadi namespace.