List of all members | Static Public Member Functions | Static Public Attributes
casadi::GlobalOptions Class Reference

Collects global CasADi options. More...

#include <global_options.hpp>

Detailed Description

Note to developers:

Definition at line 48 of file global_options.hpp.

Static Public Member Functions

static void setSimplificationOnTheFly (bool flag)
 
static bool getSimplificationOnTheFly ()
 
static void setHierarchicalSparsity (bool flag)
 
static bool getHierarchicalSparsity ()
 
static void setCasadiPath (const std::string &path)
 
static std::string getCasadiPath ()
 
static void setCasadiIncludePath (const std::string &path)
 
static std::string getCasadiIncludePath ()
 
static void setMaxNumDir (casadi_int ndir)
 
static casadi_int getMaxNumDir ()
 
static void setCopyElisionMinSize (casadi_int sz)
 
static casadi_int getCopyElisionMinSize ()
 
static void setTempWorkDir (const std::string &dir)
 
static std::string getTempWorkDir ()
 
static void setNumpyMode (int mode)
 Set the numpy interop mode (issue #2959): 1 = casadi-aware. More...
 
static int getNumpyMode ()
 Get the current numpy interop mode. See setNumpyMode. More...
 
static void setDefaultBlas (const std::string &name)
 
static std::string getDefaultBlas ()
 

Static Public Attributes

static bool simplification_on_the_fly = true
 Indicates whether simplifications should be made on the fly. More...
 
static std::string casadipath
 
static std::string casadi_include_path
 
static bool hierarchical_sparsity = true
 
static casadi_int max_num_dir = 64
 
static casadi_int start_index = 0
 
static bool julia_initialized = false
 
static casadi_int copy_elision_min_size = 8
 
static std::string temp_work_dir = "./"
 
static int numpy_mode = 0
 numpy interop mode (issue #2959). Controls how an explicit More...
 

Member Function Documentation

◆ getCasadiIncludePath()

static std::string casadi::GlobalOptions::getCasadiIncludePath ( )
inlinestatic

Definition at line 117 of file global_options.hpp.

117 { return casadi_include_path; }
static std::string casadi_include_path

◆ getCasadiPath()

static std::string casadi::GlobalOptions::getCasadiPath ( )
inlinestatic

Definition at line 114 of file global_options.hpp.

114 { return casadipath; }
static std::string casadipath

Referenced by casadi::get_search_paths().

◆ getCopyElisionMinSize()

static casadi_int casadi::GlobalOptions::getCopyElisionMinSize ( )
inlinestatic

Definition at line 128 of file global_options.hpp.

128 { return copy_elision_min_size; }
static casadi_int copy_elision_min_size

◆ getDefaultBlas()

std::string casadi::GlobalOptions::getDefaultBlas ( )
static

Definition at line 61 of file global_options.cpp.

61  {
62  return Blas::getDefault();
63  }
static std::string getDefault()
Definition: blas.cpp:279

References casadi::Blas::getDefault().

◆ getHierarchicalSparsity()

static bool casadi::GlobalOptions::getHierarchicalSparsity ( )
inlinestatic

Definition at line 111 of file global_options.hpp.

111 { return hierarchical_sparsity; }
static bool hierarchical_sparsity

◆ getMaxNumDir()

static casadi_int casadi::GlobalOptions::getMaxNumDir ( )
inlinestatic

Definition at line 120 of file global_options.hpp.

120 { return max_num_dir; }
static casadi_int max_num_dir

Referenced by casadi::FunctionInternal::FunctionInternal().

◆ getNumpyMode()

static int casadi::GlobalOptions::getNumpyMode ( )
inlinestatic

Extra doc: https://github.com/casadi/casadi/wiki/L_2i2

Definition at line 146 of file global_options.hpp.

146 { return numpy_mode; }
static int numpy_mode
numpy interop mode (issue #2959). Controls how an explicit

◆ getSimplificationOnTheFly()

static bool casadi::GlobalOptions::getSimplificationOnTheFly ( )
inlinestatic

Definition at line 107 of file global_options.hpp.

107 { return simplification_on_the_fly; }
static bool simplification_on_the_fly
Indicates whether simplifications should be made on the fly.

◆ getTempWorkDir()

static std::string casadi::GlobalOptions::getTempWorkDir ( )
inlinestatic

Definition at line 131 of file global_options.hpp.

131 { return temp_work_dir; }
static std::string temp_work_dir

Referenced by casadi::FunctionInternal::get_jit_directory(), and casadi::temporary_file().

◆ setCasadiIncludePath()

static void casadi::GlobalOptions::setCasadiIncludePath ( const std::string &  path)
inlinestatic

Definition at line 116 of file global_options.hpp.

std::vector< casadi_int > path(const std::vector< casadi_int > &map, casadi_int i_start)

References casadi::path().

◆ setCasadiPath()

static void casadi::GlobalOptions::setCasadiPath ( const std::string &  path)
inlinestatic

Definition at line 113 of file global_options.hpp.

113 { casadipath = path; }

References casadi::path().

◆ setCopyElisionMinSize()

static void casadi::GlobalOptions::setCopyElisionMinSize ( casadi_int  sz)
inlinestatic

Definition at line 122 of file global_options.hpp.

122  {
126  }
127  }

◆ setDefaultBlas()

void casadi::GlobalOptions::setDefaultBlas ( const std::string &  name)
static

Definition at line 57 of file global_options.cpp.

57  {
58  Blas::setDefault(name);
59  }

◆ setHierarchicalSparsity()

static void casadi::GlobalOptions::setHierarchicalSparsity ( bool  flag)
inlinestatic

Definition at line 110 of file global_options.hpp.

110 { hierarchical_sparsity = flag; }

◆ setMaxNumDir()

static void casadi::GlobalOptions::setMaxNumDir ( casadi_int  ndir)
inlinestatic

Definition at line 119 of file global_options.hpp.

119 { max_num_dir=ndir; }

◆ setNumpyMode()

static void casadi::GlobalOptions::setNumpyMode ( int  mode)
inlinestatic

numpy support, 0 (default) = legacy + FutureWarning, -1 = legacy but silent. See the numpy_mode field. Affects only Python bindings; ignored elsewhere. Probe with hasattr(casadi.GlobalOptions, "setNumpyMode").

Extra doc: https://github.com/casadi/casadi/wiki/L_2i1

Definition at line 141 of file global_options.hpp.

141 { numpy_mode = mode; }

◆ setSimplificationOnTheFly()

static void casadi::GlobalOptions::setSimplificationOnTheFly ( bool  flag)
inlinestatic

Definition at line 106 of file global_options.hpp.

106 { simplification_on_the_fly = flag; }

◆ setTempWorkDir()

void casadi::GlobalOptions::setTempWorkDir ( const std::string &  dir)
static

Definition at line 52 of file global_options.cpp.

52  {
53  casadi_assert(!dir.empty(), "Temporary working directory must be non-empty.");
55  }
static std::string ensure_trailing_slash(const std::string &path)
Definition: filesystem.cpp:155

References casadi::Filesystem::ensure_trailing_slash(), and temp_work_dir.

Member Data Documentation

◆ casadi_include_path

std::string casadi::GlobalOptions::casadi_include_path
static

Definition at line 65 of file global_options.hpp.

◆ casadipath

std::string casadi::GlobalOptions::casadipath
static

Definition at line 63 of file global_options.hpp.

◆ copy_elision_min_size

casadi_int casadi::GlobalOptions::copy_elision_min_size = 8
static

◆ hierarchical_sparsity

bool casadi::GlobalOptions::hierarchical_sparsity = true
static

Definition at line 67 of file global_options.hpp.

Referenced by casadi::FunctionInternal::get_jac_sparsity().

◆ julia_initialized

bool casadi::GlobalOptions::julia_initialized = false
static

Definition at line 73 of file global_options.hpp.

◆ max_num_dir

casadi_int casadi::GlobalOptions::max_num_dir = 64
static

Definition at line 69 of file global_options.hpp.

◆ numpy_mode

int casadi::GlobalOptions::numpy_mode = 0
static

numpy.foo(M) on a casadi value behaves in the Python bindings: 0 (default): legacy casadi 3.7.2 behaviour + a Python FutureWarning – a numeric value densifies to a numpy result, a symbolic value returns a casadi value. 1: the casadi-aware numpy support – numpy.foo(M) returns a python-only numpy-semantics array wrapper (casadi.ArrayInterface) following numpy's shape/axis contract for SX/MX/DM alike. -1: the same legacy behaviour as 0, but silent (no warning) – exact casadi 3.7.2 semantics. Operator arithmetic (M + x, x * M, ...) always stays casadi- typed and is unaffected. Affects only Python bindings.

Temporary opt-in mechanism: exists to ease the transition and will be removed once numpy becomes the unconditional default. Process-global and not thread-safe – it changes the return type of numpy dispatch, so set it once at startup rather than toggling it concurrently with running code. Probe with hasattr(casadi.GlobalOptions, "setNumpyMode").

Extra doc: https://github.com/casadi/casadi/wiki/L_2i0

Definition at line 102 of file global_options.hpp.

◆ simplification_on_the_fly

bool casadi::GlobalOptions::simplification_on_the_fly = true
static

◆ start_index

casadi_int casadi::GlobalOptions::start_index = 0
static

◆ temp_work_dir

std::string casadi::GlobalOptions::temp_work_dir = "./"
static

Definition at line 77 of file global_options.hpp.

Referenced by setTempWorkDir().


The documentation for this class was generated from the following files: