Helper class for C code generation. More...
#include <code_generator.hpp>
Extra doc: https://github.com/casadi/casadi/wiki/L_ru
Definition at line 43 of file code_generator.hpp.
Classes | |
struct | FunctionMeta |
Public Member Functions | |
CodeGenerator (const std::string &name, const Dict &opts=Dict()) | |
Constructor. More... | |
void | add (const Function &f, bool with_jac_sparsity=false) |
Add a function (name generated) More... | |
void | dump (std::ostream &s) |
Generate the code to a stream. More... | |
std::string | dump () |
Generate a file, return code as string. More... | |
std::string | generate (const std::string &prefix="") |
Generate file(s) More... | |
void | add_include (const std::string &new_include, bool relative_path=false, const std::string &use_ifdef=std::string()) |
Add an include file optionally using a relative path "..." instead of an absolute path <...> More... | |
std::string | add_dependency (const Function &f) |
Add a function dependency. More... | |
void | add_external (const std::string &new_external) |
Add an external function declaration. More... | |
std::string | shorthand (const std::string &name) const |
Get a shorthand. More... | |
std::string | shorthand (const std::string &name, bool allow_adding=true) |
Add/get a shorthand. More... | |
std::string | sparsity (const Sparsity &sp, bool canonical=true) |
casadi_int | add_sparsity (const Sparsity &sp, bool canonical=true) |
casadi_int | get_sparsity (const Sparsity &sp) const |
Get the index of an existing sparsity pattern. More... | |
casadi_int | get_constant (const std::vector< double > &v, bool allow_adding=false) |
Get or add a constant. More... | |
casadi_int | get_constant (const std::vector< casadi_int > &v, bool allow_adding=false) |
Get or add an integer constant. More... | |
casadi_int | get_constant (const std::vector< char > &v, bool allow_adding=false) |
Get or add a char constant. More... | |
casadi_int | get_constant (const std::vector< std::string > &v, bool allow_adding=false) |
Get or add a vector<string> constant. More... | |
std::string | constant (const std::vector< casadi_int > &v) |
Represent an array constant; adding it when new. More... | |
std::string | constant (const std::vector< int > &v) |
Represent an array constant; adding it when new. More... | |
void | constant_copy (const std::string &var_name, const std::vector< casadi_int > &v, const std::string &type="casadi_int") |
Represent an array constant; adding it when new. More... | |
std::string | constant (const std::vector< double > &v) |
Represent an array constant; adding it when new. More... | |
std::string | constant (const std::vector< char > &v) |
Represent an array constant; adding it when new. More... | |
std::string | constant (const std::vector< std::string > &v) |
Represent an array constant; adding it when new. More... | |
void | define_rom_double (const void *id, casadi_int size) |
Allocate file scope double read-only memory. More... | |
std::string | rom_double (const void *id) const |
Access file scope double read-only memory. More... | |
void | define_rom_integer (const void *id, casadi_int size) |
Allocate file scope integer read-only memory. More... | |
std::string | rom_integer (const void *id) const |
Access file scope integer read-only memory. More... | |
void | define_pool_double (const std::string &name, const std::vector< double > &def) |
Allocate file scope double writeable memory. More... | |
std::string | pool_double (const std::string &name) const |
Access file scope double writeable memory. More... | |
void | setup_callback (const std::string &s, const Function &f) |
Setup a callback. More... | |
std::string | operator() (const Function &f, const std::string &arg, const std::string &res, const std::string &iw, const std::string &w, const std::string &failure_ret="1") |
Generate a call to a function (generic signature) More... | |
CodeGenerator & | operator<< (const std::string &s) |
Print a string to buffer. More... | |
void | print_formatted (const std::string &s) |
Print without newline characters. More... | |
template<typename T > | |
CodeGenerator & | operator<< (T s) |
Print an arbitrary type to buffer. More... | |
void | flush (std::ostream &s) |
Flush the buffer to a stream of choice. More... | |
void | local (const std::string &name, const std::string &type, const std::string &ref="") |
Declare a local variable. More... | |
void | scope_enter () |
Enter a local scope. More... | |
void | scope_exit () |
Exit a local scope. More... | |
std::string | sx_work (casadi_int i) |
Declare a work vector element. More... | |
void | init_local (const std::string &name, const std::string &def) |
Specify the default value for a local variable. More... | |
void | indent () |
Increase indentation. More... | |
void | unindent () |
Decrease indentation. More... | |
bool | avoid_stack () const |
Avoid stack? More... | |
std::string | constant (double v) |
Print a constant in a lossless but compact manner. More... | |
std::string | constant (casadi_int v) |
std::string | constant (const std::string &v) |
std::string | constant (char v) |
std::string | format_padded (casadi_int i) const |
std::string | zeros (casadi_int sz) |
std::string | ones (casadi_int sz) |
template<typename T > | |
std::string | initializer (const std::vector< T > &v) |
Print an initializer. More... | |
std::string | sanitize_source (const std::string &src, const std::vector< std::string > &inst, bool add_shorthand=true) |
Sanitize source files for codegen. More... | |
std::string | dot (casadi_int n, const std::string &x, const std::string &y) |
Codegen inner product. More... | |
std::string | mv (const std::string &x, const Sparsity &sp_x, const std::string &y, const std::string &z, bool tr) |
Codegen sparse matrix-vector multiplication. More... | |
std::string | mv (const std::string &x, casadi_int nrow_x, casadi_int ncol_x, const std::string &y, const std::string &z, bool tr) |
Codegen dense matrix-vector multiplication. More... | |
std::string | axpy (casadi_int n, const std::string &a, const std::string &x, const std::string &y) |
Codegen axpy: y += a*x. More... | |
std::string | clip_min (const std::string &x, casadi_int n, const std::string &min, const std::string &mask) |
Codegen clip_min: Clips the smaller entries in a vector than min to the min. More... | |
std::string | clip_max (const std::string &x, casadi_int n, const std::string &min, const std::string &mask) |
Codegen clip_max: Clips the larger entries in a vector than max to the max. More... | |
std::string | vector_fmax (casadi_int n, const std::string &x, const std::string &y, const std::string &z) |
Codegen vector_fmax: Takes vectorwise max of a vector and writes the result to second vector. More... | |
std::string | vector_fmin (casadi_int n, const std::string &x, const std::string &y, const std::string &z) |
Codegen vector_fmin: Takes vectorwise min of a vector and writes the result to second vector. More... | |
std::string | masked_norm_inf (casadi_int n, const std::string &x, const std::string &mask) |
codegen masked_norm_inf: The mask tells what entry is used in the inf-norm. More... | |
std::string | scal (casadi_int n, const std::string &alpha, const std::string &x) |
What does scal do?? More... | |
std::string | mtimes (const std::string &x, const Sparsity &sp_x, const std::string &y, const Sparsity &sp_y, const std::string &z, const Sparsity &sp_z, const std::string &w, bool tr) |
Codegen sparse matrix-matrix multiplication. More... | |
std::string | trilsolve (const Sparsity &sp_x, const std::string &x, const std::string &y, bool tr, bool unity, casadi_int nrhs) |
Codegen lower triangular solve. More... | |
std::string | triusolve (const Sparsity &sp_x, const std::string &x, const std::string &y, bool tr, bool unity, casadi_int nrhs) |
Codegen upper triangular solve. More... | |
std::string | bilin (const std::string &A, const Sparsity &sp_A, const std::string &x, const std::string &y) |
Codegen bilinear form. More... | |
std::string | rank1 (const std::string &A, const Sparsity &sp_A, const std::string &alpha, const std::string &x, const std::string &y) |
Rank-1 update. More... | |
std::string | logsumexp (const std::string &A, casadi_int n) |
std::string | interpn (const std::string &res, casadi_int ndim, const std::string &grid, const std::string &offset, const std::string &values, const std::string &x, const std::string &lookup_mode, casadi_int m, const std::string &iw, const std::string &w) |
Multilinear interpolation. More... | |
std::string | interpn_grad (const std::string &grad, casadi_int ndim, const std::string &grid, const std::string &offset, const std::string &values, const std::string &x, const std::string &lookup_mode, casadi_int m, const std::string &iw, const std::string &w) |
Multilinear interpolation - calculate gradient. More... | |
std::string | trans (const std::string &x, const Sparsity &sp_x, const std::string &y, const Sparsity &sp_y, const std::string &iw) |
Transpose. More... | |
std::string | qr (const std::string &sp, const std::string &A, const std::string &w, const std::string &sp_v, const std::string &v, const std::string &sp_r, const std::string &r, const std::string &beta, const std::string &prinv, const std::string &pc) |
QR factorization. More... | |
std::string | qr_solve (const std::string &x, casadi_int nrhs, bool tr, const std::string &sp_v, const std::string &v, const std::string &sp_r, const std::string &r, const std::string &beta, const std::string &prinv, const std::string &pc, const std::string &w) |
QR solve. More... | |
std::string | lsqr_solve (const std::string &A, const std::string &x, casadi_int nrhs, bool tr, const std::string &sp, const std::string &w) |
std::string | ldl (const std::string &sp_a, const std::string &a, const std::string &sp_lt, const std::string <, const std::string &d, const std::string &p, const std::string &w) |
LDL factorization. More... | |
std::string | ldl_solve (const std::string &x, casadi_int nrhs, const std::string &sp_lt, const std::string <, const std::string &d, const std::string &p, const std::string &w) |
LDL solve. More... | |
std::string | fmax (const std::string &x, const std::string &y) |
fmax More... | |
std::string | fmin (const std::string &x, const std::string &y) |
fmin More... | |
std::string | mmax (const std::string &x, casadi_int n, bool is_dense) |
mmax More... | |
std::string | mmin (const std::string &x, casadi_int n, bool is_dense) |
mmin More... | |
std::string | vfmax (const std::string &x, casadi_int n, const std::string &y) |
vfmax More... | |
std::string | vfmin (const std::string &x, casadi_int n, const std::string &y) |
vfmin More... | |
std::string | vfmax (const std::string &x, const std::string &n, const std::string &y) |
vfmax More... | |
std::string | vfmin (const std::string &x, const std::string &n, const std::string &y) |
vfmin More... | |
std::string | max (const std::string &x, const std::string &y) |
max More... | |
std::string | min (const std::string &x, const std::string &y) |
min More... | |
std::string | norm_inf (casadi_int n, const std::string &x) |
norm_inf More... | |
std::string | norm_1 (casadi_int n, const std::string &x) |
norm_1 More... | |
std::string | norm_2 (casadi_int n, const std::string &x) |
norm_2 More... | |
std::string | max_viol (casadi_int n, const std::string &x, const std::string &lb, const std::string &ub) |
max_viol More... | |
std::string | sum_viol (casadi_int n, const std::string &x, const std::string &lb, const std::string &ub) |
sum_viol More... | |
std::string | bound_consistency (casadi_int n, const std::string &x, const std::string &lam, const std::string &lbx, const std::string &ubx) |
bound_consistency More... | |
std::string | lb_eig (const Sparsity &sp_h, const std::string &h) |
lb_eig More... | |
std::string | regularize (const Sparsity &sp_h, const std::string &h, const std::string ®) |
regularize More... | |
std::string | convexify_eval (const ConvexifyData &d, const std::string &Hin, const std::string &Hout, const std::string &iw, const std::string &w) |
convexify More... | |
std::string | low (const std::string &x, const std::string &grid, casadi_int ng, casadi_int lookup_mode) |
low More... | |
std::string | declare (std::string s) |
Declare a function. More... | |
void | comment (const std::string &s) |
Write a comment line (ignored if not verbose) More... | |
void | add_auxiliary (Auxiliary f, const std::vector< std::string > &inst={"casadi_real"}) |
Add a built-in auxiliary function. More... | |
void | add_io_sparsities (const std::string &name, const std::vector< Sparsity > &sp_in, const std::vector< Sparsity > &sp_out) |
Add io sparsity patterns of a function. More... | |
std::string | work (casadi_int n, casadi_int sz, bool is_ref) const |
std::string | workel (casadi_int n) const |
void | reserve_work (casadi_int n) |
Reserve a maximum size of work elements, used for padding of index. More... | |
void | print_vector (std::ostream &s, const std::string &name, const std::vector< casadi_int > &v) |
Print casadi_int vector to a c file. More... | |
void | print_vector (std::ostream &s, const std::string &name, const std::vector< char > &v) |
Print char vector to a c file. More... | |
void | print_vector (std::ostream &s, const std::string &name, const std::vector< double > &v) |
Print real vector to a c file. More... | |
void | print_vector (std::ostream &s, const std::string &name, const std::vector< std::string > &v) |
Print string vector to a c file. More... | |
std::string | copy (const std::string &arg, std::size_t n, const std::string &res) |
Create a copy operation. More... | |
void | copy_check (const std::string &arg, std::size_t n, const std::string &res, bool check_lhs=true, bool check_rhs=true) |
void | copy_default (const std::string &arg, std::size_t n, const std::string &res, const std::string &def, bool check_rhs=true) |
bool | elide_copy (casadi_int sz) |
std::string | fill (const std::string &res, std::size_t n, const std::string &v) |
Create a fill operation. More... | |
std::string | clear (const std::string &res, std::size_t n) |
Create a fill operation. More... | |
std::string | arg (casadi_int i) const |
Refer to argument. More... | |
std::string | res (casadi_int i) const |
Refer to resuly. More... | |
std::string | mem (const Function &f) |
Access thread-local memory. More... | |
std::string | project (const std::string &arg, const Sparsity &sp_arg, const std::string &res, const Sparsity &sp_res, const std::string &w) |
Sparse assignment. More... | |
std::string | tri_project (const std::string &arg, const Sparsity &sp_arg, const std::string &res, bool lower) |
Project triangular part. More... | |
std::string | densify (const std::string &arg, const Sparsity &sp_arg, const std::string &res, bool tr=false) |
Densify. More... | |
std::string | sparsify (const std::string &arg, const std::string &res, const Sparsity &sp_res, bool tr=false) |
Sparsify. More... | |
std::string | to_mex (const Sparsity &sp, const std::string &arg) |
Create matrix in MATLAB's MEX format. More... | |
std::string | from_mex (std::string &arg, const std::string &res, std::size_t res_off, const Sparsity &sp_res, const std::string &w) |
Get matrix from MATLAB's MEX format. More... | |
std::string | printf (const std::string &str, const std::vector< std::string > &arg=std::vector< std::string >()) |
Printf. More... | |
std::string | printf (const std::string &str, const std::string &arg1) |
std::string | printf (const std::string &str, const std::string &arg1, const std::string &arg2) |
std::string | printf (const std::string &str, const std::string &arg1, const std::string &arg2, const std::string &arg3) |
std::string | print_op (casadi_int op, const std::string &a0) |
Print an operation to a c file. More... | |
std::string | print_op (casadi_int op, const std::string &a0, const std::string &a1) |
std::string | file_slurp (const std::string &fname, casadi_int n, const std::string &a) |
Slurp a file. More... | |
std::string | cache_check (const std::string &key, const std::string &cache, const std::string &loc, casadi_int stride, casadi_int sz, casadi_int key_sz, const std::string &val) |
cache check More... | |
void | sz_work (size_t &sz_arg, size_t &sz_res, size_t &sz_iw, size_t &sz_w) const |
Get number of temporary variables needed for all functions. More... | |
std::string | wrapper (const Function &base, const std::string &name) |
Static Public Member Functions | |
static std::string | array (const std::string &type, const std::string &name, casadi_int len, const std::string &def=std::string()) |
static std::string | fmu_helpers (const std::string &modelname) |
FMU helper functions. More... | |
static std::string | casadi_version () |
Current CasADi version as string. More... | |
static void | file_open (std::ofstream &f, const std::string &name, bool cpp) |
Print file header. More... | |
static void | file_close (std::ofstream &f, bool cpp) |
Print file header. More... | |
static size_t | hash (const std::vector< double > &v) |
static size_t | hash (const std::vector< casadi_int > &v) |
static size_t | hash (const std::vector< char > &v) |
static size_t | hash (const std::vector< std::string > &v) |
template<typename T > | |
static bool | equal (const std::vector< T > &v1, const std::vector< T > &v2) |
Public Attributes | |
std::string | name |
std::string | suffix |
std::string | casadi_real_type |
std::string | casadi_int_type |
bool | with_mem |
bool | with_header |
bool | mex |
bool | with_sfunction |
std::vector< std::string > | added_sfunctions |
bool | unroll_args |
bool | verbose |
bool | verbose_runtime |
bool | cpp |
bool | main |
bool | include_math |
bool | avoid_stack_ |
std::string | infinity |
std::string | nan |
std::string | real_min |
bool | codegen_scalars |
Codegen scalar. More... | |
bool | with_export |
bool | with_import |
casadi_int | max_declarations_per_line |
casadi_int | max_initializer_elements_per_line |
bool | force_canonical |
std::string | dll_export |
std::string | dll_import |
std::string | prefix |
std::stringstream | includes |
std::stringstream | auxiliaries |
std::stringstream | body |
std::stringstream | header |
std::stringstream | buffer |
bool | newline_ |
casadi_int | indent_ |
casadi_int | current_indent_ |
casadi_int | sz_zeros_ |
casadi_int | sz_ones_ |
casadi_int | padding_length_ |
std::vector< std::string > | exposed_fname |
std::set< std::string > | sparsity_meta |
std::set< std::string > | added_includes_ |
std::set< std::string > | added_externals_ |
std::set< std::string > | added_shorthands_ |
std::multimap< Auxiliary, std::vector< std::string > > | added_auxiliaries_ |
std::multimap< size_t, size_t > | added_double_constants_ |
std::multimap< size_t, size_t > | added_integer_constants_ |
std::multimap< size_t, size_t > | added_char_constants_ |
std::multimap< size_t, size_t > | added_string_constants_ |
std::map< std::string, std::pair< std::string, std::string > > | local_variables_ |
std::map< std::string, std::string > | local_default_ |
std::map< const void *, casadi_int > | file_scope_double_ |
std::map< const void *, casadi_int > | file_scope_integer_ |
std::vector< std::vector< double > > | pool_double_defaults_ |
std::map< std::string, casadi_int > | pool_double_ |
std::vector< FunctionMeta > | added_functions_ |
std::map< std::string, std::map< FunctionInternal *, casadi_int > > | added_wrappers_ |
std::vector< std::vector< double > > | double_constants_ |
std::vector< std::vector< casadi_int > > | integer_constants_ |
std::vector< std::vector< char > > | char_constants_ |
std::vector< std::vector< std::string > > | string_constants_ |
bool | needs_mem_ |
Extra doc: https://github.com/casadi/casadi/wiki/L_to
Definition at line 598 of file code_generator.hpp.
Definition at line 37 of file code_generator.cpp.
References add_auxiliary(), add_include(), AUX_PRINTF, avoid_stack_, casadi_int_type, casadi_real_type, casadi::Function::check_name(), codegen_scalars, cpp, current_indent_, dll_export, dll_import, force_canonical, header, include_math, indent_, infinity, main, max_declarations_per_line, max_initializer_elements_per_line, mex, name, nan, needs_mem_, newline_, prefix, real_min, casadi::str(), suffix, sz_ones_, sz_zeros_, unroll_args, verbose, verbose_runtime, with_export, with_header, with_import, with_mem, and with_sfunction.
void casadi::CodeGenerator::add | ( | const Function & | f, |
bool | with_jac_sparsity = false |
||
) |
Definition at line 331 of file code_generator.cpp.
References add_dependency(), add_io_sparsities(), added_sfunctions, body, casadi::FunctionInternal::codegen_meta(), declare(), exposed_fname, flush(), casadi::Function::jac_sparsity(), casadi::Function::n_in(), casadi::Function::n_out(), casadi::Function::name(), casadi::Function::name_in(), casadi::Function::name_out(), casadi::FunctionInternal::signature(), casadi::FunctionInternal::signature_unrolled(), casadi::FunctionInternal::sparsity_in_, unroll_args, and with_sfunction.
Referenced by casadi::DaeBuilderInternal::export_fmu(), casadi::FunctionInternal::finalize(), casadi::Function::generate(), casadi::OracleFunction::generate_dependencies(), and casadi::Scpgen::init().
void casadi::CodeGenerator::add_auxiliary | ( | Auxiliary | f, |
const std::vector< std::string > & | inst = {"casadi_real"} |
||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tp
Definition at line 1355 of file code_generator.cpp.
References add_include(), added_auxiliaries_, AUX_AXPY, AUX_BFGS, AUX_BILIN, AUX_BLAZING_1D_BOOR_EVAL, AUX_BLAZING_2D_BOOR_EVAL, AUX_BLAZING_3D_BOOR_EVAL, AUX_BLAZING_DE_BOOR, AUX_BOUNDS_CONSISTENCY, AUX_CACHE, AUX_CAST, AUX_CLEAR, AUX_CLIP_MAX, AUX_CLIP_MIN, AUX_CONVEXIFY, AUX_COPY, AUX_CVX, AUX_DE_BOOR, AUX_DENSIFY, AUX_DOT, AUX_EXPM1, AUX_FABS, AUX_FEASIBLESQPMETHOD, AUX_FILE_SLURP, AUX_FILL, AUX_FINITE_DIFF, AUX_FLIP, AUX_FMAX, AUX_FMIN, AUX_FROM_MEX, AUX_HYPOT, AUX_IAMAX, AUX_IF_ELSE, AUX_INF, AUX_INTERPN, AUX_INTERPN_GRAD, AUX_INTERPN_INTERPOLATE, AUX_INTERPN_WEIGHTS, AUX_ISINF, AUX_LDL, AUX_LOG1P, AUX_LOGSUMEXP, AUX_LOW, AUX_LSQR, AUX_MASKED_NORM_INF, AUX_MAX, AUX_MAX_VIOL, AUX_MIN, AUX_MMAX, AUX_MMIN, AUX_MTIMES, AUX_MV, AUX_MV_DENSE, AUX_NAN, AUX_ND_BOOR_EVAL, AUX_NEWTON, AUX_NLP, AUX_NORM_1, AUX_NORM_2, AUX_NORM_INF, AUX_OCP_BLOCK, AUX_ORACLE, AUX_ORACLE_CALLBACK, AUX_PRINTF, AUX_PRINTME, AUX_PROJECT, AUX_QP, AUX_QR, AUX_QRQP, AUX_RANK1, AUX_REAL_MIN, AUX_REGULARIZE, AUX_SCAL, AUX_SCALED_COPY, AUX_SIGN, AUX_SPARSIFY, AUX_SPARSITY, AUX_SQ, AUX_SQPMETHOD, AUX_SUM, AUX_SUM_VIOL, AUX_SWAP, AUX_TO_DOUBLE, AUX_TO_INT, AUX_TO_MEX, AUX_TRANS, AUX_TRI_PROJECT, AUX_TRILSOLVE, AUX_TRIUSOLVE, AUX_VECTOR_FMAX, AUX_VECTOR_FMIN, AUX_VFMAX, AUX_VFMIN, auxiliaries, cpp, infinity, mex, nan, real_min, sanitize_source(), and shorthand().
Referenced by axpy(), bilin(), bound_consistency(), cache_check(), clear(), clip_max(), clip_min(), casadi::BlazingSplineFunction::codegen_body(), casadi::MapSum::codegen_body(), casadi::Switch::codegen_body(), casadi::ClarabelInterface::codegen_body(), casadi::DaqpInterface::codegen_body(), casadi::HighsInterface::codegen_body(), casadi::HpipmInterface::codegen_body(), casadi::OsqpInterface::codegen_body(), casadi::FastNewton::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::Qrqp::codegen_body(), casadi::Sqpmethod::codegen_body(), casadi::FiniteDiff::codegen_declarations(), casadi::Nlpsol::codegen_declarations(), casadi::FatropInterface::codegen_declarations(), casadi::IpoptInterface::codegen_declarations(), casadi::MadnlpInterface::codegen_declarations(), casadi::Sqpmethod::codegen_declarations(), CodeGenerator(), constant(), convexify_eval(), copy(), densify(), dot(), dump(), file_slurp(), fill(), fmax(), fmin(), from_mex(), casadi::BSplineCommon::generate(), casadi::HorzRepsum::generate(), interpn(), interpn_grad(), lb_eig(), ldl(), ldl_solve(), logsumexp(), low(), lsqr_solve(), masked_norm_inf(), max(), max_viol(), min(), mmax(), mmin(), mtimes(), mv(), norm_1(), norm_2(), norm_inf(), print_op(), printf(), project(), casadi::Conic::qp_codegen_body(), qr(), qr_solve(), rank1(), regularize(), scal(), sparsify(), sum_viol(), to_mex(), trans(), tri_project(), trilsolve(), triusolve(), vector_fmax(), vector_fmin(), vfmax(), and vfmin().
std::string casadi::CodeGenerator::add_dependency | ( | const Function & | f | ) |
Definition at line 250 of file code_generator.cpp.
References added_functions_, body, casadi::FunctionInternal::codegen(), casadi::FunctionInternal::codegen_alloc_mem(), casadi::FunctionInternal::codegen_checkout(), casadi::FunctionInternal::codegen_declarations(), casadi::FunctionInternal::codegen_decref(), casadi::FunctionInternal::codegen_free_mem(), casadi::FunctionInternal::codegen_incref(), casadi::FunctionInternal::codegen_init_mem(), casadi::FunctionInternal::codegen_mem_type(), casadi::FunctionInternal::codegen_release(), flush(), casadi::FunctionInternal::has_refcount_, needs_mem_, scope_enter(), scope_exit(), shorthand(), and casadi::str().
Referenced by add(), casadi::Call::add_dependency(), casadi::FiniteDiff::codegen_declarations(), casadi::Map::codegen_declarations(), casadi::MapSum::codegen_declarations(), casadi::Nlpsol::codegen_declarations(), casadi::Switch::codegen_declarations(), casadi::SXFunction::codegen_declarations(), casadi::FatropInterface::codegen_declarations(), casadi::IpoptInterface::codegen_declarations(), casadi::MadnlpInterface::codegen_declarations(), casadi::FastNewton::codegen_declarations(), casadi::Feasiblesqpmethod::codegen_declarations(), casadi::Sqpmethod::codegen_declarations(), operator()(), and setup_callback().
void casadi::CodeGenerator::add_external | ( | const std::string & | new_external | ) |
Definition at line 1161 of file code_generator.cpp.
References added_externals_.
Referenced by casadi::External::codegen_declarations().
void casadi::CodeGenerator::add_include | ( | const std::string & | new_include, |
bool | relative_path = false , |
||
const std::string & | use_ifdef = std::string() |
||
) |
Definition at line 1100 of file code_generator.cpp.
References added_includes_, and includes.
Referenced by add_auxiliary(), casadi::ConstantPool::add_dependency(), casadi::BlazingSplineFunction::codegen_body(), casadi::ClarabelInterface::codegen_body(), casadi::DaqpInterface::codegen_body(), casadi::HighsInterface::codegen_body(), casadi::HpipmInterface::codegen_body(), casadi::OsqpInterface::codegen_body(), casadi::FatropInterface::codegen_declarations(), casadi::IpoptInterface::codegen_declarations(), casadi::MadnlpInterface::codegen_declarations(), and CodeGenerator().
void casadi::CodeGenerator::add_io_sparsities | ( | const std::string & | name, |
const std::vector< Sparsity > & | sp_in, | ||
const std::vector< Sparsity > & | sp_out | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tq
Definition at line 2416 of file code_generator.cpp.
References declare(), force_canonical, name, sparsity(), and sparsity_meta.
Referenced by add(), and casadi::FunctionInternal::codegen_sparsities().
casadi_int casadi::CodeGenerator::add_sparsity | ( | const Sparsity & | sp, |
bool | canonical = true |
||
) |
Definition at line 1178 of file code_generator.cpp.
References casadi::Sparsity::compress(), and get_constant().
Referenced by sparsity().
std::string casadi::CodeGenerator::arg | ( | casadi_int | i | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_tw
Definition at line 1967 of file code_generator.cpp.
References casadi::str().
Referenced by casadi::FiniteDiff::codegen_body(), casadi::OmpMap::codegen_body(), casadi::SXFunction::codegen_body(), casadi::OsqpInterface::codegen_body(), casadi::FastNewton::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::LinearInterpolant::codegen_body(), casadi::LinearInterpolantJac::codegen_body(), casadi::Qrqp::codegen_body(), copy(), copy_check(), copy_default(), densify(), from_mex(), casadi::Input::generate(), operator()(), printf(), project(), sparsify(), to_mex(), and tri_project().
|
static |
Declare an array
Definition at line 1026 of file code_generator.cpp.
References name.
Referenced by casadi::FunctionInternal::codegen_meta(), and print_vector().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_si
Definition at line 264 of file code_generator.hpp.
Referenced by casadi::SXFunction::codegen_body(), and casadi::SXFunction::codegen_sz_w().
std::string casadi::CodeGenerator::axpy | ( | casadi_int | n, |
const std::string & | a, | ||
const std::string & | x, | ||
const std::string & | y | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sp
Definition at line 2143 of file code_generator.cpp.
References add_auxiliary(), AUX_AXPY, and casadi::str().
Referenced by casadi::FiniteDiff::codegen_body(), casadi::MapSum::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::Sqpmethod::codegen_body(), and casadi::Feasiblesqpmethod::codegen_feasibility_iterations().
std::string casadi::CodeGenerator::bilin | ( | const std::string & | A, |
const Sparsity & | sp_A, | ||
const std::string & | x, | ||
const std::string & | y | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_su
Definition at line 1999 of file code_generator.cpp.
References add_auxiliary(), AUX_BILIN, and sparsity().
Referenced by casadi::Feasiblesqpmethod::codegen_eval_m_k(), and casadi::Bilin::generate().
std::string casadi::CodeGenerator::bound_consistency | ( | casadi_int | n, |
const std::string & | x, | ||
const std::string & | lam, | ||
const std::string & | lbx, | ||
const std::string & | ubx | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_th
Definition at line 2606 of file code_generator.cpp.
References add_auxiliary(), AUX_BOUNDS_CONSISTENCY, and casadi::str().
Referenced by casadi::Feasiblesqpmethod::codegen_body(), and casadi::Nlpsol::codegen_body_exit().
std::string casadi::CodeGenerator::cache_check | ( | const std::string & | key, |
const std::string & | cache, | ||
const std::string & | loc, | ||
casadi_int | stride, | ||
casadi_int | sz, | ||
casadi_int | key_sz, | ||
const std::string & | val | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_u8
Definition at line 2620 of file code_generator.cpp.
References add_auxiliary(), AUX_CACHE, and casadi::str().
Referenced by casadi::LinsolQr::generate().
|
static |
std::string casadi::CodeGenerator::clear | ( | const std::string & | res, |
std::size_t | n | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tv
Definition at line 1959 of file code_generator.cpp.
References add_auxiliary(), AUX_CLEAR, and res().
Referenced by casadi::Feasiblesqpmethod::codegen_body(), casadi::Sqpmethod::codegen_body(), casadi::OsqpInterface::codegen_init_mem(), casadi::Sqpmethod::codegen_solve_elastic_mode(), fill(), casadi::BSplineCommon::generate(), casadi::Constant< Value >::generate(), and casadi::HorzRepsum::generate().
std::string casadi::CodeGenerator::clip_max | ( | const std::string & | x, |
casadi_int | n, | ||
const std::string & | min, | ||
const std::string & | mask | ||
) |
Definition at line 2155 of file code_generator.cpp.
References add_auxiliary(), AUX_CLIP_MAX, min(), and casadi::str().
Referenced by casadi::Feasiblesqpmethod::codegen_body(), and casadi::Feasiblesqpmethod::codegen_feasibility_iterations().
std::string casadi::CodeGenerator::clip_min | ( | const std::string & | x, |
casadi_int | n, | ||
const std::string & | min, | ||
const std::string & | mask | ||
) |
Definition at line 2149 of file code_generator.cpp.
References add_auxiliary(), AUX_CLIP_MIN, min(), and casadi::str().
Referenced by casadi::Feasiblesqpmethod::codegen_body(), and casadi::Feasiblesqpmethod::codegen_feasibility_iterations().
void casadi::CodeGenerator::comment | ( | const std::string & | s | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tn
Definition at line 2410 of file code_generator.cpp.
References verbose.
Referenced by casadi::FiniteDiff::codegen_body(), casadi::OsqpInterface::codegen_body(), casadi::FastNewton::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::Qrqp::codegen_body(), casadi::Sqpmethod::codegen_body(), casadi::Feasiblesqpmethod::codegen_feasibility_iterations(), casadi::Sqpmethod::codegen_solve_elastic_mode(), casadi::Feasiblesqpmethod::codegen_tr_update(), casadi::LinsolLdl::generate(), casadi::LinsolQr::generate(), and casadi::Lsqr::generate().
std::string casadi::CodeGenerator::constant | ( | casadi_int | v | ) |
Definition at line 1894 of file code_generator.cpp.
References casadi::str().
std::string casadi::CodeGenerator::constant | ( | char | v | ) |
Definition at line 1898 of file code_generator.cpp.
References constant().
std::string casadi::CodeGenerator::constant | ( | const std::string & | v | ) |
Definition at line 1887 of file code_generator.cpp.
References casadi::replace().
std::string casadi::CodeGenerator::constant | ( | const std::vector< casadi_int > & | v | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_rz
Definition at line 1313 of file code_generator.cpp.
References get_constant(), shorthand(), and casadi::str().
Referenced by casadi::BlazingSplineFunction::codegen_body(), casadi::SXFunction::codegen_body(), casadi::HighsInterface::codegen_body(), casadi::OsqpInterface::codegen_body(), casadi::FastNewton::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::LinearInterpolant::codegen_body(), casadi::LinearInterpolantJac::codegen_body(), casadi::Qrqp::codegen_body(), casadi::Nlpsol::codegen_body_enter(), casadi::External::codegen_incref(), casadi::FunctionInternal::codegen_meta(), casadi::Sqpmethod::codegen_solve_elastic_mode(), casadi::codegen_unpack_block(), constant(), constant_copy(), casadi::Convexify::generate(), casadi::LinsolLdl::generate(), casadi::LinsolQr::generate(), casadi::BSpline::generate(), casadi::BSplineCommon::generate(), casadi::ConstantDM::generate(), casadi::Constant< Value >::generate(), casadi::GetNonzerosVector::generate(), casadi::GetNonzerosParamVector::generate(), casadi::GetNonzerosSliceParam::generate(), casadi::GetNonzerosParamSlice::generate(), casadi::GetNonzerosParamParam::generate(), casadi::SetNonzerosVector< Add >::generate(), and casadi::FatropInterface::set_fatrop_prob().
std::string casadi::CodeGenerator::constant | ( | const std::vector< char > & | v | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_27m
Definition at line 1317 of file code_generator.cpp.
References get_constant(), shorthand(), and casadi::str().
std::string casadi::CodeGenerator::constant | ( | const std::vector< double > & | v | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_s1
Definition at line 1351 of file code_generator.cpp.
References get_constant(), shorthand(), and casadi::str().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_255
Definition at line 132 of file code_generator.hpp.
std::string casadi::CodeGenerator::constant | ( | const std::vector< std::string > & | v | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_280
Definition at line 1321 of file code_generator.cpp.
References get_constant(), shorthand(), and casadi::str().
std::string casadi::CodeGenerator::constant | ( | double | v | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sj
Definition at line 1901 of file code_generator.cpp.
References add_auxiliary(), AUX_INF, and AUX_NAN.
void casadi::CodeGenerator::constant_copy | ( | const std::string & | var_name, |
const std::vector< casadi_int > & | v, | ||
const std::string & | type = "casadi_int" |
||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_s0
Definition at line 1335 of file code_generator.cpp.
References constant(), init_local(), local(), name, and casadi::str().
Referenced by casadi::OsqpInterface::codegen_init_mem().
std::string casadi::CodeGenerator::convexify_eval | ( | const ConvexifyData & | d, |
const std::string & | Hin, | ||
const std::string & | Hout, | ||
const std::string & | iw, | ||
const std::string & | w | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tk
Definition at line 2593 of file code_generator.cpp.
References add_auxiliary(), AUX_CONVEXIFY, and casadi::Convexify::generate().
Referenced by casadi::Sqpmethod::codegen_body(), and casadi::Convexify::generate().
std::string casadi::CodeGenerator::copy | ( | const std::string & | arg, |
std::size_t | n, | ||
const std::string & | res | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tt
Definition at line 1925 of file code_generator.cpp.
References add_auxiliary(), arg(), AUX_COPY, and res().
Referenced by casadi::FiniteDiff::codegen_body(), casadi::JitFunction::codegen_body(), casadi::FastNewton::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::Sqpmethod::codegen_body(), casadi::Nlpsol::codegen_body_exit(), casadi::Feasiblesqpmethod::codegen_feasibility_iterations(), casadi::Sqpmethod::codegen_solve_elastic_mode(), casadi::Feasiblesqpmethod::codegen_step_update(), copy_check(), copy_default(), casadi::LinsolQr::generate(), casadi::ConstantDM::generate(), casadi::ConstantFile::generate(), casadi::ConstantPool::generate(), casadi::Einstein::generate(), casadi::Input::generate(), casadi::Output::generate(), casadi::Multiplication::generate(), casadi::DenseMultiplication::generate(), casadi::Rank1::generate(), casadi::HorzRepmat::generate(), casadi::SetNonzerosVector< Add >::generate(), casadi::SetNonzerosSlice< Add >::generate(), casadi::SetNonzerosSlice2< Add >::generate(), casadi::SetNonzerosParam< Add >::generate(), casadi::LinsolCall< Tr >::generate(), casadi::TriuSolve< Tr >::generate(), casadi::TrilSolve< Tr >::generate(), casadi::TriuSolveUnity< Tr >::generate(), casadi::TrilSolveUnity< Tr >::generate(), casadi::Split::generate(), casadi::MXNode::generate_copy(), and project().
void casadi::CodeGenerator::copy_check | ( | const std::string & | arg, |
std::size_t | n, | ||
const std::string & | res, | ||
bool | check_lhs = true , |
||
bool | check_rhs = true |
||
) |
Definition at line 1939 of file code_generator.cpp.
References arg(), copy(), casadi::join(), and res().
Referenced by casadi::OsqpInterface::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::Qrqp::codegen_body(), and casadi::Nlpsol::codegen_body_exit().
void casadi::CodeGenerator::copy_default | ( | const std::string & | arg, |
std::size_t | n, | ||
const std::string & | res, | ||
const std::string & | def, | ||
bool | check_rhs = true |
||
) |
Definition at line 1948 of file code_generator.cpp.
References arg(), copy(), fill(), and res().
Referenced by casadi::OsqpInterface::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::Qrqp::codegen_body(), and casadi::Nlpsol::codegen_body_enter().
std::string casadi::CodeGenerator::declare | ( | std::string | s | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tm
Definition at line 2050 of file code_generator.cpp.
References cpp, dll_import, header, and with_header.
Referenced by add(), add_io_sparsities(), and casadi::FunctionInternal::codegen_meta().
void casadi::CodeGenerator::define_pool_double | ( | const std::string & | name, |
const std::vector< double > & | def | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2aw
Definition at line 824 of file code_generator.cpp.
References name, pool_double_, pool_double_defaults_, shorthand(), and casadi::str().
Referenced by casadi::ConstantPool::add_dependency().
void casadi::CodeGenerator::define_rom_double | ( | const void * | id, |
casadi_int | size | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_s2
Definition at line 796 of file code_generator.cpp.
References file_scope_double_, shorthand(), and casadi::str().
Referenced by casadi::ConstantFile::add_dependency().
void casadi::CodeGenerator::define_rom_integer | ( | const void * | id, |
casadi_int | size | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_s4
Definition at line 810 of file code_generator.cpp.
References file_scope_double_, shorthand(), and casadi::str().
std::string casadi::CodeGenerator::densify | ( | const std::string & | arg, |
const Sparsity & | sp_arg, | ||
const std::string & | res, | ||
bool | tr = false |
||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_u1
Definition at line 2090 of file code_generator.cpp.
References add_auxiliary(), arg(), AUX_DENSIFY, res(), and sparsity().
Referenced by casadi::Densify::generate().
std::string casadi::CodeGenerator::dot | ( | casadi_int | n, |
const std::string & | x, | ||
const std::string & | y | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sm
Definition at line 1991 of file code_generator.cpp.
References add_auxiliary(), and AUX_DOT.
Referenced by casadi::Sqpmethod::codegen_body(), casadi::Feasiblesqpmethod::codegen_eval_m_k(), and casadi::Dot::generate().
std::string casadi::CodeGenerator::dump | ( | ) |
Definition at line 376 of file code_generator.cpp.
Referenced by generate().
void casadi::CodeGenerator::dump | ( | std::ostream & | s | ) |
Definition at line 842 of file code_generator.cpp.
References add_auxiliary(), added_externals_, added_shorthands_, AUX_INF, AUX_NAN, auxiliaries, body, char_constants_, current_indent_, double_constants_, file_scope_double_, file_scope_integer_, includes, initializer(), integer_constants_, needs_mem_, pool_double_, pool_double_defaults_, prefix, print_vector(), casadi::str(), string_constants_, sz_ones_, sz_zeros_, with_export, and with_mem.
bool casadi::CodeGenerator::elide_copy | ( | casadi_int | sz | ) |
Definition at line 1934 of file code_generator.cpp.
References casadi::GlobalOptions::copy_elision_min_size.
Referenced by casadi::ConstantDM::generate(), casadi::ConstantFile::generate(), casadi::ConstantPool::generate(), and casadi::Input::generate().
|
inlinestatic |
|
static |
Definition at line 410 of file code_generator.cpp.
References cpp.
Referenced by generate(), and casadi::DaeBuilderInternal::generate_wrapper().
|
static |
Definition at line 389 of file code_generator.cpp.
References casadi_version(), cpp, name, and casadi::Filesystem::open().
Referenced by generate(), and casadi::DaeBuilderInternal::generate_wrapper().
std::string casadi::CodeGenerator::file_slurp | ( | const std::string & | fname, |
casadi_int | n, | ||
const std::string & | a | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_u7
Definition at line 2614 of file code_generator.cpp.
References add_auxiliary(), AUX_FILE_SLURP, and casadi::str().
Referenced by casadi::ConstantFile::codegen_incref().
std::string casadi::CodeGenerator::fill | ( | const std::string & | res, |
std::size_t | n, | ||
const std::string & | v | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tu
Definition at line 1981 of file code_generator.cpp.
References add_auxiliary(), AUX_FILL, clear(), and res().
Referenced by casadi::Qrqp::codegen_body(), casadi::Sqpmethod::codegen_body(), casadi::Sqpmethod::codegen_solve_elastic_mode(), copy_default(), and casadi::Constant< Value >::generate().
void casadi::CodeGenerator::flush | ( | std::ostream & | s | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sa
Definition at line 2276 of file code_generator.cpp.
References buffer.
Referenced by add(), add_dependency(), casadi::FunctionInternal::codegen(), casadi::FatropInterface::codegen_declarations(), casadi::IpoptInterface::codegen_declarations(), and casadi::FunctionInternal::codegen_meta().
std::string casadi::CodeGenerator::fmax | ( | const std::string & | x, |
const std::string & | y | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_t4
Definition at line 2491 of file code_generator.cpp.
References add_auxiliary(), and AUX_FMAX.
Referenced by casadi::Sqpmethod::codegen_body(), and casadi::Sqpmethod::codegen_calc_gamma_1().
std::string casadi::CodeGenerator::fmin | ( | const std::string & | x, |
const std::string & | y | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_t5
Definition at line 2497 of file code_generator.cpp.
References add_auxiliary(), and AUX_FMIN.
Referenced by casadi::Feasiblesqpmethod::codegen_tr_update().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_257
Definition at line 1871 of file code_generator.cpp.
References casadi::replace().
Referenced by casadi::DaeBuilderInternal::generate_wrapper().
std::string casadi::CodeGenerator::format_padded | ( | casadi_int | i | ) | const |
Definition at line 1019 of file code_generator.cpp.
References padding_length_.
Referenced by casadi::MXFunction::codegen_body(), sx_work(), work(), and workel().
std::string casadi::CodeGenerator::from_mex | ( | std::string & | arg, |
const std::string & | res, | ||
std::size_t | res_off, | ||
const Sparsity & | sp_res, | ||
const std::string & | w | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_u4
Definition at line 1858 of file code_generator.cpp.
References add_auxiliary(), arg(), AUX_FROM_MEX, res(), sparsity(), and casadi::str().
Referenced by casadi::FunctionInternal::codegen_meta().
std::string casadi::CodeGenerator::generate | ( | const std::string & | prefix = "" | ) |
The "prefix" argument will be prepended to the generated files and may be a directory or a file prefix. returns the filename
Extra doc: https://github.com/casadi/casadi/wiki/L_rv
Definition at line 468 of file code_generator.cpp.
References added_sfunctions, cpp, dump(), exposed_fname, file_close(), file_open(), header, main, mex, name, pool_double_, pool_double_defaults_, prefix, casadi::str(), suffix, with_header, with_import, and with_sfunction.
Referenced by casadi::DaeBuilderInternal::export_fmu(), casadi::FunctionInternal::finalize(), casadi::Function::generate(), casadi::OracleFunction::generate_dependencies(), and casadi::Scpgen::init().
casadi_int casadi::CodeGenerator::get_constant | ( | const std::vector< casadi_int > & | v, |
bool | allow_adding = false |
||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_ry
Definition at line 1244 of file code_generator.cpp.
References added_integer_constants_, equal(), hash(), and integer_constants_.
casadi_int casadi::CodeGenerator::get_constant | ( | const std::vector< char > & | v, |
bool | allow_adding = false |
||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_27l
Definition at line 1267 of file code_generator.cpp.
References added_char_constants_, char_constants_, equal(), and hash().
casadi_int casadi::CodeGenerator::get_constant | ( | const std::vector< double > & | v, |
bool | allow_adding = false |
||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_rx
Definition at line 1222 of file code_generator.cpp.
References added_double_constants_, double_constants_, equal(), and hash().
Referenced by add_sparsity(), constant(), and get_sparsity().
casadi_int casadi::CodeGenerator::get_constant | ( | const std::vector< std::string > & | v, |
bool | allow_adding = false |
||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_27z
Definition at line 1290 of file code_generator.cpp.
References added_string_constants_, equal(), hash(), and string_constants_.
casadi_int casadi::CodeGenerator::get_sparsity | ( | const Sparsity & | sp | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_rw
Definition at line 1186 of file code_generator.cpp.
References get_constant().
|
static |
Definition at line 1204 of file code_generator.cpp.
References casadi::hash_combine().
|
static |
Definition at line 1210 of file code_generator.cpp.
References casadi::hash_combine().
|
static |
Definition at line 1190 of file code_generator.cpp.
References casadi::hash_combine().
Referenced by get_constant().
|
static |
Definition at line 1216 of file code_generator.cpp.
References casadi::hash_combine().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_sg
Definition at line 254 of file code_generator.hpp.
Referenced by print_formatted().
void casadi::CodeGenerator::init_local | ( | const std::string & | name, |
const std::string & | def | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sf
Definition at line 2308 of file code_generator.cpp.
References local_default_, and name.
Referenced by casadi::FiniteDiff::codegen_body(), casadi::MXFunction::codegen_body(), casadi::ClarabelInterface::codegen_body(), casadi::DaqpInterface::codegen_body(), casadi::FatropInterface::codegen_body(), casadi::HighsInterface::codegen_body(), casadi::IpoptInterface::codegen_body(), casadi::MadnlpInterface::codegen_body(), casadi::OsqpInterface::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::Sqpmethod::codegen_body(), casadi::Nlpsol::codegen_body_exit(), casadi::Feasiblesqpmethod::codegen_feasibility_iterations(), casadi::codegen_local(), and constant_copy().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_sk
Definition at line 283 of file code_generator.hpp.
Referenced by dump(), and print_vector().
std::string casadi::CodeGenerator::interpn | ( | const std::string & | res, |
casadi_int | ndim, | ||
const std::string & | grid, | ||
const std::string & | offset, | ||
const std::string & | values, | ||
const std::string & | x, | ||
const std::string & | lookup_mode, | ||
casadi_int | m, | ||
const std::string & | iw, | ||
const std::string & | w | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sw
Definition at line 2017 of file code_generator.cpp.
References add_auxiliary(), AUX_INTERPN, and res().
Referenced by casadi::LinearInterpolant::codegen_body().
std::string casadi::CodeGenerator::interpn_grad | ( | const std::string & | grad, |
casadi_int | ndim, | ||
const std::string & | grid, | ||
const std::string & | offset, | ||
const std::string & | values, | ||
const std::string & | x, | ||
const std::string & | lookup_mode, | ||
casadi_int | m, | ||
const std::string & | iw, | ||
const std::string & | w | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sx
Definition at line 2030 of file code_generator.cpp.
References add_auxiliary(), and AUX_INTERPN_GRAD.
Referenced by casadi::LinearInterpolantJac::codegen_body().
std::string casadi::CodeGenerator::lb_eig | ( | const Sparsity & | sp_h, |
const std::string & | h | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_ti
Definition at line 2581 of file code_generator.cpp.
References add_auxiliary(), AUX_REGULARIZE, and sparsity().
std::string casadi::CodeGenerator::ldl | ( | const std::string & | sp_a, |
const std::string & | a, | ||
const std::string & | sp_lt, | ||
const std::string & | lt, | ||
const std::string & | d, | ||
const std::string & | p, | ||
const std::string & | w | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_t2
Definition at line 2473 of file code_generator.cpp.
References add_auxiliary(), and AUX_LDL.
Referenced by casadi::LinsolLdl::generate().
std::string casadi::CodeGenerator::ldl_solve | ( | const std::string & | x, |
casadi_int | nrhs, | ||
const std::string & | sp_lt, | ||
const std::string & | lt, | ||
const std::string & | d, | ||
const std::string & | p, | ||
const std::string & | w | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_t3
Definition at line 2482 of file code_generator.cpp.
References add_auxiliary(), AUX_LDL, and casadi::str().
Referenced by casadi::LinsolLdl::generate().
void casadi::CodeGenerator::local | ( | const std::string & | name, |
const std::string & | type, | ||
const std::string & | ref = "" |
||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sb
Definition at line 2281 of file code_generator.cpp.
References local_variables_, and name.
Referenced by casadi::FiniteDiff::codegen_body(), casadi::JitFunction::codegen_body(), casadi::Map::codegen_body(), casadi::MapSum::codegen_body(), casadi::MXFunction::codegen_body(), casadi::Switch::codegen_body(), casadi::ClarabelInterface::codegen_body(), casadi::DaqpInterface::codegen_body(), casadi::FatropInterface::codegen_body(), casadi::HighsInterface::codegen_body(), casadi::HpipmInterface::codegen_body(), casadi::IpoptInterface::codegen_body(), casadi::MadnlpInterface::codegen_body(), casadi::OsqpInterface::codegen_body(), casadi::FastNewton::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::Qrqp::codegen_body(), casadi::Sqpmethod::codegen_body(), casadi::OracleFunction::codegen_body_enter(), casadi::Nlpsol::codegen_body_enter(), casadi::Nlpsol::codegen_body_exit(), casadi::Feasiblesqpmethod::codegen_feasibility_iterations(), casadi::OsqpInterface::codegen_init_mem(), casadi::codegen_local(), casadi::codegen_unpack_block(), constant_copy(), casadi::Convexify::generate(), casadi::BinaryMX< ScX, ScY >::generate(), casadi::Call::generate(), casadi::Find::generate(), casadi::Low::generate(), casadi::Concat::generate(), casadi::Einstein::generate(), casadi::GetNonzerosVector::generate(), casadi::GetNonzerosSlice::generate(), casadi::GetNonzerosSlice2::generate(), casadi::GetNonzerosParamVector::generate(), casadi::GetNonzerosSliceParam::generate(), casadi::GetNonzerosParamSlice::generate(), casadi::GetNonzerosParamParam::generate(), casadi::Monitor::generate(), casadi::DenseMultiplication::generate(), casadi::HorzRepmat::generate(), casadi::HorzRepsum::generate(), casadi::SetNonzerosVector< Add >::generate(), casadi::SetNonzerosSlice< Add >::generate(), casadi::SetNonzerosSlice2< Add >::generate(), casadi::SetNonzerosParamVector< Add >::generate(), casadi::SetNonzerosParamSlice< Add >::generate(), casadi::SetNonzerosSliceParam< Add >::generate(), casadi::SetNonzerosParamParam< Add >::generate(), casadi::LinsolCall< Tr >::generate(), casadi::DenseTranspose::generate(), casadi::UnaryMX::generate(), operator()(), casadi::Conic::qp_codegen_body(), and sx_work().
std::string casadi::CodeGenerator::logsumexp | ( | const std::string & | A, |
casadi_int | n | ||
) |
\brie LogSumExp
Definition at line 2222 of file code_generator.cpp.
References add_auxiliary(), and AUX_LOGSUMEXP.
Referenced by casadi::LogSumExp::generate().
std::string casadi::CodeGenerator::low | ( | const std::string & | x, |
const std::string & | grid, | ||
casadi_int | ng, | ||
casadi_int | lookup_mode | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tl
Definition at line 2600 of file code_generator.cpp.
References add_auxiliary(), AUX_LOW, and casadi::str().
Referenced by casadi::Low::generate().
std::string casadi::CodeGenerator::lsqr_solve | ( | const std::string & | A, |
const std::string & | x, | ||
casadi_int | nrhs, | ||
bool | tr, | ||
const std::string & | sp, | ||
const std::string & | w | ||
) |
\brief LSQR solve
Extra doc: https://github.com/casadi/casadi/wiki/L_t1
Definition at line 2465 of file code_generator.cpp.
References add_auxiliary(), AUX_LSQR, and casadi::str().
Referenced by casadi::Lsqr::generate().
std::string casadi::CodeGenerator::masked_norm_inf | ( | casadi_int | n, |
const std::string & | x, | ||
const std::string & | mask | ||
) |
Definition at line 2173 of file code_generator.cpp.
References add_auxiliary(), AUX_MASKED_NORM_INF, and casadi::str().
Referenced by casadi::Feasiblesqpmethod::codegen_body(), casadi::Feasiblesqpmethod::codegen_feasibility_iterations(), and casadi::Feasiblesqpmethod::codegen_tr_update().
std::string casadi::CodeGenerator::max | ( | const std::string & | x, |
const std::string & | y | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tc
Definition at line 2527 of file code_generator.cpp.
References add_auxiliary(), and AUX_MAX.
std::string casadi::CodeGenerator::max_viol | ( | casadi_int | n, |
const std::string & | x, | ||
const std::string & | lb, | ||
const std::string & | ub | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tf
Definition at line 2551 of file code_generator.cpp.
References add_auxiliary(), AUX_MAX_VIOL, and casadi::str().
Referenced by casadi::Feasiblesqpmethod::codegen_body(), casadi::Sqpmethod::codegen_body(), and casadi::Feasiblesqpmethod::codegen_feasibility_iterations().
std::string casadi::CodeGenerator::mem | ( | const Function & | f | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_ty
Definition at line 1975 of file code_generator.cpp.
References casadi::FunctionInternal::codegen_name(), name, and shorthand().
Referenced by operator()().
std::string casadi::CodeGenerator::min | ( | const std::string & | x, |
const std::string & | y | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_td
Definition at line 2533 of file code_generator.cpp.
References add_auxiliary(), and AUX_MIN.
Referenced by clip_max(), and clip_min().
std::string casadi::CodeGenerator::mmax | ( | const std::string & | x, |
casadi_int | n, | ||
bool | is_dense | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_t6
Definition at line 2539 of file code_generator.cpp.
References add_auxiliary(), AUX_MMAX, and casadi::str().
Referenced by casadi::MMax::generate().
std::string casadi::CodeGenerator::mmin | ( | const std::string & | x, |
casadi_int | n, | ||
bool | is_dense | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_t7
Definition at line 2545 of file code_generator.cpp.
References add_auxiliary(), AUX_MMIN, and casadi::str().
Referenced by casadi::MMin::generate().
std::string casadi::CodeGenerator::mtimes | ( | const std::string & | x, |
const Sparsity & | sp_x, | ||
const std::string & | y, | ||
const Sparsity & | sp_y, | ||
const std::string & | z, | ||
const Sparsity & | sp_z, | ||
const std::string & | w, | ||
bool | tr | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sr
Definition at line 2198 of file code_generator.cpp.
References add_auxiliary(), AUX_MTIMES, and sparsity().
Referenced by casadi::Multiplication::generate().
std::string casadi::CodeGenerator::mv | ( | const std::string & | x, |
casadi_int | nrow_x, | ||
casadi_int | ncol_x, | ||
const std::string & | y, | ||
const std::string & | z, | ||
bool | tr | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_so
Definition at line 2191 of file code_generator.cpp.
References add_auxiliary(), AUX_MV_DENSE, and casadi::str().
std::string casadi::CodeGenerator::mv | ( | const std::string & | x, |
const Sparsity & | sp_x, | ||
const std::string & | y, | ||
const std::string & | z, | ||
bool | tr | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sn
Definition at line 2184 of file code_generator.cpp.
References add_auxiliary(), AUX_MV, and sparsity().
Referenced by casadi::Feasiblesqpmethod::codegen_body(), casadi::Sqpmethod::codegen_body(), casadi::Feasiblesqpmethod::codegen_feasibility_iterations(), and casadi::Sqpmethod::codegen_solve_elastic_mode().
std::string casadi::CodeGenerator::norm_1 | ( | casadi_int | n, |
const std::string & | x | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2br
Definition at line 2569 of file code_generator.cpp.
References add_auxiliary(), AUX_NORM_1, and casadi::str().
Referenced by casadi::Norm1::generate().
std::string casadi::CodeGenerator::norm_2 | ( | casadi_int | n, |
const std::string & | x | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_256
Definition at line 2575 of file code_generator.cpp.
References add_auxiliary(), AUX_NORM_2, and casadi::str().
Referenced by casadi::Feasiblesqpmethod::codegen_feasibility_iterations(), and casadi::NormF::generate().
std::string casadi::CodeGenerator::norm_inf | ( | casadi_int | n, |
const std::string & | x | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_te
Definition at line 2563 of file code_generator.cpp.
References add_auxiliary(), AUX_NORM_INF, and casadi::str().
Referenced by casadi::Feasiblesqpmethod::codegen_body(), casadi::Sqpmethod::codegen_body(), casadi::Sqpmethod::codegen_calc_gamma_1(), and casadi::NormInf::generate().
std::string casadi::CodeGenerator::ones | ( | casadi_int | sz | ) |
Definition at line 1330 of file code_generator.cpp.
References shorthand(), and sz_ones_.
std::string casadi::CodeGenerator::operator() | ( | const Function & | f, |
const std::string & | arg, | ||
const std::string & | res, | ||
const std::string & | iw, | ||
const std::string & | w, | ||
const std::string & | failure_ret = "1" |
||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_s6
Definition at line 1139 of file code_generator.cpp.
References add_dependency(), arg(), casadi::FunctionInternal::codegen_mem_type(), local(), mem(), name, and res().
CodeGenerator & casadi::CodeGenerator::operator<< | ( | const std::string & | s | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_s7
Definition at line 2255 of file code_generator.cpp.
References buffer, newline_, and print_formatted().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_s9
Definition at line 215 of file code_generator.hpp.
std::string casadi::CodeGenerator::pool_double | ( | const std::string & | name | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2ax
Definition at line 836 of file code_generator.cpp.
References name, pool_double_, and casadi::str().
Referenced by casadi::ConstantPool::generate().
void casadi::CodeGenerator::print_formatted | ( | const std::string & | s | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_s8
Definition at line 2229 of file code_generator.cpp.
References buffer, current_indent_, indent(), indent_, newline_, and unindent().
Referenced by operator<<().
std::string casadi::CodeGenerator::print_op | ( | casadi_int | op, |
const std::string & | a0 | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_u6
Definition at line 1060 of file code_generator.cpp.
References add_auxiliary(), AUX_EXPM1, AUX_FABS, AUX_LOG1P, AUX_SIGN, AUX_SQ, casadi::OP_EXPM1, casadi::OP_FABS, casadi::OP_LOG1P, casadi::OP_SIGN, casadi::OP_SQ, and casadi::casadi_math< T >::print().
Referenced by casadi::SXFunction::codegen_body(), casadi::BinaryMX< ScX, ScY >::generate(), and casadi::UnaryMX::generate().
std::string casadi::CodeGenerator::print_op | ( | casadi_int | op, |
const std::string & | a0, | ||
const std::string & | a1 | ||
) |
Definition at line 1081 of file code_generator.cpp.
References add_auxiliary(), AUX_FMAX, AUX_FMIN, AUX_HYPOT, AUX_PRINTME, casadi::OP_FMAX, casadi::OP_FMIN, casadi::OP_HYPOT, casadi::OP_PRINTME, and casadi::casadi_math< T >::print().
void casadi::CodeGenerator::print_vector | ( | std::ostream & | s, |
const std::string & | name, | ||
const std::vector< casadi_int > & | v | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tr
Definition at line 1040 of file code_generator.cpp.
References array(), initializer(), and name.
Referenced by dump().
void casadi::CodeGenerator::print_vector | ( | std::ostream & | s, |
const std::string & | name, | ||
const std::vector< char > & | v | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_27n
Definition at line 1045 of file code_generator.cpp.
References array(), initializer(), and name.
void casadi::CodeGenerator::print_vector | ( | std::ostream & | s, |
const std::string & | name, | ||
const std::vector< double > & | v | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_ts
Definition at line 1050 of file code_generator.cpp.
References array(), initializer(), and name.
void casadi::CodeGenerator::print_vector | ( | std::ostream & | s, |
const std::string & | name, | ||
const std::vector< std::string > & | v | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_281
Definition at line 1055 of file code_generator.cpp.
References array(), initializer(), and name.
std::string casadi::CodeGenerator::printf | ( | const std::string & | str, |
const std::string & | arg1 | ||
) |
Definition at line 2120 of file code_generator.cpp.
References arg(), printf(), and casadi::str().
std::string casadi::CodeGenerator::printf | ( | const std::string & | str, |
const std::string & | arg1, | ||
const std::string & | arg2 | ||
) |
std::string casadi::CodeGenerator::printf | ( | const std::string & | str, |
const std::string & | arg1, | ||
const std::string & | arg2, | ||
const std::string & | arg3 | ||
) |
std::string casadi::CodeGenerator::printf | ( | const std::string & | str, |
const std::vector< std::string > & | arg = std::vector<std::string>() |
||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_u5
Definition at line 2111 of file code_generator.cpp.
References add_auxiliary(), arg(), AUX_PRINTF, and casadi::str().
Referenced by casadi::Feasiblesqpmethod::codegen_body(), casadi::Qrqp::codegen_body(), casadi::FunctionInternal::codegen_meta(), casadi::Monitor::generate(), and printf().
std::string casadi::CodeGenerator::project | ( | const std::string & | arg, |
const Sparsity & | sp_arg, | ||
const std::string & | res, | ||
const Sparsity & | sp_res, | ||
const std::string & | w | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tz
Definition at line 2064 of file code_generator.cpp.
References add_auxiliary(), arg(), AUX_PROJECT, copy(), casadi::Sparsity::nnz(), res(), and sparsity().
Referenced by casadi::Switch::codegen_body(), and casadi::Project::generate().
std::string casadi::CodeGenerator::qr | ( | const std::string & | sp, |
const std::string & | A, | ||
const std::string & | w, | ||
const std::string & | sp_v, | ||
const std::string & | v, | ||
const std::string & | sp_r, | ||
const std::string & | r, | ||
const std::string & | beta, | ||
const std::string & | prinv, | ||
const std::string & | pc | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sz
Definition at line 2442 of file code_generator.cpp.
References add_auxiliary(), and AUX_QR.
Referenced by casadi::LinsolQr::generate().
std::string casadi::CodeGenerator::qr_solve | ( | const std::string & | x, |
casadi_int | nrhs, | ||
bool | tr, | ||
const std::string & | sp_v, | ||
const std::string & | v, | ||
const std::string & | sp_r, | ||
const std::string & | r, | ||
const std::string & | beta, | ||
const std::string & | prinv, | ||
const std::string & | pc, | ||
const std::string & | w | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_t0
Definition at line 2453 of file code_generator.cpp.
References add_auxiliary(), AUX_QR, and casadi::str().
Referenced by casadi::LinsolQr::generate().
std::string casadi::CodeGenerator::rank1 | ( | const std::string & | A, |
const Sparsity & | sp_A, | ||
const std::string & | alpha, | ||
const std::string & | x, | ||
const std::string & | y | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sv
Definition at line 2007 of file code_generator.cpp.
References add_auxiliary(), AUX_RANK1, and sparsity().
Referenced by casadi::Rank1::generate().
std::string casadi::CodeGenerator::regularize | ( | const Sparsity & | sp_h, |
const std::string & | h, | ||
const std::string & | reg | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tj
Definition at line 2587 of file code_generator.cpp.
References add_auxiliary(), AUX_REGULARIZE, and sparsity().
std::string casadi::CodeGenerator::res | ( | casadi_int | i | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_tx
Definition at line 1971 of file code_generator.cpp.
References casadi::str().
Referenced by clear(), casadi::FiniteDiff::codegen_body(), casadi::OmpMap::codegen_body(), casadi::Switch::codegen_body(), casadi::SXFunction::codegen_body(), casadi::OsqpInterface::codegen_body(), casadi::FastNewton::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::Qrqp::codegen_body(), casadi::FunctionInternal::codegen_meta(), copy(), copy_check(), copy_default(), densify(), fill(), from_mex(), casadi::Output::generate(), interpn(), operator()(), project(), sparsify(), and tri_project().
void casadi::CodeGenerator::reserve_work | ( | casadi_int | n | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2ay
Definition at line 1010 of file code_generator.cpp.
References padding_length_, and casadi::str().
Referenced by casadi::MXFunction::codegen_body(), and casadi::SXFunction::codegen_body().
std::string casadi::CodeGenerator::rom_double | ( | const void * | id | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_s3
Definition at line 803 of file code_generator.cpp.
References file_scope_double_, and casadi::str().
Referenced by casadi::ConstantFile::codegen_incref(), and casadi::ConstantFile::generate().
std::string casadi::CodeGenerator::rom_integer | ( | const void * | id | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_s5
Definition at line 817 of file code_generator.cpp.
References file_scope_double_, and casadi::str().
std::string casadi::CodeGenerator::sanitize_source | ( | const std::string & | src, |
const std::vector< std::string > & | inst, | ||
bool | add_shorthand = true |
||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sl
Definition at line 2316 of file code_generator.cpp.
References casadi::replace(), shorthand(), casadi::str(), suffix, and verbose_runtime.
Referenced by add_auxiliary(), casadi::ClarabelInterface::codegen_body(), casadi::DaqpInterface::codegen_body(), casadi::FatropInterface::codegen_body(), casadi::HighsInterface::codegen_body(), casadi::HpipmInterface::codegen_body(), casadi::IpoptInterface::codegen_body(), and casadi::MadnlpInterface::codegen_body().
std::string casadi::CodeGenerator::scal | ( | casadi_int | n, |
const std::string & | alpha, | ||
const std::string & | x | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sq
Definition at line 2179 of file code_generator.cpp.
References add_auxiliary(), AUX_SCAL, and casadi::str().
Referenced by casadi::Sqpmethod::codegen_body(), and casadi::Nlpsol::codegen_body_exit().
void casadi::CodeGenerator::scope_enter | ( | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sc
Definition at line 203 of file code_generator.cpp.
References local_default_, and local_variables_.
Referenced by add_dependency(), casadi::FunctionInternal::codegen(), casadi::FatropInterface::codegen_declarations(), and casadi::IpoptInterface::codegen_declarations().
void casadi::CodeGenerator::scope_exit | ( | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sd
Definition at line 208 of file code_generator.cpp.
References body, local_default_, local_variables_, and max_declarations_per_line.
Referenced by add_dependency(), casadi::FunctionInternal::codegen(), casadi::FatropInterface::codegen_declarations(), and casadi::IpoptInterface::codegen_declarations().
void casadi::CodeGenerator::setup_callback | ( | const std::string & | s, |
const Function & | f | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_27s
Definition at line 1122 of file code_generator.cpp.
References add_dependency(), casadi::FunctionInternal::codegen_mem_type(), and name.
Referenced by casadi::FatropInterface::set_fatrop_prob(), and casadi::MadnlpInterface::set_madnlp_prob().
std::string casadi::CodeGenerator::shorthand | ( | const std::string & | name | ) | const |
Definition at line 1165 of file code_generator.cpp.
References added_shorthands_, and name.
Referenced by add_auxiliary(), add_dependency(), casadi::FunctionInternal::codegen_alloc_mem(), casadi::Nlpsol::codegen_body_enter(), casadi::FunctionInternal::codegen_checkout(), casadi::Nlpsol::codegen_declarations(), casadi::FatropInterface::codegen_declarations(), casadi::IpoptInterface::codegen_declarations(), casadi::FunctionInternal::codegen_mem(), casadi::FunctionInternal::codegen_release(), constant(), define_pool_double(), define_rom_double(), define_rom_integer(), mem(), ones(), sanitize_source(), casadi::FatropInterface::set_fatrop_prob(), casadi::IpoptInterface::set_ipopt_prob(), sparsity(), and zeros().
std::string casadi::CodeGenerator::shorthand | ( | const std::string & | name, |
bool | allow_adding = true |
||
) |
std::string casadi::CodeGenerator::sparsify | ( | const std::string & | arg, |
const std::string & | res, | ||
const Sparsity & | sp_res, | ||
bool | tr = false |
||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_u2
Definition at line 2101 of file code_generator.cpp.
References add_auxiliary(), arg(), AUX_SPARSIFY, res(), and sparsity().
Referenced by casadi::Sparsify::generate().
std::string casadi::CodeGenerator::sparsity | ( | const Sparsity & | sp, |
bool | canonical = true |
||
) |
Definition at line 1182 of file code_generator.cpp.
References add_sparsity(), shorthand(), and casadi::str().
Referenced by add_io_sparsities(), bilin(), casadi::FastNewton::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::Qrqp::codegen_body(), casadi::Sqpmethod::codegen_body(), densify(), from_mex(), casadi::Convexify::generate(), casadi::LinsolLdl::generate(), casadi::LinsolQr::generate(), casadi::Lsqr::generate(), casadi::Find::generate(), lb_eig(), mtimes(), mv(), project(), casadi::Conic::qp_codegen_body(), rank1(), regularize(), casadi::FatropInterface::set_fatrop_prob(), casadi::HpipmInterface::set_hpipm_prob(), casadi::IpoptInterface::set_ipopt_prob(), casadi::MadnlpInterface::set_madnlp_prob(), sparsify(), to_mex(), trans(), tri_project(), trilsolve(), and triusolve().
std::string casadi::CodeGenerator::sum_viol | ( | casadi_int | n, |
const std::string & | x, | ||
const std::string & | lb, | ||
const std::string & | ub | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tg
Definition at line 2557 of file code_generator.cpp.
References add_auxiliary(), AUX_SUM_VIOL, and casadi::str().
Referenced by casadi::Sqpmethod::codegen_body().
std::string casadi::CodeGenerator::sx_work | ( | casadi_int | i | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_se
Definition at line 2295 of file code_generator.cpp.
References avoid_stack_, format_padded(), local(), name, and casadi::str().
Referenced by casadi::SXFunction::codegen_body().
void casadi::CodeGenerator::sz_work | ( | size_t & | sz_arg, |
size_t & | sz_res, | ||
size_t & | sz_iw, | ||
size_t & | sz_w | ||
) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_258
Definition at line 2628 of file code_generator.cpp.
References added_functions_.
Referenced by casadi::DaeBuilderInternal::generate_wrapper().
std::string casadi::CodeGenerator::to_mex | ( | const Sparsity & | sp, |
const std::string & | arg | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_u3
Definition at line 1851 of file code_generator.cpp.
References add_auxiliary(), arg(), AUX_TO_MEX, and sparsity().
Referenced by casadi::FunctionInternal::codegen_meta().
std::string casadi::CodeGenerator::trans | ( | const std::string & | x, |
const Sparsity & | sp_x, | ||
const std::string & | y, | ||
const Sparsity & | sp_y, | ||
const std::string & | iw | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sy
Definition at line 2042 of file code_generator.cpp.
References add_auxiliary(), AUX_TRANS, and sparsity().
Referenced by casadi::Transpose::generate().
std::string casadi::CodeGenerator::tri_project | ( | const std::string & | arg, |
const Sparsity & | sp_arg, | ||
const std::string & | res, | ||
bool | lower | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_u0
Definition at line 2079 of file code_generator.cpp.
References add_auxiliary(), arg(), AUX_TRI_PROJECT, res(), and sparsity().
Referenced by casadi::OsqpInterface::codegen_body().
std::string casadi::CodeGenerator::trilsolve | ( | const Sparsity & | sp_x, |
const std::string & | x, | ||
const std::string & | y, | ||
bool | tr, | ||
bool | unity, | ||
casadi_int | nrhs | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_ss
Definition at line 2207 of file code_generator.cpp.
References add_auxiliary(), AUX_TRILSOLVE, sparsity(), and casadi::str().
Referenced by casadi::TrilSolve< Tr >::generate(), and casadi::TrilSolveUnity< Tr >::generate().
std::string casadi::CodeGenerator::triusolve | ( | const Sparsity & | sp_x, |
const std::string & | x, | ||
const std::string & | y, | ||
bool | tr, | ||
bool | unity, | ||
casadi_int | nrhs | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_st
Definition at line 2214 of file code_generator.cpp.
References add_auxiliary(), AUX_TRIUSOLVE, sparsity(), and casadi::str().
Referenced by casadi::TriuSolve< Tr >::generate(), and casadi::TriuSolveUnity< Tr >::generate().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_sh
Definition at line 259 of file code_generator.hpp.
Referenced by print_formatted().
std::string casadi::CodeGenerator::vector_fmax | ( | casadi_int | n, |
const std::string & | x, | ||
const std::string & | y, | ||
const std::string & | z | ||
) |
Definition at line 2161 of file code_generator.cpp.
References add_auxiliary(), AUX_VECTOR_FMAX, and casadi::str().
Referenced by casadi::Feasiblesqpmethod::codegen_feasibility_iterations().
std::string casadi::CodeGenerator::vector_fmin | ( | casadi_int | n, |
const std::string & | x, | ||
const std::string & | y, | ||
const std::string & | z | ||
) |
Definition at line 2167 of file code_generator.cpp.
References add_auxiliary(), AUX_VECTOR_FMIN, and casadi::str().
Referenced by casadi::Feasiblesqpmethod::codegen_feasibility_iterations().
std::string casadi::CodeGenerator::vfmax | ( | const std::string & | x, |
casadi_int | n, | ||
const std::string & | y | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_t8
Definition at line 2503 of file code_generator.cpp.
References add_auxiliary(), AUX_VFMAX, and casadi::str().
std::string casadi::CodeGenerator::vfmax | ( | const std::string & | x, |
const std::string & | n, | ||
const std::string & | y | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_ta
Definition at line 2515 of file code_generator.cpp.
References add_auxiliary(), and AUX_VFMAX.
std::string casadi::CodeGenerator::vfmin | ( | const std::string & | x, |
casadi_int | n, | ||
const std::string & | y | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_t9
Definition at line 2509 of file code_generator.cpp.
References add_auxiliary(), AUX_VFMIN, and casadi::str().
std::string casadi::CodeGenerator::vfmin | ( | const std::string & | x, |
const std::string & | n, | ||
const std::string & | y | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tb
Definition at line 2521 of file code_generator.cpp.
References add_auxiliary(), and AUX_VFMIN.
std::string casadi::CodeGenerator::work | ( | casadi_int | n, |
casadi_int | sz, | ||
bool | is_ref | ||
) | const |
Get work vector name from index
Definition at line 989 of file code_generator.cpp.
References codegen_scalars, and format_padded().
Referenced by casadi::BSplineParametric::generate(), casadi::Bilin::generate(), casadi::BinaryMX< ScX, ScY >::generate(), casadi::BSplineCommon::generate(), casadi::Call::generate(), casadi::Find::generate(), casadi::Low::generate(), casadi::Concat::generate(), casadi::ConstantDM::generate(), casadi::ConstantFile::generate(), casadi::ConstantPool::generate(), casadi::Constant< Value >::generate(), casadi::Convexify::generate(), casadi::Dot::generate(), casadi::Einstein::generate(), casadi::GetNonzerosVector::generate(), casadi::GetNonzerosSlice::generate(), casadi::GetNonzerosSlice2::generate(), casadi::GetNonzerosParamVector::generate(), casadi::GetNonzerosSliceParam::generate(), casadi::GetNonzerosParamSlice::generate(), casadi::GetNonzerosParamParam::generate(), casadi::Input::generate(), casadi::Output::generate(), casadi::LogSumExp::generate(), casadi::MMin::generate(), casadi::MMax::generate(), casadi::Monitor::generate(), casadi::Multiplication::generate(), casadi::DenseMultiplication::generate(), casadi::NormF::generate(), casadi::Norm1::generate(), casadi::NormInf::generate(), casadi::Project::generate(), casadi::Densify::generate(), casadi::Sparsify::generate(), casadi::Rank1::generate(), casadi::HorzRepmat::generate(), casadi::HorzRepsum::generate(), casadi::SetNonzerosVector< Add >::generate(), casadi::SetNonzerosSlice< Add >::generate(), casadi::SetNonzerosSlice2< Add >::generate(), casadi::SetNonzerosParam< Add >::generate(), casadi::SetNonzerosParamVector< Add >::generate(), casadi::SetNonzerosParamSlice< Add >::generate(), casadi::SetNonzerosSliceParam< Add >::generate(), casadi::SetNonzerosParamParam< Add >::generate(), casadi::LinsolCall< Tr >::generate(), casadi::TriuSolve< Tr >::generate(), casadi::TrilSolve< Tr >::generate(), casadi::TriuSolveUnity< Tr >::generate(), casadi::TrilSolveUnity< Tr >::generate(), casadi::Split::generate(), casadi::Transpose::generate(), casadi::DenseTranspose::generate(), casadi::UnaryMX::generate(), and casadi::MXNode::generate_copy().
std::string casadi::CodeGenerator::workel | ( | casadi_int | n | ) | const |
Get work vector element from index
Definition at line 1002 of file code_generator.cpp.
References codegen_scalars, and format_padded().
Referenced by casadi::Assertion::generate(), casadi::Bilin::generate(), casadi::BinaryMX< ScX, ScY >::generate(), casadi::Find::generate(), casadi::Concat::generate(), casadi::ConstantFile::generate(), casadi::ConstantPool::generate(), casadi::Constant< Value >::generate(), casadi::Dot::generate(), casadi::GetNonzerosSlice::generate(), casadi::Input::generate(), casadi::Output::generate(), casadi::LogSumExp::generate(), casadi::MMin::generate(), casadi::MMax::generate(), casadi::NormF::generate(), casadi::Norm1::generate(), casadi::NormInf::generate(), casadi::Rank1::generate(), casadi::Split::generate(), casadi::UnaryMX::generate(), and casadi::MXNode::generate_copy().
std::string casadi::CodeGenerator::wrapper | ( | const Function & | base, |
const std::string & | name | ||
) |
Definition at line 237 of file code_generator.cpp.
References added_wrappers_, casadi::Function::get(), name, and casadi::str().
Referenced by casadi::Nlpsol::codegen_body_enter(), casadi::Nlpsol::codegen_declarations(), casadi::IpoptInterface::codegen_declarations(), and casadi::IpoptInterface::set_ipopt_prob().
std::string casadi::CodeGenerator::zeros | ( | casadi_int | sz | ) |
Definition at line 1325 of file code_generator.cpp.
References shorthand(), and sz_zeros_.
Referenced by casadi::Input::generate().
std::multimap<Auxiliary, std::vector<std::string> > casadi::CodeGenerator::added_auxiliaries_ |
Definition at line 996 of file code_generator.hpp.
Referenced by add_auxiliary().
std::multimap<size_t, size_t> casadi::CodeGenerator::added_char_constants_ |
Definition at line 999 of file code_generator.hpp.
Referenced by get_constant().
std::multimap<size_t, size_t> casadi::CodeGenerator::added_double_constants_ |
Definition at line 997 of file code_generator.hpp.
Referenced by get_constant().
std::set<std::string> casadi::CodeGenerator::added_externals_ |
Definition at line 994 of file code_generator.hpp.
Referenced by add_external(), and dump().
std::vector<FunctionMeta> casadi::CodeGenerator::added_functions_ |
Definition at line 1015 of file code_generator.hpp.
Referenced by add_dependency(), casadi::FunctionInternal::codegen_name(), and sz_work().
std::set<std::string> casadi::CodeGenerator::added_includes_ |
Definition at line 993 of file code_generator.hpp.
Referenced by add_include().
std::multimap<size_t, size_t> casadi::CodeGenerator::added_integer_constants_ |
Definition at line 998 of file code_generator.hpp.
Referenced by get_constant().
std::vector<std::string> casadi::CodeGenerator::added_sfunctions |
Definition at line 915 of file code_generator.hpp.
Referenced by add(), and generate().
std::set<std::string> casadi::CodeGenerator::added_shorthands_ |
Definition at line 995 of file code_generator.hpp.
Referenced by dump(), and shorthand().
std::multimap<size_t, size_t> casadi::CodeGenerator::added_string_constants_ |
Definition at line 1000 of file code_generator.hpp.
Referenced by get_constant().
std::map<std::string, std::map<FunctionInternal*, casadi_int> > casadi::CodeGenerator::added_wrappers_ |
Definition at line 1018 of file code_generator.hpp.
Referenced by wrapper().
std::stringstream casadi::CodeGenerator::auxiliaries |
Definition at line 968 of file code_generator.hpp.
Referenced by add_auxiliary(), casadi::ClarabelInterface::codegen_body(), casadi::DaqpInterface::codegen_body(), casadi::FatropInterface::codegen_body(), casadi::HighsInterface::codegen_body(), casadi::HpipmInterface::codegen_body(), casadi::IpoptInterface::codegen_body(), casadi::MadnlpInterface::codegen_body(), casadi::FunctionInternal::codegen_checkout(), and dump().
bool casadi::CodeGenerator::avoid_stack_ |
Definition at line 936 of file code_generator.hpp.
Referenced by CodeGenerator(), and sx_work().
std::stringstream casadi::CodeGenerator::body |
Definition at line 969 of file code_generator.hpp.
Referenced by add(), add_dependency(), casadi::FunctionInternal::codegen(), casadi::FatropInterface::codegen_declarations(), casadi::IpoptInterface::codegen_declarations(), casadi::FunctionInternal::codegen_meta(), dump(), and scope_exit().
std::stringstream casadi::CodeGenerator::buffer |
Definition at line 971 of file code_generator.hpp.
Referenced by flush(), operator<<(), and print_formatted().
std::string casadi::CodeGenerator::casadi_int_type |
Definition at line 902 of file code_generator.hpp.
Referenced by CodeGenerator().
std::string casadi::CodeGenerator::casadi_real_type |
Definition at line 899 of file code_generator.hpp.
Referenced by CodeGenerator().
std::vector<std::vector<char> > casadi::CodeGenerator::char_constants_ |
Definition at line 1023 of file code_generator.hpp.
Referenced by dump(), and get_constant().
bool casadi::CodeGenerator::codegen_scalars |
Use the work vector for storing work vector elements of length 1 (typically scalar) instead of using local variables
Extra doc: https://github.com/casadi/casadi/wiki/L_u9
Definition at line 946 of file code_generator.hpp.
Referenced by casadi::MXFunction::codegen_body(), CodeGenerator(), casadi::BinaryMX< ScX, ScY >::generate(), work(), and workel().
bool casadi::CodeGenerator::cpp |
Definition at line 927 of file code_generator.hpp.
Referenced by add_auxiliary(), CodeGenerator(), declare(), file_close(), file_open(), and generate().
casadi_int casadi::CodeGenerator::current_indent_ |
Definition at line 978 of file code_generator.hpp.
Referenced by CodeGenerator(), dump(), and print_formatted().
std::string casadi::CodeGenerator::dll_export |
Definition at line 961 of file code_generator.hpp.
Referenced by CodeGenerator().
std::string casadi::CodeGenerator::dll_import |
Definition at line 961 of file code_generator.hpp.
Referenced by CodeGenerator(), and declare().
std::vector<std::vector<double> > casadi::CodeGenerator::double_constants_ |
Definition at line 1021 of file code_generator.hpp.
Referenced by dump(), and get_constant().
std::vector<std::string> casadi::CodeGenerator::exposed_fname |
Definition at line 987 of file code_generator.hpp.
Referenced by add(), and generate().
std::map<const void *, casadi_int> casadi::CodeGenerator::file_scope_double_ |
Definition at line 1003 of file code_generator.hpp.
Referenced by define_rom_double(), define_rom_integer(), dump(), rom_double(), and rom_integer().
std::map<const void *, casadi_int> casadi::CodeGenerator::file_scope_integer_ |
Definition at line 1004 of file code_generator.hpp.
Referenced by dump().
bool casadi::CodeGenerator::force_canonical |
Definition at line 958 of file code_generator.hpp.
Referenced by add_io_sparsities(), and CodeGenerator().
std::stringstream casadi::CodeGenerator::header |
Definition at line 970 of file code_generator.hpp.
Referenced by casadi::FunctionInternal::codegen_meta(), CodeGenerator(), declare(), and generate().
bool casadi::CodeGenerator::include_math |
Definition at line 933 of file code_generator.hpp.
Referenced by CodeGenerator().
std::stringstream casadi::CodeGenerator::includes |
Definition at line 967 of file code_generator.hpp.
Referenced by add_include(), and dump().
casadi_int casadi::CodeGenerator::indent_ |
Definition at line 977 of file code_generator.hpp.
Referenced by CodeGenerator(), and print_formatted().
std::string casadi::CodeGenerator::infinity |
Definition at line 938 of file code_generator.hpp.
Referenced by add_auxiliary(), and CodeGenerator().
std::vector<std::vector<casadi_int> > casadi::CodeGenerator::integer_constants_ |
Definition at line 1022 of file code_generator.hpp.
Referenced by dump(), and get_constant().
std::map<std::string, std::string> casadi::CodeGenerator::local_default_ |
Definition at line 1002 of file code_generator.hpp.
Referenced by init_local(), scope_enter(), and scope_exit().
std::map<std::string, std::pair<std::string, std::string> > casadi::CodeGenerator::local_variables_ |
Definition at line 1001 of file code_generator.hpp.
Referenced by local(), scope_enter(), and scope_exit().
bool casadi::CodeGenerator::main |
Definition at line 930 of file code_generator.hpp.
Referenced by casadi::FunctionInternal::codegen_meta(), CodeGenerator(), and generate().
casadi_int casadi::CodeGenerator::max_declarations_per_line |
Definition at line 952 of file code_generator.hpp.
Referenced by CodeGenerator(), and scope_exit().
casadi_int casadi::CodeGenerator::max_initializer_elements_per_line |
Definition at line 955 of file code_generator.hpp.
Referenced by CodeGenerator().
bool casadi::CodeGenerator::mex |
Definition at line 911 of file code_generator.hpp.
Referenced by add_auxiliary(), casadi::FunctionInternal::codegen_meta(), CodeGenerator(), and generate().
std::string casadi::CodeGenerator::name |
Definition at line 896 of file code_generator.hpp.
Referenced by add_io_sparsities(), array(), CodeGenerator(), constant_copy(), define_pool_double(), file_open(), generate(), init_local(), local(), mem(), operator()(), pool_double(), print_vector(), setup_callback(), shorthand(), sx_work(), and wrapper().
std::string casadi::CodeGenerator::nan |
Definition at line 938 of file code_generator.hpp.
Referenced by add_auxiliary(), and CodeGenerator().
bool casadi::CodeGenerator::needs_mem_ |
Definition at line 1027 of file code_generator.hpp.
Referenced by add_dependency(), CodeGenerator(), and dump().
bool casadi::CodeGenerator::newline_ |
Definition at line 974 of file code_generator.hpp.
Referenced by CodeGenerator(), operator<<(), and print_formatted().
casadi_int casadi::CodeGenerator::padding_length_ |
Definition at line 984 of file code_generator.hpp.
Referenced by format_padded(), and reserve_work().
std::map<std::string, casadi_int> casadi::CodeGenerator::pool_double_ |
Definition at line 1006 of file code_generator.hpp.
Referenced by define_pool_double(), dump(), generate(), and pool_double().
std::vector< std::vector<double> > casadi::CodeGenerator::pool_double_defaults_ |
Definition at line 1005 of file code_generator.hpp.
Referenced by define_pool_double(), dump(), and generate().
std::string casadi::CodeGenerator::prefix |
Definition at line 964 of file code_generator.hpp.
Referenced by CodeGenerator(), dump(), and generate().
std::string casadi::CodeGenerator::real_min |
Definition at line 938 of file code_generator.hpp.
Referenced by add_auxiliary(), and CodeGenerator().
std::set<std::string> casadi::CodeGenerator::sparsity_meta |
Definition at line 990 of file code_generator.hpp.
Referenced by add_io_sparsities().
std::vector<std::vector<std::string> > casadi::CodeGenerator::string_constants_ |
Definition at line 1024 of file code_generator.hpp.
Referenced by dump(), and get_constant().
std::string casadi::CodeGenerator::suffix |
Definition at line 896 of file code_generator.hpp.
Referenced by CodeGenerator(), generate(), and sanitize_source().
casadi_int casadi::CodeGenerator::sz_ones_ |
Definition at line 982 of file code_generator.hpp.
Referenced by CodeGenerator(), dump(), and ones().
casadi_int casadi::CodeGenerator::sz_zeros_ |
Definition at line 981 of file code_generator.hpp.
Referenced by CodeGenerator(), dump(), and zeros().
bool casadi::CodeGenerator::unroll_args |
Definition at line 918 of file code_generator.hpp.
Referenced by add(), and CodeGenerator().
bool casadi::CodeGenerator::verbose |
Definition at line 921 of file code_generator.hpp.
Referenced by casadi::MXFunction::codegen_body(), CodeGenerator(), and comment().
bool casadi::CodeGenerator::verbose_runtime |
Definition at line 924 of file code_generator.hpp.
Referenced by CodeGenerator(), and sanitize_source().
bool casadi::CodeGenerator::with_export |
Definition at line 949 of file code_generator.hpp.
Referenced by CodeGenerator(), and dump().
bool casadi::CodeGenerator::with_header |
Definition at line 908 of file code_generator.hpp.
Referenced by casadi::FunctionInternal::codegen_meta(), CodeGenerator(), declare(), and generate().
bool casadi::CodeGenerator::with_import |
Definition at line 949 of file code_generator.hpp.
Referenced by CodeGenerator(), and generate().
bool casadi::CodeGenerator::with_mem |
Definition at line 905 of file code_generator.hpp.
Referenced by casadi::FunctionInternal::codegen_meta(), CodeGenerator(), and dump().
bool casadi::CodeGenerator::with_sfunction |
Definition at line 914 of file code_generator.hpp.
Referenced by add(), CodeGenerator(), and generate().