Namespaces | Classes | Typedefs | Enumerations | Functions
casadi Namespace Reference

The casadi namespace. More...

Namespaces

 rosenbrock_tableau
 

Classes

class  Callback
 User-defined Function implemented by subclassing. More...
 
class  CallbackInternal
 
class  Matrix
 Sparse matrix class. SX and DM are specializations. More...
 
class  casadi_limits
 casadi_limits class More...
 
class  Logger
 Keeps track of logging output to screen and/or files. More...
 
class  CasadiMeta
 Collects global CasADi meta information. More...
 
class  StreamStateGuard
 
class  CodeGenerator
 Helper class for C code generation. More...
 
class  DaeBuilder
 A symbolic representation of a differential-algebraic equations model. More...
 
struct  Variable
 Holds expressions and meta-data corresponding to a physical quantity evolving in time. More...
 
class  CasadiException
 Casadi exception class. More...
 
class  KeyboardInterruptException
 
class  Function
 Function object. More...
 
class  FunctionBuffer
 Evaluate a Function repeatedly with minimal overhead. More...
 
struct  GenericExpressionCommon
 Empty Base. More...
 
struct  GenericMatrixCommon
 Empty Base. More...
 
class  GenericMatrix
 Matrix base class. More...
 
class  GenericWeakRef
 
class  GenericShared
 
class  WeakCache
 
class  RevWeakCache
 
class  SimpleCache
 
class  GenericType
 Generic data type, can hold different types such as bool, casadi_int, std::string etc. More...
 
class  GlobalOptions
 Collects global CasADi options. More...
 
class  GraphBuilder
 A mutable, format-neutral interface to a computational-graph model. More...
 
class  Importer
 Importer. More...
 
class  IOInstruction
 An input or output instruction. More...
 
class  Input
 Input instruction. More...
 
class  Output
 Input instruction. More...
 
class  Linsol
 Linear solver. More...
 
struct  MatrixCommon
 Empty Base. More...
 
class  ModelicaParser
 Modelica parser. More...
 
class  MX
 MX - Matrix expression. More...
 
class  MXNode
 Node class for MX objects. More...
 
class  NlpBuilder
 A symbolic NLP representation. More...
 
class  NonZeros
 Access to a set of nonzeros. More...
 
class  Opti
 A simplified interface for NLP modeling/solving. More...
 
struct  IndexAbstraction
 Range [start, stop) of a symbol or constraint in the flattened x or g vector. More...
 
struct  MetaCon
 Metadata of a constraint, as returned by OptiAdvanced::canon_expr/get_meta_con. More...
 
struct  MetaVar
 Metadata of a symbol, as returned by OptiAdvanced::get_meta. More...
 
class  OptiCallback
 Base class of iteration callbacks for Opti. More...
 
class  OptiAdvanced
 Opti with debugging and low-level access. More...
 
class  OptiSol
 Snapshot of an Opti problem and its solution. More...
 
class  OptiNode
 A simplified interface for NLP modeling/solving. More...
 
class  Polynomial
 Helper class for differentiating and integrating polynomials. More...
 
struct  PrintableCommon
 Empty Base. More...
 
class  Resource
 RAII class for reading from a zip file. More...
 
class  SerializerBase
 
class  DeserializerBase
 
class  StringSerializer
 
class  FileSerializer
 
class  StringDeserializer
 
class  FileDeserializer
 
class  UniversalNodeOwner
 
class  DeserializingStream
 Helper class for Serialization. More...
 
class  SerializingStream
 Helper class for Serialization. More...
 
class  SharedObject
 GenericShared implements a reference counting framework similar for efficient and. More...
 
class  WeakRef
 Weak reference type. More...
 
class  Slice
 Class representing a Slice. More...
 
class  Solve
 An MX atomic for linear solver solution: x = r * A^-1 or x = r * A^-T. More...
 
class  LinsolCall
 Linear solve operation with a linear solver instance. More...
 
class  TriuSolve
 Linear solve with an upper triangular matrix. More...
 
class  TrilSolve
 Linear solve with an upper triangular matrix. More...
 
class  SolveUnity
 Linear solve with unity diagonal added. More...
 
class  TriuSolveUnity
 Linear solve with an upper triangular matrix, unity diagonal. More...
 
class  TrilSolveUnity
 Linear solve with an upper triangular matrix. More...
 
class  Sparsity
 General sparsity class. More...
 
struct  SparsityInterfaceCommon
 Empty Base. More...
 
class  SubMatrix
 
class  SubIndex
 
struct  SXElem
 
class  XmlFile
 XML parser. More...
 
struct  AlpaqaMemory
 
class  AlpaqaInterface
 
class  AlpaqaProblem
 
struct  ConoptMemory
 
class  ConoptInterface
 
struct  SLEQPMemory
 
class  SLEQPInterface
 

Typedefs

typedef Matrix< double > DM
 
typedef std::vector< DM > DMVector
 
typedef std::vector< DMVector > DMVectorVector
 
typedef std::map< std::string, DM > DMDict
 
typedef GenericType::Dict Dict
 C++ equivalent of Python's dict or MATLAB's struct. More...
 
typedef Matrix< casadi_int > IM
 
typedef DM native_DM
 
typedef void(* external_print_callback_t) (const char *s)
 
typedef const char *(* external_transform_t) (char api_version, const char *casadi_version, const char *in, external_print_callback_t cb_stdout, external_print_callback_t cb_stderr)
 
typedef std::vector< MX > MXVector
 
typedef std::initializer_list< MX > MXIList
 
typedef std::vector< MXVector > MXVectorVector
 
typedef std::map< std::string, MX > MXDict
 
typedef std::map< std::string, Sparsity > SpDict
 
typedef Matrix< SXElem > SX
 
typedef std::vector< SX > SXVector
 
typedef std::initializer_list< SX > SXIList
 
typedef std::vector< SXVector > SXVectorVector
 
typedef std::map< std::string, SX > SXDict
 

Enumerations

enum  UnifiedReturnStatus {
  SOLVER_RET_SUCCESS , SOLVER_RET_UNKNOWN , SOLVER_RET_LIMITED , SOLVER_RET_NAN ,
  SOLVER_RET_INFEASIBLE , SOLVER_RET_EXCEPTION
}
 
enum class  TypeFmi2 {
  REAL , INTEGER , BOOLEAN , STRING ,
  ENUM , NUMEL
}
 Variable type (FMI 2) More...
 
enum class  Type {
  FLOAT32 , FLOAT64 , INT8 , UINT8 ,
  INT16 , UINT16 , INT32 , UINT32 ,
  INT64 , UINT64 , BOOLEAN , STRING ,
  BINARY , ENUMERATION , CLOCK , NUMEL
}
 Variable type (FMI 3) More...
 
enum class  Causality {
  PARAMETER , CALCULATED_PARAMETER , INPUT , OUTPUT ,
  LOCAL , INDEPENDENT , NUMEL
}
 Causality: FMI 2.0 specification, section 2.2.7 or FMI 3.0 specification, section 2.4.7.4. More...
 
enum class  Variability {
  CONSTANT , FIXED , TUNABLE , DISCRETE ,
  CONTINUOUS , NUMEL
}
 Variability: FMI 2.0 specification, section 2.2.7 or FMI 3.0 specification, section 2.4.7.4. More...
 
enum class  Category {
  T , C , P , D ,
  W , U , X , Z ,
  Q , CALCULATED , ODE , ALG ,
  QUAD , ZERO , DDEF , WDEF ,
  Y , NUMEL
}
 
enum class  Initial {
  EXACT , APPROX , CALCULATED , NA ,
  NUMEL
}
 Initial: FMI 2.0 specification, section 2.2.7 or FMI 3.0 specification, section 2.4.7.5. More...
 
enum class  Attribute {
  MIN , MAX , NOMINAL , START ,
  VALUE , STRINGVALUE , NUMEL
}
 
enum class  DependenciesKind {
  DEPENDENT , CONSTANT , FIXED , TUNABLE ,
  DISCRETE , NUMEL
}
 
enum  CollocationPoints { LEGENDRE , RADAU }
 
enum  ConstraintType {
  OPTI_GENERIC_EQUALITY , OPTI_GENERIC_INEQUALITY , OPTI_EQUALITY , OPTI_INEQUALITY ,
  OPTI_DOUBLE_INEQUALITY , OPTI_PSD , OPTI_UNKNOWN
}
 How subject_to() classified a constraint (MetaCon::type) More...
 
enum  VariableType { OPTI_VAR , OPTI_PAR , OPTI_DUAL_G }
 Kind of an Opti symbol (MetaVar::type) More...
 
enum  DomainType { OPTI_DOMAIN_REAL , OPTI_DOMAIN_INTEGER }
 Domain of a decision variable (see Opti::set_domain) More...
 
enum class  ConoptModelStatus {
  Unset = 0 , Optimal = 1 , LocallyOptimal = 2 , Unbounded = 3 ,
  Infeasible = 4 , LocallyInfeasible = 5 , IntermediateInfeas = 6 , IntermediateNonOpt = 7 ,
  UnknownError = 12 , ErrorNoSolution = 13
}
 
enum class  ConoptRowType { Equality = 0 , GreaterEqual = 1 , LessEqual = 2 , Free = 3 }
 
