Helper class for C code generation. More...
#include <code_generator.hpp>
Extra doc: https://github.com/casadi/casadi/wiki/L_ru
Definition at line 44 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 | define_local_mutex (const Function &f, const std::string &name) |
| Declare a static mutex associated with a function. More... | |
| std::string | local_mutex (const Function &f, const std::string &name) const |
| Access a static mutex associated with a function. More... | |
| const std::set< std::string > & | local_mutexes (const Function &f) const |
| Get all mutex names associated with a function. 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... | |
| void | scope_return (const std::string &value) |
| Return from a scope with a value. More... | |
| void | scope_return () |
| Return from a scope without a value. More... | |
| void | scope_add_cleanup (const std::string &code) |
| Add cleanup code to be executed upon scope exit. 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... | |
| bool | thread_safe () const |
| Emit thead safe code chekout/release? 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 | mtimes (const std::string &x, casadi_int nrow_x, casadi_int ncol_x, const std::string &y, casadi_int ncol_y, const std::string &z, bool tr) |
| Codegen dense matrix-matrix multiplication. More... | |
| std::string | mtimes_dense_sparse (const std::string &x, casadi_int nrow_x, const std::string &y, const Sparsity &sp_y, const std::string &z) |
| Codegen dense-sparse matrix-matrix multiplication (z, x dense) 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 | det (const std::string &sp_v, const std::string &v, const std::string &sp_r, const std::string &r, const std::string &beta) |
| Determinant from sparse QR factors. 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 | print_canonical (const Sparsity &sp, const std::string &arg) |
| Print canonical representaion of a matrix. More... | |
| std::string | print_vector (casadi_int sz, const std::string &arg) |
| Print canonical representaion of a vector. More... | |
| std::string | print_scalar (const std::string &arg) |
| Print canonical representaion of a scalar. More... | |
| std::string | fprintf_scalar (const std::string &f, const std::string &arg) |
| fprintf a normalized scalar (canonical nan/inf) to a file More... | |
| std::string | fprintf_vector (const std::string &f, casadi_int sz, const std::string &arg, const std::string &sep) |
| fprintf a normalized vector to a file with a separator 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 | to_file (const std::string &f, const Sparsity &sp, const std::string &x) |
| Write matrix to file in MatrixMarket format. More... | |
| void | generate_dump (const Function &f, const std::string &arr, bool is_input) |
| Generate dump_in or dump_out code for a function call. More... | |
| void | generate_print (const Function &f, const std::string &arr, bool is_input) |
| Generate print_in or print_out code for a function call. 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 | stream_open (std::ostream &f, bool cpp) |
| Print file header. More... | |
| static void | stream_close (std::ostream &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 | static_aux |
| bool | inline_aux |
| 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 |
| bool | l1_blas |
| bool | thread_safe_ |
| std::string | dll_export |
| std::string | dll_import |
| std::string | prefix |
| std::string | dump_dir_prefix |
| std::string | dump_dir_suffix |
| 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::vector< std::string > | local_cleanup_ |
| bool | local_void_ |
| 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::map< const FunctionInternal *, std::set< std::string > > | local_mutexes_ |
| 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 675 of file code_generator.hpp.
Definition at line 38 of file code_generator.cpp.
References add_auxiliary(), add_include(), AUX_PRINTF, AUX_THREADS, avoid_stack_, casadi_int_type, casadi_real_type, casadi::Function::check_name(), codegen_scalars, cpp, current_indent_, dll_export, dll_import, dump_dir_prefix, dump_dir_suffix, force_canonical, header, include_math, indent_, infinity, inline_aux, l1_blas, main, max_declarations_per_line, max_initializer_elements_per_line, mex, name, nan, needs_mem_, newline_, prefix, real_min, static_aux, casadi::str(), suffix, sz_ones_, sz_zeros_, thread_safe_, 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 399 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 1504 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_4D_BOOR_EVAL, AUX_BLAZING_5D_BOOR_EVAL, AUX_BLAZING_COMMON, 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_DET, AUX_DOT, AUX_EXPM1, AUX_FABS, AUX_FEASIBLESQPMETHOD, AUX_FILE_SLURP, AUX_FILL, AUX_FINITE_DIFF, AUX_FLIP, AUX_FMAX, AUX_FMIN, AUX_FPRINTF_SCALAR, AUX_FPRINTF_VECTOR, AUX_FROM_MEX, AUX_HYPOT, AUX_IAMAX, AUX_IF_ELSE, AUX_INF, AUX_INTERPN, AUX_INTERPN_GRAD, AUX_INTERPN_INTERPOLATE, AUX_INTERPN_WEIGHTS, AUX_ISFINITE, AUX_ISINF, AUX_KRON, AUX_KRON_CONTRACT_INNER, AUX_KRON_CONTRACT_INNER_DENSE, AUX_KRON_CONTRACT_INNER_DENSE_SPARSE, AUX_KRON_CONTRACT_INNER_SPARSE_DENSE, AUX_KRON_CONTRACT_OUTER, AUX_KRON_CONTRACT_OUTER_DENSE, AUX_KRON_CONTRACT_OUTER_DENSE_SPARSE, AUX_KRON_CONTRACT_OUTER_SPARSE_DENSE, AUX_KRON_DENSE, AUX_KRON_DENSE_SPARSE, AUX_KRON_SPARSE_DENSE, 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_MTIMES_DENSE, AUX_MTIMES_DENSE_SPARSE, 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_PRINT_CANONICAL, AUX_PRINT_SCALAR, AUX_PRINT_VECTOR, 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_SOCP, AUX_SPARSIFY, AUX_SPARSITY, AUX_SQ, AUX_SQPMETHOD, AUX_SUM, AUX_SUM_VIOL, AUX_SWAP, AUX_TENSOR_TTV, AUX_THREADS, AUX_TO_DOUBLE, AUX_TO_FILE, 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, casadi::Blas::codegen_axpy_aux(), casadi::Blas::codegen_copy_aux(), casadi::Blas::codegen_dot_aux(), casadi::Blas::codegen_norm_1_aux(), casadi::Blas::codegen_norm_2_aux(), casadi::Blas::codegen_scal_aux(), cpp, infinity, l1_blas, mex, nan, real_min, and sanitize_source().
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::MosekInterface::codegen_body(), casadi::OsqpInterface::codegen_body(), casadi::XpressInterface::codegen_body(), casadi::FastNewton::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::Qrqp::codegen_body(), casadi::Sqpmethod::codegen_body(), casadi::FiniteDiff::codegen_declarations(), casadi::ThreadMap::codegen_declarations(), casadi::Nlpsol::codegen_declarations(), casadi::MadmpecInterface::codegen_declarations(), casadi::FatropInterface::codegen_declarations(), casadi::IpoptInterface::codegen_declarations(), casadi::MadnlpInterface::codegen_declarations(), casadi::UnoInterface::codegen_declarations(), casadi::Sqpmethod::codegen_declarations(), CodeGenerator(), constant(), convexify_eval(), copy(), densify(), det(), dot(), dump(), file_slurp(), fill(), fmax(), fmin(), fprintf_scalar(), fprintf_vector(), from_mex(), casadi::BSplineCommon::generate(), casadi::Kron::generate(), casadi::DenseKron::generate(), casadi::DenseSparseKron::generate(), casadi::SparseDenseKron::generate(), casadi::KronContract::generate(), casadi::DenseKronContract::generate(), casadi::DenseSparseKronContract::generate(), casadi::SparseDenseKronContract::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(), mtimes_dense_sparse(), mv(), norm_1(), norm_2(), norm_inf(), print_canonical(), print_op(), print_scalar(), print_vector(), printf(), project(), casadi::Conic::qp_codegen_body(), qr(), qr_solve(), rank1(), regularize(), scal(), sparsify(), sum_viol(), to_file(), 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 315 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_is_opaque(), casadi::FunctionInternal::codegen_needs_mem(), casadi::FunctionInternal::codegen_release(), flush(), casadi::FunctionInternal::has_refcount_in_deps_, 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::MadmpecInterface::codegen_declarations(), casadi::FatropInterface::codegen_declarations(), casadi::IpoptInterface::codegen_declarations(), casadi::MadnlpInterface::codegen_declarations(), casadi::UnoInterface::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 1310 of file code_generator.cpp.
References added_externals_.
Referenced by casadi::blasfeo_codegen_mtimes(), casadi::classic_codegen_mtimes(), and 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 1233 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::MosekInterface::codegen_body(), casadi::OsqpInterface::codegen_body(), casadi::XpressInterface::codegen_body(), casadi::Blas::codegen_copy_aux(), casadi::MadmpecInterface::codegen_declarations(), casadi::FatropInterface::codegen_declarations(), casadi::IpoptInterface::codegen_declarations(), casadi::MadnlpInterface::codegen_declarations(), casadi::OnnxRuntimeInterface::codegen_declarations(), casadi::UnoInterface::codegen_declarations(), CodeGenerator(), and generate_dump().
| 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 2786 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 1327 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 2262 of file code_generator.cpp.
References casadi::str().
Referenced by casadi::BlazingSplineFunction::codegen_body(), 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(), fprintf_scalar(), fprintf_vector(), from_mex(), casadi::Input::generate(), operator()(), print_canonical(), print_scalar(), print_vector(), printf(), project(), sparsify(), to_mex(), and tri_project().
|
static |
Declare an array
Definition at line 1123 of file code_generator.cpp.
References name.
Referenced by casadi::codegen_int_array(), casadi::FunctionInternal::codegen_meta(), and print_vector().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_si
Definition at line 301 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 2447 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 2294 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 2983 of file code_generator.cpp.
References add_auxiliary(), AUX_BOUNDS_CONSISTENCY, and casadi::str().
Referenced by casadi::Feasiblesqpmethod::codegen_body(), and casadi::Nlpsol::codegen_post_solve().
| 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 3091 of file code_generator.cpp.
References add_auxiliary(), AUX_CACHE, and casadi::str().
Referenced by casadi::LinsolQr::generate_factorize().
|
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 2254 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 2459 of file code_generator.cpp.
References add_auxiliary(), AUX_CLIP_MAX, min(), and casadi::str().
Referenced by casadi::OsqpInterface::codegen_body(), 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 2453 of file code_generator.cpp.
References add_auxiliary(), AUX_CLIP_MIN, min(), and casadi::str().
Referenced by casadi::OsqpInterface::codegen_body(), 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 2780 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::Lsqr::generate(), and casadi::LinsolQr::generate_factorize().
| std::string casadi::CodeGenerator::constant | ( | casadi_int | v | ) |
Definition at line 2189 of file code_generator.cpp.
References casadi::str().
| std::string casadi::CodeGenerator::constant | ( | char | v | ) |
Definition at line 2193 of file code_generator.cpp.
References constant().
| std::string casadi::CodeGenerator::constant | ( | const std::string & | v | ) |
Definition at line 2182 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 1462 of file code_generator.cpp.
References get_constant(), shorthand(), and casadi::str().
Referenced by casadi::BlazingSplineFunction::codegen_body(), casadi::FiniteDiff::codegen_body(), casadi::SXFunction::codegen_body(), casadi::FatropInterface::codegen_body(), casadi::HighsInterface::codegen_body(), casadi::MosekInterface::codegen_body(), casadi::OnnxRuntimeInterface::codegen_body(), casadi::OsqpInterface::codegen_body(), casadi::XpressInterface::codegen_body(), casadi::FastNewton::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::LinearInterpolant::codegen_body(), casadi::LinearInterpolantJac::codegen_body(), casadi::Qrqp::codegen_body(), casadi::External::codegen_incref(), casadi::MadmpecInterface::codegen_init_mem(), casadi::OsqpInterface::codegen_init_mem(), casadi::UnoInterface::codegen_init_mem(), casadi::FunctionInternal::codegen_meta(), casadi::Nlpsol::codegen_setup_constants(), 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(), casadi::LinsolQr::generate_factorize(), casadi::DaqpInterface::set_daqp_prob(), casadi::FatropInterface::set_fatrop_prob(), casadi::HpipmInterface::set_hpipm_prob(), casadi::MosekInterface::set_mosek_prob(), and casadi::XpressInterface::set_xpress_prob().
| std::string casadi::CodeGenerator::constant | ( | const std::vector< char > & | v | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_27m
Definition at line 1466 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 1500 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 133 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 1470 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 2196 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 1484 of file code_generator.cpp.
References constant(), init_local(), local(), name, and casadi::str().
Referenced by casadi::OsqpInterface::codegen_init_mem(), and casadi::codegen_int_field().
| 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 2970 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 2220 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::codegen_copy_z(), casadi::Feasiblesqpmethod::codegen_feasibility_iterations(), casadi::Nlpsol::codegen_post_solve(), casadi::Sqpmethod::codegen_solve_elastic_mode(), casadi::Feasiblesqpmethod::codegen_step_update(), copy_check(), copy_default(), casadi::ConstantDM::generate(), casadi::ConstantFile::generate(), casadi::ConstantPool::generate(), casadi::Einstein::generate(), casadi::Input::generate(), casadi::Output::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(), casadi::LinsolQr::generate_factorize(), 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 2234 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_post_solve().
| 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 2243 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_setup_per_call().
| std::string casadi::CodeGenerator::declare | ( | std::string | s | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_tm
Definition at line 2345 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_local_mutex | ( | const Function & | f, |
| const std::string & | name | ||
| ) |
(thread-safe mode only, idempotent)
Extra doc: https://github.com/casadi/casadi/wiki/L_2fm
Definition at line 909 of file code_generator.cpp.
References auxiliaries, casadi::Function::get(), local_mutexes_, name, shorthand(), and thread_safe().
Referenced by casadi::FunctionInternal::codegen(), casadi::FatropInterface::codegen_body(), and casadi::FunctionInternal::codegen_checkout().
| 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 891 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 863 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 877 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 2385 of file code_generator.cpp.
References add_auxiliary(), arg(), AUX_DENSIFY, res(), and sparsity().
Referenced by casadi::Densify::generate().
| std::string casadi::CodeGenerator::det | ( | const std::string & | sp_v, |
| const std::string & | v, | ||
| const std::string & | sp_r, | ||
| const std::string & | r, | ||
| const std::string & | beta | ||
| ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2hy
Definition at line 2823 of file code_generator.cpp.
References add_auxiliary(), and AUX_DET.
Referenced by casadi::LinsolQr::generate_det().
| 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 2286 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 444 of file code_generator.cpp.
Referenced by generate().
| void casadi::CodeGenerator::dump | ( | std::ostream & | s | ) |
Definition at line 939 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 2229 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 |
| 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 2991 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 2276 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 2595 of file code_generator.cpp.
References buffer.
Referenced by add(), add_dependency(), casadi::FunctionInternal::codegen(), casadi::ThreadMap::codegen_declarations(), 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 2868 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 2874 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 2166 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 1116 of file code_generator.cpp.
References padding_length_.
Referenced by casadi::MXFunction::codegen_body(), sx_work(), work(), and workel().
| std::string casadi::CodeGenerator::fprintf_scalar | ( | const std::string & | f, |
| const std::string & | arg | ||
| ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2fp
Definition at line 1178 of file code_generator.cpp.
References add_auxiliary(), arg(), and AUX_FPRINTF_SCALAR.
| std::string casadi::CodeGenerator::fprintf_vector | ( | const std::string & | f, |
| casadi_int | sz, | ||
| const std::string & | arg, | ||
| const std::string & | sep | ||
| ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2fq
Definition at line 1185 of file code_generator.cpp.
References add_auxiliary(), arg(), and AUX_FPRINTF_VECTOR.
Referenced by generate_dump().
| 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 2153 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 531 of file code_generator.cpp.
References added_sfunctions, cpp, dump(), exposed_fname, header, main, mex, name, casadi::Filesystem::ofstream_ptr(), pool_double_, pool_double_defaults_, prefix, casadi::str(), stream_close(), stream_open(), 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().
| void casadi::CodeGenerator::generate_dump | ( | const Function & | f, |
| const std::string & | arr, | ||
| bool | is_input | ||
| ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2fr
Definition at line 3003 of file code_generator.cpp.
References add_include(), casadi::FunctionInternal::dump_dir_, dump_dir_prefix, dump_dir_suffix, casadi::FunctionInternal::dump_format_, casadi::Filesystem::ensure_directory_exists(), casadi::Filesystem::ensure_trailing_slash(), fprintf_vector(), casadi::Filesystem::is_enabled(), casadi::Function::n_in(), casadi::Function::n_out(), casadi::Function::name(), casadi::Function::name_in(), casadi::Function::name_out(), casadi::Sparsity::nnz(), prefix, printf(), casadi::Function::sparsity_in(), casadi::Function::sparsity_out(), casadi::str(), to_file(), and casadi::ProtoFunction::verbose_.
Referenced by casadi::FunctionInternal::codegen().
| void casadi::CodeGenerator::generate_print | ( | const Function & | f, |
| const std::string & | arr, | ||
| bool | is_input | ||
| ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2fs
Definition at line 3076 of file code_generator.cpp.
References casadi::Function::n_in(), casadi::Function::n_out(), casadi::Function::name(), casadi::Function::name_in(), casadi::Function::name_out(), print_canonical(), printf(), casadi::Function::sparsity_in(), casadi::Function::sparsity_out(), and casadi::str().
Referenced by casadi::FunctionInternal::codegen().
| 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 1393 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 1416 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 1371 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 1439 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 1335 of file code_generator.cpp.
References get_constant().
|
static |
Definition at line 1353 of file code_generator.cpp.
References casadi::hash_combine().
|
static |
Definition at line 1359 of file code_generator.cpp.
References casadi::hash_combine().
|
static |
Definition at line 1339 of file code_generator.cpp.
References casadi::hash_combine().
Referenced by get_constant().
|
static |
Definition at line 1365 of file code_generator.cpp.
References casadi::hash_combine().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_sg
Definition at line 291 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 2627 of file code_generator.cpp.
References local_default_, and name.
Referenced by casadi::blasfeo_codegen_mtimes(), casadi::classic_codegen_mtimes(), casadi::FiniteDiff::codegen_body(), casadi::OmpMap::codegen_body(), casadi::ThreadMap::codegen_body(), casadi::MXFunction::codegen_body(), casadi::MadmpecInterface::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::MosekInterface::codegen_body(), casadi::OsqpInterface::codegen_body(), casadi::UnoInterface::codegen_body(), casadi::XpressInterface::codegen_body(), casadi::Feasiblesqpmethod::codegen_body(), casadi::Sqpmethod::codegen_body(), casadi::Feasiblesqpmethod::codegen_feasibility_iterations(), casadi::UnoInterface::codegen_init_mem(), casadi::codegen_local(), casadi::Nlpsol::codegen_post_solve(), and constant_copy().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_sk
Definition at line 325 of file code_generator.hpp.
References casadi::T.
Referenced by casadi::codegen_int_array(), 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 2312 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 2325 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 2958 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 2850 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 2859 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 2600 of file code_generator.cpp.
References local_variables_, and name.
Referenced by casadi::blasfeo_codegen_mtimes(), casadi::classic_codegen_mtimes(), casadi::FiniteDiff::codegen_body(), casadi::JitFunction::codegen_body(), casadi::Map::codegen_body(), casadi::OmpMap::codegen_body(), casadi::ThreadMap::codegen_body(), casadi::MapSum::codegen_body(), casadi::MXFunction::codegen_body(), casadi::Switch::codegen_body(), casadi::MadmpecInterface::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::MosekInterface::codegen_body(), casadi::OsqpInterface::codegen_body(), casadi::UnoInterface::codegen_body(), casadi::XpressInterface::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::FunctionInternal::codegen_checkout(), casadi::Feasiblesqpmethod::codegen_feasibility_iterations(), casadi::OsqpInterface::codegen_init_mem(), casadi::UnoInterface::codegen_init_mem(), casadi::codegen_local(), casadi::Nlpsol::codegen_post_solve(), 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::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(), casadi::LinsolQr::generate_factorize(), operator()(), casadi::Conic::qp_codegen_body(), scope_return(), casadi::MosekInterface::set_mosek_prob(), casadi::XpressInterface::set_xpress_prob(), and sx_work().
| std::string casadi::CodeGenerator::local_mutex | ( | const Function & | f, |
| const std::string & | name | ||
| ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2fn
Definition at line 922 of file code_generator.cpp.
References casadi::Function::get(), local_mutexes_, name, and shorthand().
Referenced by casadi::FunctionInternal::codegen(), casadi::FatropInterface::codegen_body(), casadi::FunctionInternal::codegen_checkout(), casadi::FunctionInternal::codegen_decref(), casadi::FunctionInternal::codegen_incref(), and casadi::FunctionInternal::codegen_release().
| const std::set< std::string > & casadi::CodeGenerator::local_mutexes | ( | const Function & | f | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_2fo
Definition at line 932 of file code_generator.cpp.
References casadi::empty_mutex_set_, casadi::Function::get(), and local_mutexes_.
Referenced by casadi::FunctionInternal::codegen_decref(), and casadi::FunctionInternal::codegen_incref().
| std::string casadi::CodeGenerator::logsumexp | ( | const std::string & | A, |
| casadi_int | n | ||
| ) |
\brie LogSumExp
Definition at line 2541 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 2977 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 2842 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 2477 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 2904 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 2928 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 2270 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 2910 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 2916 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 2922 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, |
| casadi_int | nrow_x, | ||
| casadi_int | ncol_x, | ||
| const std::string & | y, | ||
| casadi_int | ncol_y, | ||
| const std::string & | z, | ||
| bool | tr | ||
| ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2gc
Definition at line 2511 of file code_generator.cpp.
References add_auxiliary(), AUX_MTIMES_DENSE, and casadi::str().
| 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 2502 of file code_generator.cpp.
References add_auxiliary(), AUX_MTIMES, and sparsity().
Referenced by casadi::Blas::codegen_mtimes(), and casadi::Multiplication::generate().
| std::string casadi::CodeGenerator::mtimes_dense_sparse | ( | const std::string & | x, |
| casadi_int | nrow_x, | ||
| const std::string & | y, | ||
| const Sparsity & | sp_y, | ||
| const std::string & | z | ||
| ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2gd
Definition at line 2519 of file code_generator.cpp.
References add_auxiliary(), AUX_MTIMES_DENSE_SPARSE, sparsity(), and casadi::str().
Referenced by casadi::DenseSparseMultiplication::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 2495 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 2488 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 2946 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 2952 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 2940 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 1479 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 1272 of file code_generator.cpp.
References add_dependency(), arg(), casadi::FunctionInternal::codegen_name(), casadi::FunctionInternal::codegen_needs_mem(), local(), mem(), name, res(), and shorthand().
| CodeGenerator & casadi::CodeGenerator::operator<< | ( | const std::string & | s | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_s7
Definition at line 2574 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 233 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 903 of file code_generator.cpp.
References name, pool_double_, and casadi::str().
Referenced by casadi::ConstantPool::generate().
| std::string casadi::CodeGenerator::print_canonical | ( | const Sparsity & | sp, |
| const std::string & | arg | ||
| ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2dk
Definition at line 1157 of file code_generator.cpp.
References add_auxiliary(), arg(), AUX_PRINT_CANONICAL, and sparsity().
Referenced by casadi::Monitor::generate(), generate_print(), casadi::MXFunction::print_arg(), and casadi::MXFunction::print_res().
| void casadi::CodeGenerator::print_formatted | ( | const std::string & | s | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_s8
Definition at line 2548 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 1193 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 1214 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().
| std::string casadi::CodeGenerator::print_scalar | ( | const std::string & | arg | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2dm
Definition at line 1171 of file code_generator.cpp.
References add_auxiliary(), arg(), and AUX_PRINT_SCALAR.
| std::string casadi::CodeGenerator::print_vector | ( | casadi_int | sz, |
| const std::string & | arg | ||
| ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2dl
Definition at line 1164 of file code_generator.cpp.
References add_auxiliary(), arg(), and AUX_PRINT_VECTOR.
| 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 1137 of file code_generator.cpp.
References array(), initializer(), and name.
Referenced by dump(), casadi::SXFunction::print_arg(), and casadi::SXFunction::print_res().
| 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 1142 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 1147 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 1152 of file code_generator.cpp.
References array(), initializer(), and name.
| std::string casadi::CodeGenerator::printf | ( | const std::string & | str, |
| const std::string & | arg1 | ||
| ) |
| 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 2406 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::Dump::generate(), casadi::Monitor::generate(), generate_dump(), generate_print(), casadi::MXFunction::print_arg(), casadi::SXFunction::print_arg(), casadi::MXFunction::print_res(), casadi::SXFunction::print_res(), 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 2359 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 2812 of file code_generator.cpp.
References add_auxiliary(), and AUX_QR.
Referenced by casadi::LinsolQr::generate_factorize().
| 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 2830 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 2302 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 2964 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 2266 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 1107 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 870 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 884 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 2657 of file code_generator.cpp.
References inline_aux, casadi::next_quoted_token(), casadi::replace(), shorthand(), static_aux, casadi::str(), suffix, and verbose_runtime.
Referenced by add_auxiliary(), casadi::blasfeo_codegen_axpy_aux(), casadi::blasfeo_codegen_dot_aux(), casadi::classic_codegen_asum_aux(), casadi::classic_codegen_axpy_aux(), casadi::classic_codegen_dot_aux(), casadi::classic_codegen_nrm2_aux(), casadi::classic_codegen_scal_aux(), casadi::MadmpecInterface::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::MosekInterface::codegen_body(), casadi::XpressInterface::codegen_body(), casadi::Blas::codegen_copy_aux(), and casadi::UnoInterface::codegen_declarations().
| 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 2483 of file code_generator.cpp.
References add_auxiliary(), AUX_SCAL, and casadi::str().
Referenced by casadi::Sqpmethod::codegen_body(), and casadi::Nlpsol::codegen_post_solve().
| void casadi::CodeGenerator::scope_add_cleanup | ( | const std::string & | code | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2f6
Definition at line 256 of file code_generator.cpp.
References local_cleanup_.
Referenced by casadi::FunctionInternal::codegen_checkout(), and casadi::FunctionInternal::codegen_release().
| void casadi::CodeGenerator::scope_enter | ( | ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_sc
Definition at line 229 of file code_generator.cpp.
References local_cleanup_, local_default_, local_variables_, and local_void_.
Referenced by add_dependency(), casadi::FunctionInternal::codegen(), casadi::ThreadMap::codegen_declarations(), 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 260 of file code_generator.cpp.
References body, local_cleanup_, local_default_, local_variables_, local_void_, and max_declarations_per_line.
Referenced by add_dependency(), casadi::FunctionInternal::codegen(), casadi::ThreadMap::codegen_declarations(), casadi::FatropInterface::codegen_declarations(), and casadi::IpoptInterface::codegen_declarations().
| void casadi::CodeGenerator::scope_return | ( | ) |
Takes care of cleanup code
Extra doc: https://github.com/casadi/casadi/wiki/L_2f5
Definition at line 247 of file code_generator.cpp.
References local_cleanup_.
| void casadi::CodeGenerator::scope_return | ( | const std::string & | value | ) |
Takes care of cleanup code
Extra doc: https://github.com/casadi/casadi/wiki/L_2f4
Definition at line 236 of file code_generator.cpp.
References local(), local_cleanup_, and local_void_.
Referenced by casadi::FunctionInternal::codegen_checkout(), and casadi::FunctionInternal::codegen_release().
| 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 1255 of file code_generator.cpp.
References add_dependency(), casadi::FunctionInternal::codegen_needs_mem(), and name.
Referenced by casadi::MadmpecInterface::set_ccopt_prob(), casadi::FatropInterface::set_fatrop_prob(), and casadi::MadnlpInterface::set_madnlp_prob().
| std::string casadi::CodeGenerator::shorthand | ( | const std::string & | name | ) | const |
Definition at line 1314 of file code_generator.cpp.
References added_shorthands_, and name.
Referenced by add_dependency(), casadi::FunctionInternal::codegen(), casadi::FunctionInternal::codegen_alloc_mem(), casadi::ThreadMap::codegen_body(), casadi::FunctionInternal::codegen_checkout(), casadi::ThreadMap::codegen_declarations(), casadi::Nlpsol::codegen_declarations(), casadi::FatropInterface::codegen_declarations(), casadi::IpoptInterface::codegen_declarations(), casadi::FunctionInternal::codegen_decref(), casadi::FunctionInternal::codegen_incref(), casadi::FunctionInternal::codegen_mem(), casadi::FunctionInternal::codegen_meta(), casadi::FunctionInternal::codegen_release(), casadi::Nlpsol::codegen_setup_constants(), constant(), define_local_mutex(), define_pool_double(), define_rom_double(), define_rom_integer(), local_mutex(), mem(), ones(), operator()(), 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 2396 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 1331 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(), casadi::Kron::generate(), casadi::DenseSparseKron::generate(), casadi::SparseDenseKron::generate(), casadi::KronContract::generate(), casadi::DenseSparseKronContract::generate(), casadi::SparseDenseKronContract::generate(), casadi::LinsolQr::generate_det(), casadi::LinsolQr::generate_factorize(), lb_eig(), mtimes(), mtimes_dense_sparse(), mv(), print_canonical(), project(), casadi::Conic::qp_codegen_body(), rank1(), regularize(), casadi::MadmpecInterface::set_ccopt_prob(), casadi::FatropInterface::set_fatrop_prob(), casadi::HpipmInterface::set_hpipm_prob(), casadi::IpoptInterface::set_ipopt_prob(), casadi::MadnlpInterface::set_madnlp_prob(), sparsify(), to_file(), to_mex(), trans(), tri_project(), trilsolve(), and triusolve().
|
static |
Definition at line 476 of file code_generator.cpp.
References cpp.
Referenced by generate(), and casadi::DaeBuilderInternal::generate_wrapper().
|
static |
Definition at line 457 of file code_generator.cpp.
References casadi_version(), and cpp.
Referenced by generate(), and casadi::DaeBuilderInternal::generate_wrapper().
| 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 2934 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 2614 of file code_generator.cpp.
References avoid_stack_, format_padded(), local(), name, and casadi::str().
Referenced by casadi::SXFunction::codegen_body(), casadi::SXFunction::print_arg(), and casadi::SXFunction::print_res().
| 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 3099 of file code_generator.cpp.
References added_functions_.
Referenced by casadi::DaeBuilderInternal::generate_wrapper().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_2f7
Definition at line 306 of file code_generator.hpp.
Referenced by casadi::FunctionInternal::codegen(), casadi::FatropInterface::codegen_body(), casadi::FunctionInternal::codegen_checkout(), casadi::FunctionInternal::codegen_decref(), casadi::FunctionInternal::codegen_incref(), casadi::FunctionInternal::codegen_release(), and define_local_mutex().
| std::string casadi::CodeGenerator::to_file | ( | const std::string & | f, |
| const Sparsity & | sp, | ||
| const std::string & | x | ||
| ) |
Extra doc: https://github.com/casadi/casadi/wiki/L_2f8
Definition at line 2997 of file code_generator.cpp.
References add_auxiliary(), AUX_TO_FILE, and sparsity().
Referenced by casadi::Dump::generate(), and generate_dump().
| 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 2146 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 2337 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 2374 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 2526 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 2533 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 296 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 2465 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 2471 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 2880 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 2892 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 2886 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 2898 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 1086 of file code_generator.cpp.
References codegen_scalars, and format_padded().
Referenced by casadi::codegen_copy_z(), 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::Determinant::generate(), casadi::Dot::generate(), casadi::Dump::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::Kron::generate(), casadi::DenseKron::generate(), casadi::DenseSparseKron::generate(), casadi::SparseDenseKron::generate(), casadi::KronContract::generate(), casadi::DenseKronContract::generate(), casadi::DenseSparseKronContract::generate(), casadi::SparseDenseKronContract::generate(), casadi::LogSumExp::generate(), casadi::MMin::generate(), casadi::MMax::generate(), casadi::Monitor::generate(), casadi::Multiplication::generate(), casadi::DenseMultiplication::generate(), casadi::DenseSparseMultiplication::generate(), casadi::PseudoDenseMultiplication::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(), casadi::MXNode::generate_copy(), casadi::MXFunction::print_arg(), and casadi::MXFunction::print_res().
| std::string casadi::CodeGenerator::workel | ( | casadi_int | n | ) | const |
Get work vector element from index
Definition at line 1099 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::Determinant::generate(), casadi::Dot::generate(), casadi::GetNonzerosSlice::generate(), casadi::GetNonzerosSliceParam::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 302 of file code_generator.cpp.
References added_wrappers_, casadi::Function::get(), name, and casadi::str().
Referenced by casadi::ThreadMap::codegen_body(), casadi::ThreadMap::codegen_declarations(), casadi::Nlpsol::codegen_declarations(), casadi::IpoptInterface::codegen_declarations(), casadi::Nlpsol::codegen_setup_constants(), and casadi::IpoptInterface::set_ipopt_prob().
| std::string casadi::CodeGenerator::zeros | ( | casadi_int | sz | ) |
Definition at line 1474 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 1158 of file code_generator.hpp.
Referenced by add_auxiliary().
| std::multimap<size_t, size_t> casadi::CodeGenerator::added_char_constants_ |
Definition at line 1161 of file code_generator.hpp.
Referenced by get_constant().
| std::multimap<size_t, size_t> casadi::CodeGenerator::added_double_constants_ |
Definition at line 1159 of file code_generator.hpp.
Referenced by get_constant().
| std::set<std::string> casadi::CodeGenerator::added_externals_ |
Definition at line 1156 of file code_generator.hpp.
Referenced by add_external(), and dump().
| std::vector<FunctionMeta> casadi::CodeGenerator::added_functions_ |
Definition at line 1180 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 1155 of file code_generator.hpp.
Referenced by add_include().
| std::multimap<size_t, size_t> casadi::CodeGenerator::added_integer_constants_ |
Definition at line 1160 of file code_generator.hpp.
Referenced by get_constant().
| std::vector<std::string> casadi::CodeGenerator::added_sfunctions |
Definition at line 1060 of file code_generator.hpp.
Referenced by add(), and generate().
| std::set<std::string> casadi::CodeGenerator::added_shorthands_ |
Definition at line 1157 of file code_generator.hpp.
Referenced by dump(), and shorthand().
| std::multimap<size_t, size_t> casadi::CodeGenerator::added_string_constants_ |
Definition at line 1162 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 1183 of file code_generator.hpp.
Referenced by wrapper().
| std::stringstream casadi::CodeGenerator::auxiliaries |
Definition at line 1130 of file code_generator.hpp.
Referenced by add_auxiliary(), casadi::blasfeo_codegen_axpy_aux(), casadi::blasfeo_codegen_dot_aux(), casadi::classic_codegen_asum_aux(), casadi::classic_codegen_axpy_aux(), casadi::classic_codegen_dot_aux(), casadi::classic_codegen_nrm2_aux(), casadi::classic_codegen_scal_aux(), casadi::FunctionInternal::codegen(), casadi::MadmpecInterface::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::MosekInterface::codegen_body(), casadi::XpressInterface::codegen_body(), casadi::FunctionInternal::codegen_checkout(), casadi::Blas::codegen_copy_aux(), casadi::UnoInterface::codegen_declarations(), casadi::FunctionInternal::codegen_incref(), define_local_mutex(), and dump().
| bool casadi::CodeGenerator::avoid_stack_ |
Definition at line 1087 of file code_generator.hpp.
Referenced by CodeGenerator(), and sx_work().
| std::stringstream casadi::CodeGenerator::body |
Definition at line 1131 of file code_generator.hpp.
Referenced by add(), add_dependency(), casadi::FunctionInternal::codegen(), casadi::ThreadMap::codegen_declarations(), casadi::FatropInterface::codegen_declarations(), casadi::IpoptInterface::codegen_declarations(), casadi::FunctionInternal::codegen_meta(), dump(), and scope_exit().
| std::stringstream casadi::CodeGenerator::buffer |
Definition at line 1133 of file code_generator.hpp.
Referenced by flush(), operator<<(), and print_formatted().
| std::string casadi::CodeGenerator::casadi_int_type |
Definition at line 1047 of file code_generator.hpp.
Referenced by CodeGenerator().
| std::string casadi::CodeGenerator::casadi_real_type |
Definition at line 1044 of file code_generator.hpp.
Referenced by CodeGenerator().
| std::vector<std::vector<char> > casadi::CodeGenerator::char_constants_ |
Definition at line 1188 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 1097 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 1078 of file code_generator.hpp.
Referenced by add_auxiliary(), CodeGenerator(), declare(), generate(), stream_close(), and stream_open().
| casadi_int casadi::CodeGenerator::current_indent_ |
Definition at line 1140 of file code_generator.hpp.
Referenced by CodeGenerator(), dump(), and print_formatted().
| std::string casadi::CodeGenerator::dll_export |
Definition at line 1119 of file code_generator.hpp.
Referenced by CodeGenerator().
| std::string casadi::CodeGenerator::dll_import |
Definition at line 1119 of file code_generator.hpp.
Referenced by CodeGenerator(), and declare().
| std::vector<std::vector<double> > casadi::CodeGenerator::double_constants_ |
Definition at line 1186 of file code_generator.hpp.
Referenced by dump(), and get_constant().
| std::string casadi::CodeGenerator::dump_dir_prefix |
Definition at line 1125 of file code_generator.hpp.
Referenced by casadi::Dump::add_dependency(), CodeGenerator(), casadi::Dump::generate(), and generate_dump().
| std::string casadi::CodeGenerator::dump_dir_suffix |
Definition at line 1126 of file code_generator.hpp.
Referenced by casadi::Dump::add_dependency(), CodeGenerator(), casadi::Dump::generate(), and generate_dump().
| std::vector<std::string> casadi::CodeGenerator::exposed_fname |
Definition at line 1149 of file code_generator.hpp.
Referenced by add(), and generate().
| std::map<const void *, casadi_int> casadi::CodeGenerator::file_scope_double_ |
Definition at line 1167 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 1168 of file code_generator.hpp.
Referenced by dump().
| bool casadi::CodeGenerator::force_canonical |
Definition at line 1109 of file code_generator.hpp.
Referenced by add_io_sparsities(), and CodeGenerator().
| std::stringstream casadi::CodeGenerator::header |
Definition at line 1132 of file code_generator.hpp.
Referenced by casadi::FunctionInternal::codegen_meta(), CodeGenerator(), declare(), and generate().
| bool casadi::CodeGenerator::include_math |
Definition at line 1084 of file code_generator.hpp.
Referenced by CodeGenerator().
| std::stringstream casadi::CodeGenerator::includes |
Definition at line 1129 of file code_generator.hpp.
Referenced by add_include(), and dump().
| casadi_int casadi::CodeGenerator::indent_ |
Definition at line 1139 of file code_generator.hpp.
Referenced by CodeGenerator(), and print_formatted().
| std::string casadi::CodeGenerator::infinity |
Definition at line 1089 of file code_generator.hpp.
Referenced by add_auxiliary(), and CodeGenerator().
| bool casadi::CodeGenerator::inline_aux |
Definition at line 1069 of file code_generator.hpp.
Referenced by CodeGenerator(), and sanitize_source().
| std::vector<std::vector<casadi_int> > casadi::CodeGenerator::integer_constants_ |
Definition at line 1187 of file code_generator.hpp.
Referenced by dump(), and get_constant().
| bool casadi::CodeGenerator::l1_blas |
Definition at line 1113 of file code_generator.hpp.
Referenced by add_auxiliary(), and CodeGenerator().
| std::vector<std::string> casadi::CodeGenerator::local_cleanup_ |
Definition at line 1164 of file code_generator.hpp.
Referenced by scope_add_cleanup(), scope_enter(), scope_exit(), and scope_return().
| std::map<std::string, std::string> casadi::CodeGenerator::local_default_ |
Definition at line 1166 of file code_generator.hpp.
Referenced by init_local(), scope_enter(), and scope_exit().
| std::map<const FunctionInternal*, std::set<std::string> > casadi::CodeGenerator::local_mutexes_ |
Definition at line 1171 of file code_generator.hpp.
Referenced by define_local_mutex(), local_mutex(), and local_mutexes().
| std::map<std::string, std::pair<std::string, std::string> > casadi::CodeGenerator::local_variables_ |
Definition at line 1163 of file code_generator.hpp.
Referenced by local(), scope_enter(), and scope_exit().
| bool casadi::CodeGenerator::local_void_ |
Definition at line 1165 of file code_generator.hpp.
Referenced by scope_enter(), scope_exit(), and scope_return().
| bool casadi::CodeGenerator::main |
Definition at line 1081 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 1103 of file code_generator.hpp.
Referenced by CodeGenerator(), and scope_exit().
| casadi_int casadi::CodeGenerator::max_initializer_elements_per_line |
Definition at line 1106 of file code_generator.hpp.
Referenced by CodeGenerator().
| bool casadi::CodeGenerator::mex |
Definition at line 1056 of file code_generator.hpp.
Referenced by add_auxiliary(), casadi::FunctionInternal::codegen_meta(), CodeGenerator(), and generate().
| std::string casadi::CodeGenerator::name |
Definition at line 1041 of file code_generator.hpp.
Referenced by add_io_sparsities(), array(), CodeGenerator(), constant_copy(), define_local_mutex(), define_pool_double(), generate(), init_local(), local(), local_mutex(), mem(), operator()(), pool_double(), print_vector(), setup_callback(), shorthand(), sx_work(), and wrapper().
| std::string casadi::CodeGenerator::nan |
Definition at line 1089 of file code_generator.hpp.
Referenced by add_auxiliary(), and CodeGenerator().
| bool casadi::CodeGenerator::needs_mem_ |
Definition at line 1192 of file code_generator.hpp.
Referenced by add_dependency(), CodeGenerator(), and dump().
| bool casadi::CodeGenerator::newline_ |
Definition at line 1136 of file code_generator.hpp.
Referenced by CodeGenerator(), operator<<(), and print_formatted().
| casadi_int casadi::CodeGenerator::padding_length_ |
Definition at line 1146 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 1170 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 1169 of file code_generator.hpp.
Referenced by define_pool_double(), dump(), and generate().
| std::string casadi::CodeGenerator::prefix |
Definition at line 1122 of file code_generator.hpp.
Referenced by CodeGenerator(), dump(), generate(), and generate_dump().
| std::string casadi::CodeGenerator::real_min |
Definition at line 1089 of file code_generator.hpp.
Referenced by add_auxiliary(), and CodeGenerator().
| std::set<std::string> casadi::CodeGenerator::sparsity_meta |
Definition at line 1152 of file code_generator.hpp.
Referenced by add_io_sparsities().
| bool casadi::CodeGenerator::static_aux |
Definition at line 1066 of file code_generator.hpp.
Referenced by CodeGenerator(), and sanitize_source().
| std::vector<std::vector<std::string> > casadi::CodeGenerator::string_constants_ |
Definition at line 1189 of file code_generator.hpp.
Referenced by dump(), and get_constant().
| std::string casadi::CodeGenerator::suffix |
Definition at line 1041 of file code_generator.hpp.
Referenced by CodeGenerator(), generate(), and sanitize_source().
| casadi_int casadi::CodeGenerator::sz_ones_ |
Definition at line 1144 of file code_generator.hpp.
Referenced by CodeGenerator(), dump(), and ones().
| casadi_int casadi::CodeGenerator::sz_zeros_ |
Definition at line 1143 of file code_generator.hpp.
Referenced by CodeGenerator(), dump(), and zeros().
| bool casadi::CodeGenerator::thread_safe_ |
Definition at line 1116 of file code_generator.hpp.
Referenced by CodeGenerator().
| bool casadi::CodeGenerator::unroll_args |
Definition at line 1063 of file code_generator.hpp.
Referenced by add(), and CodeGenerator().
| bool casadi::CodeGenerator::verbose |
Definition at line 1072 of file code_generator.hpp.
Referenced by casadi::MXFunction::codegen_body(), CodeGenerator(), and comment().
| bool casadi::CodeGenerator::verbose_runtime |
Definition at line 1075 of file code_generator.hpp.
Referenced by CodeGenerator(), and sanitize_source().
| bool casadi::CodeGenerator::with_export |
Definition at line 1100 of file code_generator.hpp.
Referenced by CodeGenerator(), and dump().
| bool casadi::CodeGenerator::with_header |
Definition at line 1053 of file code_generator.hpp.
Referenced by casadi::FunctionInternal::codegen_meta(), CodeGenerator(), declare(), and generate().
| bool casadi::CodeGenerator::with_import |
Definition at line 1100 of file code_generator.hpp.
Referenced by CodeGenerator(), and generate().
| bool casadi::CodeGenerator::with_mem |
Definition at line 1050 of file code_generator.hpp.
Referenced by casadi::FunctionInternal::codegen_meta(), CodeGenerator(), and dump().
| bool casadi::CodeGenerator::with_sfunction |
Definition at line 1059 of file code_generator.hpp.
Referenced by add(), CodeGenerator(), and generate().