enum class  ConoptBasisStatus { AtLower = 0 , AtUpper = 1 , Basic = 2 , SuperBasic = 3 }
 
enum class  ConoptSolverStatus {
  Unset = 0 , NormalCompletion = 1 , IterationLimit = 2 , TimeLimit = 3 ,
  TerminatedBySolver = 4 , EvalErrorLimit = 5 , UserInterrupt = 8 , SetupFailure = 9 ,
  MajorSolverError = 10 , MajorSolverErrorFeas = 11 , SystemError = 13 , QuickModeTermination = 15
}
 

Functions

CASADI_EXPORT bool has_archiver (const std::string &name)
 Check if a particular plugin is available. More...
 
CASADI_EXPORT void load_archiver (const std::string &name)
 Explicitly load a plugin dynamically. More...
 
CASADI_EXPORT std::string doc_archiver (const std::string &name)
 Get the documentation string for a plugin. More...
 
CASADI_EXPORT bool has_blas (const std::string &name)
 
CASADI_EXPORT void load_blas (const std::string &name)
 
CASADI_EXPORT std::string doc_blas (const std::string &name)
 
CASADI_EXPORT Function blazing_spline (const std::string &name, const std::vector< std::vector< double > > &knots, const Dict &opts=Dict())
 Construct a specialized parametric BSpline. More...
 
CASADI_EXPORT Function blazing_spline (const std::string &name, const std::vector< casadi_int > &knot_dims, const Dict &opts=Dict())
 Construct a parametric-knots blazing_spline. More...
 
template<class T >
bool is_zero (const T &x)
 
CASADI_EXPORT std::ostream & uout ()
 
CASADI_EXPORT std::ostream & uerr ()
 
template<typename T >
bool in_range (const std::vector< T > &v, casadi_int upper)
 Check if for each element of v holds: v_i < upper. More...
 
template<typename T >
bool in_range (const std::vector< T > &v, casadi_int lower, casadi_int upper)
 Check if for each element of v holds: lower <= v_i < upper. More...
 
CASADI_EXPORT std::vector< casadi_int > complement (const std::vector< casadi_int > &v, casadi_int size)
 Returns the list of all i in [0, size[ not found in supplied list. More...
 
CASADI_EXPORT std::vector< casadi_int > lookupvector (const std::vector< casadi_int > &v, casadi_int size)
 Returns a vector for quickly looking up entries of supplied list. More...
 
CASADI_EXPORT std::vector< casadi_int > lookupvector (const std::vector< casadi_int > &v)
 
template<class T , class S >
void flatten_nested_vector (const std::vector< std::vector< T > > &nested, std::vector< S > &flat)
 Flatten a nested std::vector tot a single flattened vector. More...
 
template<class T , class S , class I >
void flatten_nested_vector (const std::vector< std::vector< T > > &nested, std::vector< S > &flat, std::vector< I > &indices)
 Flatten a nested std::vector tot a single flattened vector. More...
 
template<typename T >
bool is_increasing (const std::vector< T > &v)
 Check if the vector is strictly increasing. More...
 
template<typename T >
bool is_decreasing (const std::vector< T > &v)
 Check if the vector is strictly decreasing. More...
 
template<typename T >
bool is_nonincreasing (const std::vector< T > &v)
 Check if the vector is non-increasing. More...
 
template<typename T >
bool is_nondecreasing (const std::vector< T > &v)
 Check if the vector is non-decreasing. More...
 
template<typename T >
bool is_monotone (const std::vector< T > &v)
 Check if the vector is monotone. More...
 
template<typename T >
bool is_strictly_monotone (const std::vector< T > &v)
 Check if the vector is strictly monotone. More...
 
template<typename T >
bool has_negative (const std::vector< T > &v)
 Check if the vector has negative entries. More...
 
template<typename T >
void write_matlab (std::ostream &stream, const std::vector< T > &v)
 Print vector, matlab style. More...
 
template<typename T >
void write_matlab (std::ostream &stream, const std::vector< std::vector< T > > &v)
 Print matrix, matlab style. More...
 
template<typename T >
void read_matlab (std::istream &stream, std::vector< T > &v)
 Read vector, matlab style. More...
 
template<typename T >
void read_matlab (std::ifstream &file, std::vector< std::vector< T > > &v)
 Read matrix, matlab style. More...
 
template<typename T >
bool is_regular (const std::vector< T > &v)
 Checks if array does not contain NaN or Inf. More...
 
CASADI_EXPORT std::string temporary_file (const std::string &prefix, const std::string &suffix, const std::string &directory="")
 
CASADI_EXPORT void normalized_setup (std::istream &stream)
 
CASADI_EXPORT void normalized_setup (std::ostream &stream)
 
void normalized_out (std::ostream &stream, double val)
 
int normalized_in (std::istream &stream, double &ret)
 
CASADI_EXPORT Function conic (const std::string &name, const std::string &solver, const SpDict &qp, const Dict &opts=Dict())
 
CASADI_EXPORT Function qpsol (const std::string &name, const std::string &solver, const SXDict &qp, const Dict &opts=Dict())
 
CASADI_EXPORT Function qpsol (const std::string &name, const std::string &solver, const MXDict &qp, const Dict &opts=Dict())
 
CASADI_EXPORT std::vector< std::string > conic_in ()
 Get the input scheme of QP solvers. More...
 
CASADI_EXPORT std::vector< std::string > conic_out ()
 Get the output scheme of QP solvers. More...
 
CASADI_EXPORT std::string conic_in (casadi_int ind)
 Get the name of a QP solver input by index. More...
 
CASADI_EXPORT std::string conic_out (casadi_int ind)
 Get the name of a QP solver output by index. More...
 
CASADI_EXPORT casadi_int conic_n_in ()
 Get the number of QP solver inputs. More...
 
CASADI_EXPORT casadi_int conic_n_out ()
 Get the number of QP solver outputs. More...
 
CASADI_EXPORT std::vector< std::string > conic_options (const std::string &name)
 Get all options of a QP solver plugin. More...
 
CASADI_EXPORT std::string conic_option_type (const std::string &name, const std::string &op)
 Get the type of an option of a QP solver plugin. More...
 
CASADI_EXPORT std::string conic_option_info (const std::string &name, const std::string &op)
 Get the documentation string of an option of a QP solver plugin. More...
 
CASADI_EXPORT bool has_conic (const std::string &name)
 Check if a QP solver plugin is available. More...
 
CASADI_EXPORT void load_conic (const std::string &name)
 Explicitly load a QP solver plugin. More...
 
CASADI_EXPORT std::string doc_conic (const std::string &name)
 Get the documentation string of a QP solver plugin. More...
 
CASADI_EXPORT void conic_debug (const Function &f, const std::string &filename)
 Generate native code in the interfaced language for debugging. More...
 
CASADI_EXPORT void conic_debug (const Function &f, std::ostream &file)
 Generate native code in the interfaced language for debugging, to a stream. More...
 
CASADI_EXPORT Function dplesol (const std::string &name, const std::string &solver, const SpDict &st, const Dict &opts=Dict())
 
CASADI_EXPORT MX dplesol (const MX &A, const MX &V, const std::string &solver, const Dict &opts=Dict())
 
CASADI_EXPORT MXVector dplesol (const MXVector &A, const MXVector &V, const std::string &solver, const Dict &opts=Dict())
 
CASADI_EXPORT DMVector dplesol (const DMVector &A, const DMVector &V, const std::string &solver, const Dict &opts=Dict())
 
CASADI_EXPORT std::vector< std::string > dple_in ()
 Get input scheme of DPLE solvers. More...
 
CASADI_EXPORT std::vector< std::string > dple_out ()
 Get output scheme of DPLE solvers. More...
 
CASADI_EXPORT std::string dple_in (casadi_int ind)
 Get DPLE input scheme name by index. More...
 
CASADI_EXPORT std::string dple_out (casadi_int ind)
 Get DPLE output scheme name by index. More...
 
CASADI_EXPORT casadi_int dple_n_in ()
 Get the number of QP solver inputs. More...
 
CASADI_EXPORT casadi_int dple_n_out ()
 Get the number of QP solver outputs. More...
 
CASADI_EXPORT bool has_dple (const std::string &name)
 Check if a particular plugin is available. More...
 
CASADI_EXPORT void load_dple (const std::string &name)
 Explicitly load a plugin dynamically. More...
 
CASADI_EXPORT std::string doc_dple (const std::string &name)
 Get the documentation string for a plugin. More...
 
std::string trim_path (const std::string &full_path)
 
std::ostream & message_prefix (std::ostream &stream)
 
CASADI_EXPORT Function expmsol (const std::string &name, const std::string &solver, const Sparsity &A, const Dict &opts=Dict())
 
CASADI_EXPORT casadi_int expm_n_in ()
 Get the number of expm solver inputs. More...
 
CASADI_EXPORT casadi_int expm_n_out ()
 Get the number of expm solver outputs. More...
 
CASADI_EXPORT bool has_expm (const std::string &name)
 Check if a particular plugin is available. More...
 
CASADI_EXPORT void load_expm (const std::string &name)
 Explicitly load a plugin dynamically. More...
 
CASADI_EXPORT std::string doc_expm (const std::string &name)
 Get the documentation string for a plugin. More...
 
CASADI_EXPORT Function external (const std::string &name, const Dict &opts=Dict())
 Load an external function from a shared library. More...
 
CASADI_EXPORT Function external (const std::string &name, const std::string &bin_name, const Dict &opts=Dict())
 Load an external function from a shared library. More...
 
CASADI_EXPORT Function external (const std::string &name, const Importer &li, const Dict &opts=Dict())
 Load a just-in-time compiled external function. More...
 
CASADI_EXPORT bool has_filesystem (const std::string &name)
 Check if a particular plugin is available. More...
 
CASADI_EXPORT void load_filesystem (const std::string &name)
 Explicitly load a plugin dynamically. More...
 
CASADI_EXPORT std::string doc_filesystem (const std::string &name)
 Get the documentation string for a plugin. More...
 
void CASADI_EXPORT _function_buffer_eval (void *raw)
 
double CASADI_EXPORT index_interp1d (const std::vector< double > &x, double xq, bool equidistant=false)
 
CASADI_EXPORT bool has_graphmodel (const std::string &name)
 Check if a graph-model format plugin is available. More...
 
CASADI_EXPORT void load_graphmodel (const std::string &name)
 Explicitly load a graph-model format plugin. More...
 
CASADI_EXPORT std::string doc_graphmodel (const std::string &name)
 Get format-specific documentation. More...
 
bool CASADI_EXPORT is_slice (const IM &x, bool ind1=false)
 Is the IM a Slice. More...
 
Slice CASADI_EXPORT to_slice (const IM &x, bool ind1=false)
 Convert IM to Slice. More...
 
CASADI_EXPORT void collocation_interpolators (const std::vector< double > &tau, std::vector< std::vector< double > > &C, std::vector< double > &D)
 Obtain collocation interpolating matrices. More...
 
CASADI_EXPORT void collocation_coeff (const std::vector< double > &tau, DM &C, DM &D, DM &B)
 Obtain collocation interpolating matrices. More...
 
CASADI_EXPORT Function simpleRK (Function f, casadi_int N=10, casadi_int order=4)
 Construct an explicit Runge-Kutta integrator. More...
 
CASADI_EXPORT Function simpleIRK (Function f, casadi_int N=10, casadi_int order=4, const std::string &scheme="radau", const std::string &solver="newton", const Dict &solver_options=Dict())
 Construct an implicit Runge-Kutta integrator using a collocation scheme. More...
 
CASADI_EXPORT Function simpleIntegrator (Function f, const std::string &integrator="cvodes", const Dict &integrator_options=Dict())
 Simplified wrapper for the Integrator class. More...
 
CASADI_EXPORT Function integrator (const std::string &name, const std::string &solver, const SXDict &dae, const Dict &opts=Dict())
 
CASADI_EXPORT Function integrator (const std::string &name, const std::string &solver, const MXDict &dae, const Dict &opts=Dict())
 
CASADI_EXPORT Function integrator (const std::string &name, const std::string &solver, const Function &dae, const Dict &opts=Dict())
 
CASADI_EXPORT Function integrator (const std::string &name, const std::string &solver, const SXDict &dae, double t0, const std::vector< double > &tout, const Dict &opts=Dict())
 
CASADI_EXPORT Function integrator (const std::string &name, const std::string &solver, const MXDict &dae, double t0, const std::vector< double > &tout, const Dict &opts=Dict())
 
CASADI_EXPORT Function integrator (const std::string &name, const std::string &solver, const Function &dae, double t0, const std::vector< double > &tout, const Dict &opts=Dict())
 
CASADI_EXPORT Function integrator (const std::string &name, const std::string &solver, const SXDict &dae, double t0, double tf, const Dict &opts=Dict())
 
CASADI_EXPORT Function integrator (const std::string &name, const std::string &solver, const MXDict &dae, double t0, double tf, const Dict &opts=Dict())
 
CASADI_EXPORT Function integrator (const std::string &name, const std::string &solver, const Function &dae, double t0, double tf, const Dict &opts=Dict())
 
CASADI_EXPORT bool has_integrator (const std::string &name)
 Check if an integrator plugin is available. More...
 
CASADI_EXPORT void load_integrator (const std::string &name)
 Explicitly load an integrator plugin. More...
 
CASADI_EXPORT std::string doc_integrator (const std::string &name)
 Get the documentation string of an integrator plugin. More...
 
CASADI_EXPORT std::vector< std::string > integrator_in ()
 Get the input scheme of integrators. More...
 
CASADI_EXPORT std::vector< std::string > integrator_out ()
 Get the output scheme of integrators. More...
 
CASADI_EXPORT std::string integrator_in (casadi_int ind)
 Get the name of an integrator input by index. More...
 
CASADI_EXPORT std::string integrator_out (casadi_int ind)
 Get the name of an integrator output by index. More...
 
CASADI_EXPORT casadi_int integrator_n_in ()
 Get the number of integrator inputs. More...
 
CASADI_EXPORT casadi_int integrator_n_out ()
 Get the number of integrator outputs. More...
 
CASADI_EXPORT std::vector< std::string > dyn_in ()
 Get the input scheme of a DAE function. More...
 
CASADI_EXPORT std::vector< std::string > dyn_out ()
 Get the output scheme of a DAE function. More...
 
CASADI_EXPORT std::string dyn_in (casadi_int ind)
 Get the name of a DAE function input by index. More...
 
CASADI_EXPORT std::string dyn_out (casadi_int ind)
 Get the name of a DAE function output by index. More...
 
CASADI_EXPORT casadi_int dyn_n_in ()
 Get the number of inputs of a DAE function. More...
 
CASADI_EXPORT casadi_int dyn_n_out ()
 Get the number of outputs of a DAE function. More...
 
CASADI_EXPORT std::vector< std::string > event_in ()
 Get the input scheme of an event transition function. More...
 
CASADI_EXPORT std::vector< std::string > event_out ()
 Get the output scheme of an event transition function. More...
 
CASADI_EXPORT Function interpolant (const std::string &name, const std::string &solver, const std::vector< std::vector< double > > &grid, const std::vector< double > &values, const Dict &opts=Dict())
 
CASADI_EXPORT Function interpolant (const std::string &name, const std::string &solver, const std::vector< std::vector< double > > &grid, casadi_int m=1, const Dict &opts=Dict())
 Parametric variant of interpolant. More...
 
CASADI_EXPORT Function interpolant (const std::string &name, const std::string &solver, const std::vector< casadi_int > &grid_dims, casadi_int m=1, const Dict &opts=Dict())
 Parametric variant of interpolant. More...
 
CASADI_EXPORT Function interpolant (const std::string &name, const std::string &solver, const std::vector< casadi_int > &grid_dims, const std::vector< double > &values, const Dict &opts=Dict())
 Parametric variant of interpolant. More...
 
CASADI_EXPORT bool has_interpolant (const std::string &name)
 Check if a particular plugin is available. More...
 
CASADI_EXPORT void load_interpolant (const std::string &name)
 Explicitly load a plugin dynamically. More...
 
CASADI_EXPORT std::string doc_interpolant (const std::string &name)
 Get the documentation string for a plugin. More...
 
CASADI_EXPORT bool has_linsol (const std::string &name)
 Check if a linear solver plugin is available. More...
 
CASADI_EXPORT void load_linsol (const std::string &name)
 Explicitly load a linear solver plugin. More...
 
CASADI_EXPORT std::string doc_linsol (const std::string &name)
 Get the documentation string of a linear solver plugin. More...
 
CASADI_EXPORT bool has_modelicaparser (const std::string &name)
 Check if a particular plugin is available. More...
 
CASADI_EXPORT void load_modelicaparser (const std::string &name)
 Explicitly load a plugin dynamically. More...
 
CASADI_EXPORT std::string doc_modelicaparser (const std::string &name)
 Get solver specific documentation. More...
 
MX kron_contract (const MX &m, const MX &x, bool inner)
 Kronecker contraction, the adjoint of kron. More...
 
CASADI_EXPORT void detect_simple_bounds (const SX &xX, const SX &p, const SX &g, const SX &lbg, const SX &ubg, std::vector< casadi_int > &gi, SX &lbx, SX &ubx, Function &lam_forward, Function &lam_backward)
 Detect simple bounds from general constraints. More...
 
CASADI_EXPORT void detect_simple_bounds (const MX &xX, const MX &p, const MX &g, const MX &lbg, const MX &ubg, std::vector< casadi_int > &gi, MX &lbx, MX &ubx, Function &lam_forward, Function &lam_backward)
 
template<class T >
void check_sos (casadi_int nx, const std::vector< std::vector< T > > &groups, std::vector< std::vector< double > > &weights, std::vector< casadi_int > &types)
 Check sos structure and generate defaults. More...
 
CASADI_EXPORT Function nlpsol (const std::string &name, const std::string &solver, const SXDict &nlp, const Dict &opts=Dict())
 
CASADI_EXPORT Function nlpsol (const std::string &name, const std::string &solver, const MXDict &nlp, const Dict &opts=Dict())
 
CASADI_EXPORT Function nlpsol (const std::string &name, const std::string &solver, const std::string &fname, const Dict &opts=Dict())
 
CASADI_EXPORT Function nlpsol (const std::string &name, const std::string &solver, const Importer &compiler, const Dict &opts=Dict())
 
CASADI_EXPORT Function nlpsol (const std::string &name, const std::string &solver, const NlpBuilder &nl, const Dict &opts=Dict())
 
CASADI_EXPORT Function nlpsol (const std::string &name, const std::string &solver, const Function &nlp, const Dict &opts=Dict())
 
CASADI_EXPORT std::vector< std::string > nlpsol_in ()
 Get the input scheme of NLP solvers. More...
 
CASADI_EXPORT std::vector< std::string > nlpsol_out ()
 Get the output scheme of NLP solvers. More...
 
CASADI_EXPORT std::string nlpsol_in (casadi_int ind)
 Get the name of an NLP solver input by index. More...
 
CASADI_EXPORT std::string nlpsol_out (casadi_int ind)
 Get the name of an NLP solver output by index. More...
 
CASADI_EXPORT casadi_int nlpsol_n_in ()
 Number of NLP solver inputs. More...
 
CASADI_EXPORT casadi_int nlpsol_n_out ()
 Number of NLP solver outputs. More...
 
CASADI_EXPORT std::vector< std::string > nlpsol_options (const std::string &name)
 Get all options of an NLP solver plugin. More...
 
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. More...
 
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. More...
 
CASADI_EXPORT bool has_nlpsol (const std::string &name)
 Check if an NLP solver plugin is available. More...
 
CASADI_EXPORT void load_nlpsol (const std::string &name)
 Explicitly load an NLP solver plugin. More...
 
CASADI_EXPORT std::string doc_nlpsol (const std::string &name)
 Get the documentation string of an NLP solver plugin. More...
 
CASADI_EXPORT bool has_onnxbackend (const std::string &solver)
 Check if a given ONNX runtime backend is available. More...
 
CASADI_EXPORT void load_onnxbackend (const std::string &solver)
 Load an ONNX runtime backend. More...
 
CASADI_EXPORT std::vector< std::string > onnxbackend_solvers ()
 List available ONNX runtime backends. More...
 
CASADI_EXPORT std::string onnxbackend_doc (const std::string &solver)
 Get documentation for an ONNX runtime backend. More...
 
CASADI_EXPORT Function rootfinder (const std::string &name, const std::string &solver, const SXDict &rfp, const Dict &opts=Dict())
 
CASADI_EXPORT Function rootfinder (const std::string &name, const std::string &solver, const MXDict &rfp, const Dict &opts=Dict())
 
CASADI_EXPORT Function rootfinder (const std::string &name, const std::string &solver, const Function &f, const Dict &opts=Dict())
 
CASADI_EXPORT std::vector< std::string > rootfinder_in ()
 Get the rootfinder input scheme. More...
 
CASADI_EXPORT std::vector< std::string > rootfinder_out ()
 Get the rootfinder output scheme. More...
 
CASADI_EXPORT std::string rootfinder_in (casadi_int ind)
 Get the name of a rootfinder input by index. More...
 
CASADI_EXPORT std::string rootfinder_out (casadi_int ind)
 Get the name of a rootfinder output by index. More...
 
CASADI_EXPORT casadi_int rootfinder_n_in ()
 Number of rootfinder inputs. More...
 
CASADI_EXPORT casadi_int rootfinder_n_out ()
 Number of rootfinder outputs. More...
 
CASADI_EXPORT std::vector< std::string > rootfinder_options (const std::string &name)
 Get all options of a rootfinder plugin. More...
 
CASADI_EXPORT std::string rootfinder_option_type (const std::string &name, const std::string &op)
 Get the type of an option of a rootfinder plugin. More...
 
CASADI_EXPORT std::string rootfinder_option_info (const std::string &name, const std::string &op)
 Get the documentation string of an option of a rootfinder plugin. More...
 
CASADI_EXPORT bool has_rootfinder (const std::string &name)
 Check if a rootfinder plugin is available. More...
 
CASADI_EXPORT void load_rootfinder (const std::string &name)
 Explicitly load a rootfinder plugin. More...
 
CASADI_EXPORT std::string doc_rootfinder (const std::string &name)
 Get the documentation string of a rootfinder plugin. More...
 
template<typename T >
casadi_int einstein_process (const T &A, const T &B, const T &C, const std::vector< casadi_int > &dim_a, const std::vector< casadi_int > &dim_b, const std::vector< casadi_int > &dim_c, const std::vector< casadi_int > &a, const std::vector< casadi_int > &b, const std::vector< casadi_int > &c, std::vector< casadi_int > &iter_dims, std::vector< casadi_int > &strides_a, std::vector< casadi_int > &strides_b, std::vector< casadi_int > &strides_c)
 
template<typename T >
void Contraction (const T &a, const T &b, T &r)
 
template<>
void Contraction (const bvec_t &a, const bvec_t &b, bvec_t &r)
 
template<typename T >
void einstein_eval (casadi_int n_iter, const std::vector< casadi_int > &iter_dims, const std::vector< casadi_int > &strides_a, const std::vector< casadi_int > &strides_b, const std::vector< casadi_int > &strides_c, const T *a_in, const T *b_in, T *c_in)
 
Slice CASADI_EXPORT to_slice (const std::vector< casadi_int > &v, bool ind1=false)
 Construct from an index vector (requires is_slice(v) to be true) More...
 
std::pair< Slice, Slice > CASADI_EXPORT to_slice2 (const std::vector< casadi_int > &v)
 Construct nested slices from an index vector (requires is_slice2(v) to be true) More...
 
bool CASADI_EXPORT is_slice (const std::vector< casadi_int > &v, bool ind1=false)
 Check if an index vector can be represented more efficiently as a slice. More...
 
bool CASADI_EXPORT is_slice2 (const std::vector< casadi_int > &v)
 Check if an index vector can be represented more efficiently as two nested slices. More...
 
CASADI_EXPORT std::size_t hash_sparsity (casadi_int nrow, casadi_int ncol, const std::vector< casadi_int > &colind, const std::vector< casadi_int > &row)
 Hash a sparsity pattern. More...
 
CASADI_EXPORT std::size_t hash_sparsity (casadi_int nrow, casadi_int ncol, const casadi_int *colind, const casadi_int *row)
 
template<>
std::string matrixName< SXElem > ()
 
CASADI_EXPORT Function external_transform (const std::string &name, const std::string &op, const Function &f, const Dict &opts=Dict())
 Apply a transformation defined externally. More...
 
void casadi_sleqp_func_create (SleqpFunc **star, int num_vars, int num_cons, SLEQPMemory *m)
 
int slicot_mb03vd (int n, int p, int ilo, int ihi, double *a, int lda1, int lda2, double *tau, int ldtau, double *dwork=nullptr)
 
int slicot_mb03vy (int n, int p, int ilo, int ihi, double *a, int lda1, int lda2, const double *tau, int ldtau, double *dwork=nullptr, int ldwork=0)
 
int slicot_mb03wd (char job, char compz, int n, int p, int ilo, int ihi, int iloz, int ihiz, double *h, int ldh1, int ldh2, double *z, int ldz1, int ldz2, double *wr, double *wi, double *dwork=nullptr, int ldwork=0)
 
int slicot_mb05nd (int n, double delta, const double *a, int lda, double *ex, int ldex, double *exint, int ldexin, double tol, int *iwork, double *dwork, int ldwork)
 
CASADI_EXPORT std::vector< double > collocation_points (casadi_int order, const std::string &scheme="radau")
 Obtain collocation points of specific order and scheme. More...
 
CASADI_EXPORT MXDict dae_reduce_index (const MXDict &dae, Dict &stats, const Dict &opts={})
 Reduce index. More...
 
CASADI_EXPORT SXDict dae_reduce_index (const SXDict &dae, Dict &stats, const Dict &opts={})
 Reduce index. More...
 
CASADI_EXPORT MXDict dae_map_semi_expl (const MXDict &dae, const MXDict &dae_red, Function &state_to_orig, Function &phi)
 Turn a reduced DAE into a semi explicit form suitable for CasADi integrator. More...
 
CASADI_EXPORT SXDict dae_map_semi_expl (const SXDict &dae, const SXDict &dae_red, Function &state_to_orig, Function &phi)
 Turn a reduced DAE into a semi explicit form suitable for CasADi integrator. More...
 
CASADI_EXPORT Function dae_init_gen (const MXDict &dae, const MXDict &dae_red, const std::string &init_solver, const DMDict &init_strength=DMDict(), const Dict &init_solver_options=Dict())
 Obtain a generator Function for producing consistent initial guesses of a reduced DAE. More...
 
CASADI_EXPORT Function dae_init_gen (const SXDict &dae, const SXDict &dae_red, const std::string &init_solver, const DMDict &init_strength=DMDict(), const Dict &init_solver_options=Dict())
 Obtain a generator Function for producing consistent initial guesses of a reduced DAE. More...
 
CASADI_EXPORT double nlpsol_default_in (casadi_int ind)
 Default value of an NLP solver input. More...
 
CASADI_EXPORT std::vector< double > nlpsol_default_in ()
 Default value of an NLP solver input. More...
 

Detailed Description

C/C++.

Convenience tools for C++ Standard Library vectors.

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

Author
Joel Andersson
Date
2010-2011

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

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

Typedef Documentation

◆ Dict

typedef std::map< std::string, GenericType > casadi::Dict
Examples
Function/callback_c.cc.

Definition at line 258 of file generic_type.hpp.

◆ DM

typedef Matrix<double> casadi::DM
Examples
Function/callback_c.cc, and misc/all.cc.

Definition at line 33 of file dm_fwd.hpp.

◆ DMDict

typedef std::map<std::string, DM> casadi::DMDict

Definition at line 36 of file dm_fwd.hpp.

◆ DMVector

typedef std::vector<DM> casadi::DMVector

Definition at line 34 of file dm_fwd.hpp.

◆ DMVectorVector

typedef std::vector<DMVector> casadi::DMVectorVector

Definition at line 35 of file dm_fwd.hpp.

◆ external_print_callback_t

typedef void(* casadi::external_print_callback_t) (const char *s)

Definition at line 47 of file tools.hpp.

◆ external_transform_t

typedef const char*(* casadi::external_transform_t) (char api_version, const char *casadi_version, const char *in, external_print_callback_t cb_stdout, external_print_callback_t cb_stderr)

Definition at line 48 of file tools.hpp.

◆ IM

typedef Matrix<casadi_int> casadi::IM

Definition at line 31 of file im_fwd.hpp.

◆ MXDict

typedef std::map<std::string, MX> casadi::MXDict

Readability typedefs

Definition at line 5151 of file mx.hpp.

◆ MXIList

typedef std::initializer_list<MX> casadi::MXIList

Readability typedefs

Definition at line 5149 of file mx.hpp.

◆ MXVector

typedef std::vector<MX> casadi::MXVector

Readability typedefs

Definition at line 5148 of file mx.hpp.

◆ MXVectorVector

typedef std::vector<MXVector> casadi::MXVectorVector

Readability typedefs

Definition at line 5150 of file mx.hpp.

◆ native_DM

Definition at line 33 of file optistack.hpp.

◆ SpDict

typedef std::map<std::string, Sparsity> casadi::SpDict

Readability typedefs

Definition at line 6350 of file sparsity.hpp.

◆ SX

Readability typedefs

Examples
SX/SXaddition.cc.

Definition at line 36 of file sx_fwd.hpp.

◆ SXDict

typedef std::map<std::string, SX> casadi::SXDict

Readability typedefs

Definition at line 40 of file sx_fwd.hpp.

◆ SXIList

typedef std::initializer_list<SX> casadi::SXIList

Readability typedefs

Definition at line 38 of file sx_fwd.hpp.

◆ SXVector

typedef std::vector<SX> casadi::SXVector

Readability typedefs

Definition at line 37 of file sx_fwd.hpp.

◆ SXVectorVector

typedef std::vector<SXVector> casadi::SXVectorVector

Readability typedefs

Definition at line 39 of file sx_fwd.hpp.

Enumeration Type Documentation

◆ Attribute

enum casadi::Attribute
strong
Enumerator
MIN 
MAX 
NOMINAL 
START 
VALUE 
STRINGVALUE 
NUMEL 

Definition at line 70 of file dae_builder_internal.hpp.

◆ Category

enum casadi::Category
strong
Enumerator
T 
C 
P 
D 
W 
U 
X 
Z 
Q 
CALCULATED 
ODE 
ALG 
QUAD 
ZERO 
DDEF 
WDEF 
Y 
NUMEL 

Definition at line 63 of file dae_builder_internal.hpp.

◆ Causality

enum casadi::Causality
strong
Enumerator
PARAMETER 
CALCULATED_PARAMETER 
INPUT 
OUTPUT 
LOCAL 
INDEPENDENT 
NUMEL 

Definition at line 49 of file dae_builder_internal.hpp.

◆ CollocationPoints

Enumerator
LEGENDRE 
RADAU 

Definition at line 123 of file integration_tools.hpp.

◆ ConoptBasisStatus

Enumerator
AtLower 
AtUpper 
Basic 
SuperBasic 

Definition at line 63 of file conopt_interface.hpp.

◆ ConoptModelStatus

Enumerator
Unset 
Optimal 
LocallyOptimal 
Unbounded 
Infeasible 
LocallyInfeasible 
IntermediateInfeas 
IntermediateNonOpt 
UnknownError 
ErrorNoSolution 

Definition at line 39 of file conopt_interface.hpp.

◆ ConoptRowType

enum casadi::ConoptRowType
strong
Enumerator
Equality 
GreaterEqual 
LessEqual 
Free 

Definition at line 54 of file conopt_interface.hpp.

◆ ConoptSolverStatus

Enumerator
Unset 
NormalCompletion 
IterationLimit 
TimeLimit 
TerminatedBySolver 
EvalErrorLimit 
UserInterrupt 
SetupFailure 
MajorSolverError 
MajorSolverErrorFeas 
SystemError 
QuickModeTermination 

Definition at line 70 of file conopt_interface.hpp.

◆ ConstraintType

Enumerator
OPTI_GENERIC_EQUALITY 
OPTI_GENERIC_INEQUALITY 
OPTI_EQUALITY 
OPTI_INEQUALITY 
OPTI_DOUBLE_INEQUALITY 
OPTI_PSD 
OPTI_UNKNOWN 

Definition at line 2702 of file optistack.hpp.

◆ DependenciesKind

Enumerator
DEPENDENT 
CONSTANT 
FIXED 
TUNABLE 
DISCRETE 
NUMEL 

Definition at line 73 of file dae_builder_internal.hpp.

◆ DomainType

Enumerator
OPTI_DOMAIN_REAL 
OPTI_DOMAIN_INTEGER 

Definition at line 2717 of file optistack.hpp.

◆ Initial

enum casadi::Initial
strong
Enumerator
EXACT 
APPROX 
CALCULATED 
NA 
NUMEL 

Definition at line 67 of file dae_builder_internal.hpp.

◆ Type

enum casadi::Type
strong
Enumerator
FLOAT32 
FLOAT64 
INT8 
UINT8 
INT16 
UINT16 
INT32 
UINT32 
INT64 
UINT64 
BOOLEAN 
STRING 
BINARY 
ENUMERATION 
CLOCK 
NUMEL 

Definition at line 45 of file dae_builder_internal.hpp.

◆ TypeFmi2

enum casadi::TypeFmi2
strong
Enumerator
REAL 
INTEGER 
BOOLEAN 
STRING 
ENUM 
NUMEL 

Definition at line 42 of file dae_builder_internal.hpp.

◆ UnifiedReturnStatus

Unified return status for solvers

Enumerator
SOLVER_RET_SUCCESS 
SOLVER_RET_UNKNOWN 
SOLVER_RET_LIMITED 
SOLVER_RET_NAN 
SOLVER_RET_INFEASIBLE 
SOLVER_RET_EXCEPTION 

Definition at line 55 of file casadi_types.hpp.

◆ Variability

enum casadi::Variability
strong
Enumerator
CONSTANT 
FIXED 
TUNABLE 
DISCRETE 
CONTINUOUS 
NUMEL 

Definition at line 52 of file dae_builder_internal.hpp.

◆ VariableType

Enumerator
OPTI_VAR 
OPTI_PAR 
OPTI_DUAL_G 

Definition at line 2711 of file optistack.hpp.

Function Documentation

◆ _function_buffer_eval()

void CASADI_EXPORT casadi::_function_buffer_eval ( void *  raw)

◆ blazing_spline() [1/2]

CASADI_EXPORT Function casadi::blazing_spline ( const std::string &  name,
const std::vector< casadi_int > &  knot_dims,
const Dict &  opts = Dict() 
)

Like blazing_spline, but the knot values are provided as a symbolic input at evaluation time instead of being fixed at construction time. Only knot vector sizes (per dimension) are needed at construction.

The resulting Function has inputs (x, C, knots) where knots is the stacked knot vector. Supports the same precompute_coeff and precompute_grid options as the fixed-knots variant.

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

◆ blazing_spline() [2/2]

CASADI_EXPORT Function casadi::blazing_spline ( const std::string &  name,
const std::vector< std::vector< double > > &  knots,
const Dict &  opts = Dict() 
)

Specialized in these ways:

  • order 3 is assumed
  • up to dimension 5 supported
  • a single scalar output (m=1)

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

◆ casadi_sleqp_func_create()

void casadi::casadi_sleqp_func_create ( SleqpFunc **  star,
int  num_vars,
int  num_cons,
SLEQPMemory *  m 
)

◆ check_sos()

template<class T >
void casadi::check_sos ( casadi_int  nx,
const std::vector< std::vector< T > > &  groups,
std::vector< std::vector< double > > &  weights,
std::vector< casadi_int > &  types 
)

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

Definition at line 79 of file nlp_tools.hpp.

◆ collocation_coeff()

CASADI_EXPORT void casadi::collocation_coeff ( const std::vector< double > &  tau,
DM &  C,
DM &  D,
DM &  B 
)

A collocation method poses a polynomial Pi that interpolates exactly through an initial state (0,X_0) and helper states at collocation points (tau_j,Xc_j) with j=1..degree.

This function computes the linear mapping between dPi/dt and coefficients Z=[X_0 Xc].

Parameters
taulocation of collocation points (length: degree), as obtained from collocation_points
[out]Cinterpolating coefficients to obtain derivatives. Size: (degree+1)-by-degree

You may find the slopes of Pi at the collocation points as

    dPi/dt @ Xc = (1/h) Z*C,

with h the length of the integration interval.

Parameters
[out]Dinterpolating coefficients to obtain end state. Size: (degree+1)-by-1

You may find the end point of Pi as

    Pi @X_f = Z*D
Parameters
[out]Bquadrature coefficients Size: degree-by-1

Given quadrature righ-hand-sides 'quad' evaluated at the collocation points, you may find the integrated quadratures as

    q = quad*B*h

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

◆ collocation_interpolators()

CASADI_EXPORT void casadi::collocation_interpolators ( const std::vector< double > &  tau,
std::vector< std::vector< double > > &  C,
std::vector< double > &  D 
)

A collocation method poses a polynomial Pi that interpolates exactly through an initial state (0,X_0) and helper states at collocation points (tau_j,X:collPoint(j)).

This function computes the linear mapping between dPi/dt and coefficients Z=[X_0 X:collPoints].

Parameters
taulocation of collocation points, as obtained from collocation_points
[out]Cinterpolating coefficients to obtain derivatives. Length: order+1, order+1
    dPi/dt @Z_j = (1/h) Sum_i C[j][i]*Z_i,

with h the length of the integration interval.

Parameters
[out]Dinterpolating coefficients to obtain end state. Length: order+1
    Pi @X_f = Sum_i D[i]*Z_i

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

◆ collocation_points()

CASADI_EXPORT std::vector<double> casadi::collocation_points ( casadi_int  order,
const std::string &  scheme = "radau" 
)
Parameters
orderWhich order (1 to 9 supported)
scheme'radau' or 'legendre'

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

◆ complement()

CASADI_EXPORT std::vector<casadi_int> casadi::complement ( const std::vector< casadi_int > &  v,
casadi_int  size 
)

The supplied vector may contain duplicates and may be non-monotonous The supplied vector will be checked for bounds The result vector is guaranteed to be monotonously increasing

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

◆ Contraction() [1/2]

template<>
void casadi::Contraction ( const bvec_t &  a,
const bvec_t &  b,
bvec_t &  r 
)
inline

Definition at line 156 of file shared.hpp.

◆ Contraction() [2/2]

template<typename T >
void casadi::Contraction ( const T &  a,
const T &  b,
T &  r 
)

Definition at line 151 of file shared.hpp.

◆ dae_init_gen() [1/2]

CASADI_EXPORT Function casadi::dae_init_gen ( const MXDict &  dae,
const MXDict &  dae_red,
const std::string &  init_solver,
const DMDict &  init_strength = DMDict(),
const Dict &  init_solver_options = Dict() 
)
Parameters
[in]daeOriginal (unreduced) DAE structure
[in]dae_redReduced DAE (see dae_reduce_index)
[in]init_solverNLP solver plugin name for nlpsol used to construct an initial guess
[in]init_strengthInfluence the nature of the NLP Structure with keys x_impl, dx_impl, z corresponding to inputs of init_gen Each key maps to a DM that should match the variable size corresponding to that key. For each variable the meaning of the corresponding DM value is as follows: When >=0, indicates that the provided initial guess is used in a quadratic penalty (value used as weight) When -1, indicates that the provided initial guess must be observed (simple bound on variable)
[in]init_solver_optionsNLP solver options to be passed to nlpsol
Returns
init_gen A function to generate a consistent initial guess that can be used to pass to an integrator constructed from a semi explict reduced DAE Inputs:
  • x_impl, dx_impl, z: initial guesses in the original DAE space
  • p: parameters
  • t: time Outputs:
  • x0, z0: (semi explicit) integrator states and algebraic variables; typically used as input for integrators
See also
dae_reduce_index

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

◆ dae_init_gen() [2/2]

CASADI_EXPORT Function casadi::dae_init_gen ( const SXDict &  dae,
const SXDict &  dae_red,
const std::string &  init_solver,
const DMDict &  init_strength = DMDict(),
const Dict &  init_solver_options = Dict() 
)
Parameters
[in]daeOriginal (unreduced) DAE structure
[in]dae_redReduced DAE (see dae_reduce_index)
[in]init_solverNLP solver plugin name for nlpsol used to construct an initial guess
[in]init_strengthInfluence the nature of the NLP Structure with keys x_impl, dx_impl, z corresponding to inputs of init_gen Each key maps to a DM that should match the variable size corresponding to that key. For each variable the meaning of the corresponding DM value is as follows: When >=0, indicates that the provided initial guess is used in a quadratic penalty (value used as weight) When -1, indicates that the provided initial guess must be observed (simple bound on variable)
[in]init_solver_optionsNLP solver options to be passed to nlpsol
Returns
init_gen A function to generate a consistent initial guess that can be used to pass to an integrator constructed from a semi explict reduced DAE Inputs:
  • x_impl, dx_impl, z: initial guesses in the original DAE space
  • p: parameters
  • t: time Outputs:
  • x0, z0: (semi explicit) integrator states and algebraic variables; typically used as input for integrators
See also
dae_reduce_index

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

◆ dae_map_semi_expl() [1/2]

CASADI_EXPORT MXDict casadi::dae_map_semi_expl ( const MXDict &  dae,
const MXDict &  dae_red,
Function &  state_to_orig,
Function &  phi 
)
Parameters
[in]daeOriginal (unreduced) DAE structure
[in]dae_redReduced DAE (see dae_reduce_index)
[out]state_to_origA mapping of integrator (semi explicit) states to states of the original DAE
[out]phiA function to compute the invariants of the reduced DAE Inputs:
  • x and z: (semi explicit) integrator states; typically integrator outputs xf and zf
  • p: parameters
  • t: time
Returns
Semi explicit DAE dictionary, suitable to pass to a CasADi integrator
See also
dae_reduce_index

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

◆ dae_map_semi_expl() [2/2]

CASADI_EXPORT SXDict casadi::dae_map_semi_expl ( const SXDict &  dae,
const SXDict &  dae_red,
Function &  state_to_orig,
Function &  phi 
)
Parameters
[in]daeOriginal (unreduced) DAE structure
[in]dae_redReduced DAE (see dae_reduce_index)
[out]state_to_origA mapping of integrator (semi explicit) states to states of the original DAE
[out]phiA function to compute the invariants of the reduced DAE Inputs:
  • x and z: (semi explicit) integrator states; typically integrator outputs xf and zf
  • p: parameters
  • t: time
Returns
Semi explicit DAE dictionary, suitable to pass to a CasADi integrator
See also
dae_reduce_index

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

◆ dae_reduce_index() [1/2]

CASADI_EXPORT MXDict casadi::dae_reduce_index ( const MXDict &  dae,
Dict &  stats,
const Dict &  opts = {} 
)

Index reduction leads to a new set of variables and equations.

In the process, a set of constraints (algebraic equations or derivatives) a.k.a invariants is constructed that are invariant to the problem: whenever an initial point satisfies these constraints, the boundary-value-problem outcome will keep satisfying those constraints automatically, even though they are not part of the reduced DAE.

For any practical numerical integration method, there will be numerical drift away from satisfaction of those constraints. In other words, you will see the value of invariants slowly moving away from original zero.

A classic mitigation technique is Baumgarte stabilization: you add these invariants to the reduced DAE as a correction term that acts in a way to make small (numerical) perturbations to the invariants decay to the origin as a dampened linear system.

in which a certain set of constraints (algebraic equations or derivatives) has been dropped in favour of

Parameters
daeExpression dictionary describing the DAE

Each value must be a dense column vector.

keys:

  • x_impl: symbol for implicit differential states
  • dx_impl: symbol for implicit differential state derivatives
  • z: symbol for algebraic variables
  • alg: expression for algebraic equations
  • t: symbol for time
  • p: symbol for parameters
    Parameters
    optsOption dictionary
    'baumgarte_pole': double Poles (inverse time constants) of the Baumgarte invariant correction term. Must be <0 to dampen out perturbations 0 (default) amounts to no correction. Corresponds to -gamma of equation (1.5) in Ascher, Uri M., Hongsheng Chin, and Sebastian Reich. "Stabilization of DAEs and invariant manifolds." Numerische Mathematik 67.2 (1994): 131-149.
Parameters
statsStatistics
Returns
Expression dictionary describing the reduced DAE

In addition the fields allowed in the input DAE, the following keys occur:

  • x: symbol for explicit differential states
  • ode: expression for right-hand-side of explicit differential states
  • I: expression for invariants

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

◆ dae_reduce_index() [2/2]

CASADI_EXPORT SXDict casadi::dae_reduce_index ( const SXDict &  dae,
Dict &  stats,
const Dict &  opts = {} 
)

Index reduction leads to a new set of variables and equations.

In the process, a set of constraints (algebraic equations or derivatives) a.k.a invariants is constructed that are invariant to the problem: whenever an initial point satisfies these constraints, the boundary-value-problem outcome will keep satisfying those constraints automatically, even though they are not part of the reduced DAE.

For any practical numerical integration method, there will be numerical drift away from satisfaction of those constraints. In other words, you will see the value of invariants slowly moving away from original zero.

A classic mitigation technique is Baumgarte stabilization: you add these invariants to the reduced DAE as a correction term that acts in a way to make small (numerical) perturbations to the invariants decay to the origin as a dampened linear system.

in which a certain set of constraints (algebraic equations or derivatives) has been dropped in favour of

Parameters
daeExpression dictionary describing the DAE

Each value must be a dense column vector.

keys:

  • x_impl: symbol for implicit differential states
  • dx_impl: symbol for implicit differential state derivatives
  • z: symbol for algebraic variables
  • alg: expression for algebraic equations
  • t: symbol for time
  • p: symbol for parameters
    Parameters
    optsOption dictionary
    'baumgarte_pole': double Poles (inverse time constants) of the Baumgarte invariant correction term. Must be <0 to dampen out perturbations 0 (default) amounts to no correction. Corresponds to -gamma of equation (1.5) in Ascher, Uri M., Hongsheng Chin, and Sebastian Reich. "Stabilization of DAEs and invariant manifolds." Numerische Mathematik 67.2 (1994): 131-149.
Parameters
statsStatistics
Returns
Expression dictionary describing the reduced DAE

In addition the fields allowed in the input DAE, the following keys occur:

  • x: symbol for explicit differential states
  • ode: expression for right-hand-side of explicit differential states
  • I: expression for invariants

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

◆ detect_simple_bounds() [1/2]

CASADI_EXPORT void casadi::detect_simple_bounds ( const MX &  xX,
const MX &  p,
const MX &  g,
const MX &  lbg,
const MX &  ubg,
std::vector< casadi_int > &  gi,
MX &  lbx,
MX &  ubx,
Function &  lam_forward,
Function &  lam_backward 
)

◆ detect_simple_bounds() [2/2]

CASADI_EXPORT void casadi::detect_simple_bounds ( const SX &  xX,
const SX &  p,
const SX &  g,
const SX &  lbg,
const SX &  ubg,
std::vector< casadi_int > &  gi,
SX &  lbx,
SX &  ubx,
Function &  lam_forward,
Function &  lam_backward 
)

Given parametric constraints:

*   subject to lbg(p) <= g(x,p) <= ubg(p)
* 

Returns an equivalent set

*   subject to  lbg(p)(gi) <= g(x,p)(gi) <= ubg(p)(gi)
*               lbx(p) <= x                 <= ubx(p)
* 
Parameters
[out]lam_forward(lam_g,p)->(lam_sg,lam_x)
[out]lam_backward(lam_sg,lam_x,p)->(lam_g)

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

◆ doc_archiver()

CASADI_EXPORT std::string casadi::doc_archiver ( const std::string &  name)

◆ doc_blas()

CASADI_EXPORT std::string casadi::doc_blas ( const std::string &  name)

◆ doc_filesystem()

CASADI_EXPORT std::string casadi::doc_filesystem ( const std::string &  name)

◆ doc_graphmodel()

CASADI_EXPORT std::string casadi::doc_graphmodel ( const std::string &  name)

◆ doc_linsol()

CASADI_EXPORT std::string casadi::doc_linsol ( const std::string &  name)

The text includes the plugin-specific option table.

>>> "QR" in doc_linsol("qr")
True

>> contains(doc_linsol('qr'), 'QR')
1

julia> occursin("QR", ca.doc_linsol("qr"))
true

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

◆ doc_modelicaparser()

CASADI_EXPORT std::string casadi::doc_modelicaparser ( const std::string &  name)

◆ einstein_eval()

template<typename T >
void casadi::einstein_eval ( casadi_int  n_iter,
const std::vector< casadi_int > &  iter_dims,
const std::vector< casadi_int > &  strides_a,
const std::vector< casadi_int > &  strides_b,
const std::vector< casadi_int > &  strides_c,
const T *  a_in,
const T *  b_in,
T *  c_in 
)

Definition at line 161 of file shared.hpp.

◆ einstein_process()

template<typename T >
casadi_int casadi::einstein_process ( const T &  A,
const T &  B,
const T &  C,
const std::vector< casadi_int > &  dim_a,
const std::vector< casadi_int > &  dim_b,
const std::vector< casadi_int > &  dim_c,
const std::vector< casadi_int > &  a,
const std::vector< casadi_int > &  b,
const std::vector< casadi_int > &  c,
std::vector< casadi_int > &  iter_dims,
std::vector< casadi_int > &  strides_a,
std::vector< casadi_int > &  strides_b,
std::vector< casadi_int > &  strides_c 
)

Definition at line 35 of file shared.hpp.

◆ external() [1/3]

CASADI_EXPORT Function casadi::external ( const std::string &  name,
const Dict &  opts = Dict() 
)
Parameters
nameName as in the label assigned to a CasADi Function object: Function(name,...,...) Will be used to look up symbols/functions named eg. <name>_eval Use nm (linux/osx) or depends.exe (win) to check which symbols are present in your shared library

File name is assumed to be ./<name>.so

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

◆ external() [2/3]

CASADI_EXPORT Function casadi::external ( const std::string &  name,
const Importer &  li,
const Dict &  opts = Dict() 
)

File name given

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

◆ external() [3/3]

CASADI_EXPORT Function casadi::external ( const std::string &  name,
const std::string &  bin_name,
const Dict &  opts = Dict() 
)
Parameters
nameName as in the label assigned to a CasADi Function object: Function(name,...,...) Will be used to look up symbols/functions named eg. <name>_eval Use nm (linux/osx) or depends.exe (win) to check which symbols are present in your shared library
bin_nameFile name of the shared library

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

◆ external_transform()

CASADI_EXPORT Function casadi::external_transform ( const std::string &  name,
const std::string &  op,
const Function &  f,
const Dict &  opts = Dict() 
)
Parameters
nameName of the shared library
opName of the operation
fFunction to transform
optsOptions
Extra doc: https://github.com/casadi/casadi/wiki/L_27i 

◆ flatten_nested_vector() [1/2]

template<class T , class S >
void casadi::flatten_nested_vector ( const std::vector< std::vector< T > > &  nested,
std::vector< S > &  flat 
)

Contents of nested[i] ends up in flat[indices[i]]..flat[indices[i+1]-1]

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

◆ flatten_nested_vector() [2/2]

template<class T , class S , class I >
void casadi::flatten_nested_vector ( const std::vector< std::vector< T > > &  nested,
std::vector< S > &  flat,
std::vector< I > &  indices 
)

Contents of nested[i] ends up in flat[indices[i]]..flat[indices[i+1]-1]

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

◆ has_archiver()

CASADI_EXPORT bool casadi::has_archiver ( const std::string &  name)

◆ has_blas()

CASADI_EXPORT bool casadi::has_blas ( const std::string &  name)

◆ has_filesystem()

CASADI_EXPORT bool casadi::has_filesystem ( const std::string &  name)

◆ has_graphmodel()

CASADI_EXPORT bool casadi::has_graphmodel ( const std::string &  name)

◆ has_linsol()

CASADI_EXPORT bool casadi::has_linsol ( const std::string &  name)

Tries to load the plugin name if it is not loaded yet; false when it is not found.

>>> has_linsol("qr"), has_linsol("no_such_plugin")
(True, False)

>> has_linsol('qr'), has_linsol('no_such_plugin')
1
0

julia> ca.has_linsol("qr"), ca.has_linsol("no_such_plugin")
(true, false)

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

◆ has_modelicaparser()

CASADI_EXPORT bool casadi::has_modelicaparser ( const std::string &  name)

◆ has_negative()

template<typename T >
bool casadi::has_negative ( const std::vector< T > &  v)

◆ hash_sparsity() [1/2]

CASADI_EXPORT std::size_t casadi::hash_sparsity ( casadi_int  nrow,
casadi_int  ncol,
const casadi_int *  colind,
const casadi_int *  row 
)

◆ hash_sparsity() [2/2]

CASADI_EXPORT std::size_t casadi::hash_sparsity ( casadi_int  nrow,
casadi_int  ncol,
const std::vector< casadi_int > &  colind,
const std::vector< casadi_int > &  row 
)

◆ in_range() [1/2]

template<typename T >
bool casadi::in_range ( const std::vector< T > &  v,
casadi_int  lower,
casadi_int  upper 
)

◆ in_range() [2/2]

template<typename T >
bool casadi::in_range ( const std::vector< T > &  v,
casadi_int  upper 
)

◆ index_interp1d()

double CASADI_EXPORT casadi::index_interp1d ( const std::vector< double > &  x,
double  xq,
bool  equidistant = false 
)

◆ is_decreasing()

template<typename T >
bool casadi::is_decreasing ( const std::vector< T > &  v)

◆ is_increasing()

template<typename T >
bool casadi::is_increasing ( const std::vector< T > &  v)

◆ is_monotone()

template<typename T >
bool casadi::is_monotone ( const std::vector< T > &  v)

◆ is_nondecreasing()

template<typename T >
bool casadi::is_nondecreasing ( const std::vector< T > &  v)

◆ is_nonincreasing()

template<typename T >
bool casadi::is_nonincreasing ( const std::vector< T > &  v)

◆ is_regular()

template<typename T >
bool casadi::is_regular ( const std::vector< T > &  v)

Definition at line 432 of file casadi_misc.hpp.

◆ is_slice() [1/2]

bool CASADI_EXPORT casadi::is_slice ( const IM &  x,
bool  ind1 = false 
)

◆ is_slice() [2/2]

bool CASADI_EXPORT casadi::is_slice ( const std::vector< casadi_int > &  v,
bool  ind1 = false 
)

◆ is_slice2()

bool CASADI_EXPORT casadi::is_slice2 ( const std::vector< casadi_int > &  v)

◆ is_strictly_monotone()

template<typename T >
bool casadi::is_strictly_monotone ( const std::vector< T > &  v)

◆ is_zero()

template<class T >
bool casadi::is_zero ( const T &  x)
inline

Definition at line 96 of file casadi_limits.hpp.

◆ kron_contract()

MX casadi::kron_contract ( const MX &  m,
const MX &  x,
bool  inner 
)
inline

Contracts a matrix m whose dimensions are multiples of those of x (as produced by kron) against x. With mB-by-nB the shape of x and blocks M[i*mB+r, j*nB+s] of m:

  • inner true: Y[i, j] = sum over (r, s) of M[i*mB+r, j*nB+s] * X[r, s]
  • inner false: Y[r, s] = sum over (i, j) of X[i, j] * M[i*mB+r, j*nB+s]

Closes the AD algebra of kron under arbitrary-order differentiation. A shape that is not a multiple raises an error.

>>> M = MX.sym("M", 4, 4)
>>> X = MX.sym("X", 2, 2)
>>> f = Function("f", [M, X], [kron_contract(M, X, True), kron_contract(M, X, False)])
>>> f(DM(np.arange(16).reshape(4, 4)), DM.eye(2))
(DM(
[[5, 9],
 [21, 25]]), DM(
[[10, 12],
 [18, 20]]))

>> M = MX.sym('M', 4, 4); X = MX.sym('X', 2, 2);
>> f = Function('f', {M, X}, {kron_contract(M, X, true), kron_contract(M, X, false)});
>> [a, b] = f(DM(reshape(0:15, 4, 4)'), DM.eye(2));
>> a, b
[[5, 9],
 [21, 25]]
[[10, 12],
 [18, 20]]

julia> M = ca.MX.sym("M", 4, 4); X = ca.MX.sym("X", 2, 2);
julia> f = ca.Function("f", [M, X], [ca.kron_contract(M, X, true),
                                     ca.kron_contract(M, X, false)]);
julia> P, Q = f(reshape(0:15, 4, 4)', ca.DM.eye(2));
julia> P
DM(
[[5, 9],
 [21, 25]])
julia> Q
DM(
[[10, 12],
 [18, 20]])

See also
kron

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

Definition at line 5213 of file mx.hpp.

◆ load_archiver()

CASADI_EXPORT void casadi::load_archiver ( const std::string &  name)

◆ load_blas()

CASADI_EXPORT void casadi::load_blas ( const std::string &  name)

◆ load_filesystem()

CASADI_EXPORT void casadi::load_filesystem ( const std::string &  name)

◆ load_graphmodel()

CASADI_EXPORT void casadi::load_graphmodel ( const std::string &  name)

◆ load_linsol()

CASADI_EXPORT void casadi::load_linsol ( const std::string &  name)

Normally plugins are loaded on first use; this raises an error when the plugin cannot be found.

>>> try:
...     load_linsol("no_such_plugin")
... except RuntimeError as e:
...     print("no_such_plugin" in str(e))
True

>> try, load_linsol('no_such_plugin'); catch e, msg = e.message; end
>> contains(msg, 'no_such_plugin')
1

julia> try
           ca.load_linsol("no_such_plugin")
       catch e
           println(occursin("no_such_plugin", sprint(showerror, e)))
       end
true

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

◆ load_modelicaparser()

CASADI_EXPORT void casadi::load_modelicaparser ( const std::string &  name)

◆ lookupvector() [1/2]

CASADI_EXPORT std::vector<casadi_int> casadi::lookupvector ( const std::vector< casadi_int > &  v)

◆ lookupvector() [2/2]

CASADI_EXPORT std::vector<casadi_int> casadi::lookupvector ( const std::vector< casadi_int > &  v,
casadi_int  size 
)

lookupvector[i]!=-1 <=> v contains i v[lookupvector[i]] == i <=> v contains i

Duplicates are treated by looking up last occurrence

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

◆ matrixName< SXElem >()

template<>
std::string casadi::matrixName< SXElem > ( )
inline

Definition at line 33 of file sx.hpp.

◆ message_prefix()

std::ostream& casadi::message_prefix ( std::ostream &  stream)
inline

Definition at line 119 of file exception.hpp.

◆ normalized_in()

int casadi::normalized_in ( std::istream &  stream,
double &  ret 
)
inline

Definition at line 473 of file casadi_misc.hpp.

◆ normalized_out()

void casadi::normalized_out ( std::ostream &  stream,
double  val 
)
inline

Definition at line 462 of file casadi_misc.hpp.

◆ normalized_setup() [1/2]

CASADI_EXPORT void casadi::normalized_setup ( std::istream &  stream)

◆ normalized_setup() [2/2]

CASADI_EXPORT void casadi::normalized_setup ( std::ostream &  stream)

◆ read_matlab() [1/2]

template<typename T >
void casadi::read_matlab ( std::ifstream &  file,
std::vector< std::vector< T > > &  v 
)

◆ read_matlab() [2/2]

template<typename T >
void casadi::read_matlab ( std::istream &  stream,
std::vector< T > &  v 
)

◆ simpleIntegrator()

CASADI_EXPORT Function casadi::simpleIntegrator ( Function  f,
const std::string &  integrator = "cvodes",
const Dict &  integrator_options = Dict() 
)

◆ simpleIRK()

CASADI_EXPORT Function casadi::simpleIRK ( Function  f,
casadi_int  N = 10,
casadi_int  order = 4,
const std::string &  scheme = "radau",
const std::string &  solver = "newton",
const Dict &  solver_options = Dict() 
)

The constructed function has three inputs, corresponding to initial state (x0), parameter (p) and integration time (h) and one output, corresponding to final state (xf).

Parameters
fODE function with two inputs (x and p) and one output (xdot)
NNumber of integrator steps
orderOrder of interpolating polynomials
schemeCollocation scheme, as excepted by collocationPoints function.
solverSolver plugin
solver_optionsOptions to be passed to the solver plugin

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

◆ simpleRK()

CASADI_EXPORT Function casadi::simpleRK ( Function  f,
casadi_int  N = 10,
casadi_int  order = 4 
)

The constructed function has three inputs, corresponding to initial state (x0), parameter (p) and integration time (h) and one output, corresponding to final state (xf).

Parameters
fODE function with two inputs (x and p) and one output (xdot)
NNumber of integrator steps
orderOrder of interpolating polynomials

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

◆ slicot_mb03vd()

int casadi::slicot_mb03vd ( int  n,
int  p,
int  ilo,
int  ihi,
double *  a,
int  lda1,
int  lda2,
double *  tau,
int  ldtau,
double *  dwork = nullptr 
)

◆ slicot_mb03vy()

int casadi::slicot_mb03vy ( int  n,
int  p,
int  ilo,
int  ihi,
double *  a,
int  lda1,
int  lda2,
const double *  tau,
int  ldtau,
double *  dwork = nullptr,
int  ldwork = 0 
)

◆ slicot_mb03wd()

int casadi::slicot_mb03wd ( char  job,
char  compz,
int  n,
int  p,
int  ilo,
int  ihi,
int  iloz,
int  ihiz,
double *  h,
int  ldh1,
int  ldh2,
double *  z,
int  ldz1,
int  ldz2,
double *  wr,
double *  wi,
double *  dwork = nullptr,
int  ldwork = 0 
)

◆ slicot_mb05nd()

int casadi::slicot_mb05nd ( int  n,
double  delta,
const double *  a,
int  lda,
double *  ex,
int  ldex,
double *  exint,
int  ldexin,
double  tol,
int *  iwork,
double *  dwork,
int  ldwork 
)

◆ temporary_file()

CASADI_EXPORT std::string casadi::temporary_file ( const std::string &  prefix,
const std::string &  suffix,
const std::string &  directory = "" 
)

◆ to_slice() [1/2]

Slice CASADI_EXPORT casadi::to_slice ( const IM &  x,
bool  ind1 = false 
)

◆ to_slice() [2/2]

Slice CASADI_EXPORT casadi::to_slice ( const std::vector< casadi_int > &  v,
bool  ind1 = false 
)

◆ to_slice2()

std::pair<Slice, Slice> CASADI_EXPORT casadi::to_slice2 ( const std::vector< casadi_int > &  v)

◆ trim_path()

std::string casadi::trim_path ( const std::string &  full_path)
inline

Definition at line 107 of file exception.hpp.

◆ uerr()

CASADI_EXPORT std::ostream& casadi::uerr ( )

◆ uout()

CASADI_EXPORT std::ostream& casadi::uout ( )

◆ write_matlab() [1/2]

template<typename T >
void casadi::write_matlab ( std::ostream &  stream,
const std::vector< std::vector< T > > &  v 
)

◆ write_matlab() [2/2]

template<typename T >
void casadi::write_matlab ( std::ostream &  stream,
const std::vector< T > &  v 
)