Sparse matrix class. SX and DM are specializations. More...
#include <matrix_decl.hpp>
General sparse matrix class that is designed with the idea that "everything is a matrix", that is, also scalars and vectors.
This philosophy makes it easy to use and to interface in particularly with Python and Matlab/Octave.
Index starts with 0.
Index vec happens as follows: (rr, cc) -> k = rr+cc*size1()
Vectors are column vectors.
The storage format is Compressed Column Storage (CCS), similar to that used for sparse matrices in Matlab,
but unlike this format, we do allow for elements to be structurally non-zero but numerically zero.
Matrix<Scalar> is polymorphic with a std::vector<Scalar> that contain all non-identical-zero elements.
The sparsity can be accessed with Sparsity& sparsity()
Extra doc: https://github.com/casadi/casadi/wiki/L_18e
Definition at line 95 of file matrix_decl.hpp.
Public Types | |
typedef Scalar | ScalarType |
Scalar type. More... | |
typedef GenericMatrix< Matrix< Scalar > > | B |
Base class. More... | |
Public Member Functions | |
Matrix () | |
constructors More... | |
Matrix (const Matrix< Scalar > &m) | |
Copy constructor. More... | |
Matrix< Scalar > & | operator= (const Matrix< Scalar > &m) |
Assignment (normal) More... | |
Matrix (casadi_int nrow, casadi_int ncol) | |
Create a sparse matrix with all structural zeros. More... | |
Matrix (const std::pair< casadi_int, casadi_int > &rc) | |
Create a sparse matrix with all structural zeros. More... | |
std::vector< Scalar > * | operator-> () |
Access functions of the node. More... | |
const std::vector< Scalar > * | operator-> () const |
Const access functions of the node. More... | |
Matrix (const Sparsity &sp) | |
Create a sparse matrix from a sparsity pattern. More... | |
Matrix (const Sparsity &sp, const Matrix< Scalar > &d) | |
Construct matrix with a given sparsity and nonzeros. More... | |
Matrix (double val) | |
This constructor enables implicit type conversion from a numeric type. More... | |
Matrix (const std::vector< std::vector< double > > &m) | |
Dense matrix constructor with data given as vector of vectors. More... | |
template<typename A > | |
Matrix (const std::vector< A > &x) | |
Create an expression from a vector. More... | |
template<typename A > | |
Matrix (const Matrix< A > &x) | |
Create a matrix from another matrix with a different entry type. More... | |
Matrix (const std::vector< Scalar > &x) | |
Construct from a vector. More... | |
Matrix (std::initializer_list< Scalar > x) | |
Construct from initializer list. More... | |
const Scalar | scalar () const |
Convert to scalar type. More... | |
bool | has_nz (casadi_int rr, casadi_int cc) const |
Returns true if the matrix has a non-zero at location rr, cc. More... | |
bool | __nonzero__ () const |
Returns the truth value of a Matrix. More... | |
Matrix< Scalar > | operator+ () const |
Matrix< Scalar > | operator- () const |
Matrix< Scalar > | printme (const Matrix< Scalar > &y) const |
Matrix< Scalar > | T () const |
Transpose the matrix. More... | |
void | print_split (std::vector< std::string > &nz, std::vector< std::string > &inter) const |
Get strings corresponding to the nonzeros and the interdependencies. More... | |
void | disp (std::ostream &stream, bool more=false) const |
Print a representation of the object. More... | |
std::string | get_str (bool more=false) const |
Get string representation. More... | |
void | print_scalar (std::ostream &stream) const |
Print scalar. More... | |
void | print_vector (std::ostream &stream, bool truncate=true) const |
Print vector-style. More... | |
void | print_dense (std::ostream &stream, bool truncate=true) const |
Print dense matrix-stype. More... | |
void | print_sparse (std::ostream &stream, bool truncate=true) const |
Print sparse matrix style. More... | |
void | clear () |
void | resize (casadi_int nrow, casadi_int ncol) |
void | reserve (casadi_int nnz) |
void | reserve (casadi_int nnz, casadi_int ncol) |
void | erase (const std::vector< casadi_int > &rr, const std::vector< casadi_int > &cc, bool ind1=false) |
Erase a submatrix (leaving structural zeros in its place) More... | |
void | erase (const std::vector< casadi_int > &rr, bool ind1=false) |
Erase a submatrix (leaving structural zeros in its place) More... | |
void | remove (const std::vector< casadi_int > &rr, const std::vector< casadi_int > &cc) |
Remove columns and rows. More... | |
void | enlarge (casadi_int nrow, casadi_int ncol, const std::vector< casadi_int > &rr, const std::vector< casadi_int > &cc, bool ind1=false) |
Enlarge matrix. More... | |
const Sparsity & | sparsity () const |
Const access the sparsity - reference to data member. More... | |
Sparsity | get_sparsity () const |
Get an owning reference to the sparsity pattern. More... | |
Matrix< Scalar > | get_output (casadi_int oind) const |
Get an output. More... | |
casadi_int | element_hash () const |
Returns a number that is unique for a given symbolic scalar. More... | |
bool | is_regular () const |
Checks if expression does not contain NaN or Inf. More... | |
bool | is_smooth () const |
Check if smooth. More... | |
bool | is_leaf () const |
Check if SX is a leaf of the SX graph. More... | |
bool | is_commutative () const |
Check whether a binary SX is commutative. More... | |
bool | is_symbolic () const |
Check if symbolic (Dense) More... | |
bool | is_valid_input () const |
Check if matrix can be used to define function inputs. More... | |
bool | has_duplicates () const |
Detect duplicate symbolic expressions. More... | |
void | reset_input () const |
Reset the marker for an input expression. More... | |
bool | is_constant () const |
Check if the matrix is constant (note that false negative answers are possible) More... | |
bool | is_call () const |
Check if function call. More... | |
bool | is_output () const |
Check if evaluation output. More... | |
bool | has_output () const |
Check if a multiple output node. More... | |
casadi_int | which_output () const |
Get the index of evaluation output - only valid when is_output() is true. More... | |
Function | which_function () const |
Get function - only valid when is_call() is true. More... | |
bool | is_integer () const |
Check if the matrix is integer-valued. More... | |
bool | is_zero () const |
check if the matrix is 0 (note that false negative answers are possible) More... | |
bool | is_one () const |
check if the matrix is 1 (note that false negative answers are possible) More... | |
bool | is_minus_one () const |
check if the matrix is -1 (note that false negative answers are possible) More... | |
bool | is_eye () const |
check if the matrix is an identity matrix (note that false negative answers More... | |
casadi_int | op () const |
Get operation type. More... | |
bool | is_op (casadi_int op) const |
Is it a certain operation. More... | |
bool | has_zeros () const |
Check if the matrix has any zero entries which are not structural zeros. More... | |
std::vector< Scalar > | get_nonzeros () const |
Get all nonzeros. More... | |
std::vector< Scalar > | get_elements () const |
Get all elements. More... | |
template<typename A > | |
std::vector< A > | get_nonzeros () const |
Get all nonzeros. More... | |
operator double () const | |
Type conversion to double. More... | |
operator casadi_int () const | |
Type conversion to casadi_int. More... | |
template<typename A > | |
operator std::vector< A > () const | |
Type conversion to a vector. More... | |
std::string | name () const |
Get name (only if symbolic scalar) More... | |
Matrix< Scalar > | dep (casadi_int ch=0) const |
Get expressions of the children of the expression. More... | |
casadi_int | n_dep () const |
Get the number of dependencies of a binary SXElem. More... | |
void | export_code (const std::string &lang, std::ostream &stream=casadi::uout(), const Dict &options=Dict()) const |
Export matrix in specific language. More... | |
Dict | info () const |
void | serialize (std::ostream &stream) const |
Serialize an object. More... | |
std::string | serialize () const |
Serialize. More... | |
void | serialize (SerializingStream &s) const |
Serialize an object. More... | |
void | to_file (const std::string &filename, const std::string &format="") const |
Matrix (const Sparsity &sp, const Scalar &val, bool dummy) | |
Sparse matrix with a given sparsity with all values same. More... | |
Matrix (const Sparsity &sp, const std::vector< Scalar > &d, bool dummy) | |
Sparse matrix with a given sparsity and non-zero elements. More... | |
casadi_int | nnz () const |
Get the number of (structural) non-zero elements. More... | |
casadi_int | nnz_lower () const |
Get the number of non-zeros in the lower triangular half. More... | |
casadi_int | nnz_upper () const |
Get the number of non-zeros in the upper triangular half. More... | |
casadi_int | nnz_diag () const |
Get get the number of non-zeros on the diagonal. More... | |
casadi_int | numel () const |
Get the number of elements. More... | |
casadi_int | size1 () const |
Get the first dimension (i.e. number of rows) More... | |
casadi_int | rows () const |
Get the number of rows, Octave-style syntax. More... | |
casadi_int | size2 () const |
Get the second dimension (i.e. number of columns) More... | |
casadi_int | columns () const |
Get the number of columns, Octave-style syntax. More... | |
std::string | dim (bool with_nz=false) const |
Get string representation of dimensions. More... | |
std::pair< casadi_int, casadi_int > | size () const |
Get the shape. More... | |
casadi_int | size (casadi_int axis) const |
Get the size along a particular dimensions. More... | |
bool | is_empty (bool both=false) const |
Check if the sparsity is empty, i.e. if one of the dimensions is zero. More... | |
bool | is_dense () const |
Check if the matrix expression is dense. More... | |
bool | is_scalar (bool scalar_and_dense=false) const |
Check if the matrix expression is scalar. More... | |
bool | is_square () const |
Check if the matrix expression is square. More... | |
bool | is_vector () const |
Check if the matrix is a row or column vector. More... | |
bool | is_row () const |
Check if the matrix is a row vector (i.e. size1()==1) More... | |
bool | is_column () const |
Check if the matrix is a column vector (i.e. size2()==1) More... | |
bool | is_triu () const |
Check if the matrix is upper triangular. More... | |
bool | is_tril () const |
Check if the matrix is lower triangular. More... | |
const Matrix< Scalar > | nz (const K &k) const |
Get vector nonzero or slice of nonzeros. More... | |
NonZeros< Matrix< Scalar >, K > | nz (const K &k) |
Access vector nonzero or slice of nonzeros. More... | |
const Matrix< Scalar > | operator() (const RR &rr) const |
Get vector element or slice. More... | |
const Matrix< Scalar > | operator() (const RR &rr, const CC &cc) const |
Get Matrix element or slice. More... | |
SubIndex< Matrix< Scalar >, RR > | operator() (const RR &rr) |
Access Matrix elements (one argument) More... | |
SubMatrix< Matrix< Scalar >, RR, CC > | operator() (const RR &rr, const CC &cc) |
Access Matrix elements (two arguments) More... | |
void | get (Matrix< Scalar > &m, bool ind1, const Slice &rr) const |
void | get (Matrix< Scalar > &m, bool ind1, const Matrix< casadi_int > &rr) const |
void | get (Matrix< Scalar > &m, bool ind1, const Sparsity &sp) const |
void | get (Matrix< Scalar > &m, bool ind1, const Slice &rr, const Slice &cc) const |
void | get (Matrix< Scalar > &m, bool ind1, const Slice &rr, const Matrix< casadi_int > &cc) const |
void | get (Matrix< Scalar > &m, bool ind1, const Matrix< casadi_int > &rr, const Slice &cc) const |
void | get (Matrix< Scalar > &m, bool ind1, const Matrix< casadi_int > &rr, const Matrix< casadi_int > &cc) const |
void | set (const Matrix< Scalar > &m, bool ind1, const Slice &rr) |
void | set (const Matrix< Scalar > &m, bool ind1, const Matrix< casadi_int > &rr) |
void | set (const Matrix< Scalar > &m, bool ind1, const Sparsity &sp) |
void | set (const Matrix< Scalar > &m, bool ind1, const Slice &rr, const Slice &cc) |
void | set (const Matrix< Scalar > &m, bool ind1, const Slice &rr, const Matrix< casadi_int > &cc) |
void | set (const Matrix< Scalar > &m, bool ind1, const Matrix< casadi_int > &rr, const Slice &cc) |
void | set (const Matrix< Scalar > &m, bool ind1, const Matrix< casadi_int > &rr, const Matrix< casadi_int > &cc) |
void | get_nz (Matrix< Scalar > &m, bool ind1, const Slice &k) const |
void | get_nz (Matrix< Scalar > &m, bool ind1, const Matrix< casadi_int > &k) const |
void | set_nz (const Matrix< Scalar > &m, bool ind1, const Slice &k) |
void | set_nz (const Matrix< Scalar > &m, bool ind1, const Matrix< casadi_int > &k) |
std::vector< Scalar > & | nonzeros () |
const std::vector< Scalar > & | nonzeros () const |
std::vector< casadi_int > | get_row () const |
Get the sparsity pattern. See the Sparsity class for details. More... | |
std::vector< casadi_int > | get_colind () const |
Get the sparsity pattern. See the Sparsity class for details. More... | |
const casadi_int * | row () const |
Get the sparsity pattern. See the Sparsity class for details. More... | |
casadi_int | row (casadi_int el) const |
Get the sparsity pattern. See the Sparsity class for details. More... | |
const casadi_int * | colind () const |
Get the sparsity pattern. See the Sparsity class for details. More... | |
casadi_int | colind (casadi_int col) const |
Get the sparsity pattern. See the Sparsity class for details. More... | |
Static Public Member Functions | |
static void | set_max_depth (casadi_int eq_depth=1) |
Set or reset the depth to which equalities are being checked for simplifications. More... | |
static casadi_int | get_max_depth () |
Get the depth to which equalities are being checked for simplifications. More... | |
static std::vector< Matrix< Scalar > > | get_input (const Function &f) |
Get function input. More... | |
static std::vector< Matrix< Scalar > > | get_free (const Function &f) |
Get free. More... | |
static std::string | type_name () |
Get name of the class. More... | |
static void | print_default (std::ostream &stream, const Sparsity &sp, const Scalar *nonzeros, bool truncate=true) |
Print default style. More... | |
static void | print_scalar (std::ostream &stream, const Scalar &e) |
Print scalar. More... | |
static void | print_vector (std::ostream &stream, const Sparsity &sp, const Scalar *nonzeros, bool truncate=true) |
Print vector-style. More... | |
static void | print_sparse (std::ostream &stream, const Sparsity &sp, const Scalar *nonzeros, bool truncate=true) |
Print scalar. More... | |
static void | print_split (casadi_int nnz, const Scalar *nonzeros, std::vector< std::string > &nz, std::vector< std::string > &inter) |
Get strings corresponding to the nonzeros and the interdependencies. More... | |
static void | print_dense (std::ostream &stream, const Sparsity &sp, const Scalar *nonzeros, bool truncate=true) |
Print dense matrix-stype. More... | |
static Matrix< Scalar > | eye (casadi_int n) |
create an n-by-n identity matrix More... | |
static void | set_precision (casadi_int precision) |
Set the 'precision, width & scientific' used in printing and serializing to streams. More... | |
static void | set_width (casadi_int width) |
static void | set_scientific (bool scientific) |
static void | rng (casadi_int seed) |
Seed the random number generator. More... | |
static Matrix< Scalar > | deserialize (std::istream &stream) |
Build Sparsity from serialization. More... | |
static Matrix< Scalar > | deserialize (const std::string &s) |
Build Sparsity from serialization. More... | |
static Matrix< Scalar > | deserialize (DeserializingStream &s) |
static void | to_file (const std::string &filename, const Sparsity &sp, const Scalar *nonzeros, const std::string &format="") |
static Matrix< double > | from_file (const std::string &filename, const std::string &format_hint="") |
static Matrix< Scalar > | _sym (const std::string &name, const Sparsity &sp) |
static Matrix< Scalar > | logsumexp (const Matrix< Scalar > &x) |
static Matrix< Scalar > | binary (casadi_int op, const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
Create nodes by their ID. More... | |
static Matrix< Scalar > | unary (casadi_int op, const Matrix< Scalar > &x) |
Create nodes by their ID. More... | |
static Matrix< Scalar > | scalar_matrix (casadi_int op, const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
Create nodes by their ID. More... | |
static Matrix< Scalar > | matrix_scalar (casadi_int op, const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
Create nodes by their ID. More... | |
static Matrix< Scalar > | matrix_matrix (casadi_int op, const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
Create nodes by their ID. More... | |
static std::vector< Matrix< Scalar > > | call (const Function &f, const std::vector< Matrix< Scalar > > &x) |
Create nodes by their ID. More... | |
static std::vector< Scalar > | call (const Function &f, const std::vector< Scalar > &x) |
Create nodes by their ID. More... | |
static bool | is_equal (const Matrix< Scalar > &x, const Matrix< Scalar > &y, casadi_int depth=0) |
static Matrix< Scalar > | mmin (const Matrix< Scalar > &x) |
static Matrix< Scalar > | mmax (const Matrix< Scalar > &x) |
static Matrix< Scalar > | simplify (const Matrix< Scalar > &x) |
static Matrix< Scalar > | jacobian (const Matrix< Scalar > &f, const Matrix< Scalar > &x, const Dict &opts=Dict()) |
static Sparsity | jacobian_sparsity (const Matrix< Scalar > &f, const Matrix< Scalar > &x) |
static Matrix< Scalar > | hessian (const Matrix< Scalar > &f, const Matrix< Scalar > &x, const Dict &opts=Dict()) |
static Matrix< Scalar > | hessian (const Matrix< Scalar > &f, const Matrix< Scalar > &x, Matrix< Scalar > &g, const Dict &opts=Dict()) |
static Matrix< Scalar > | substitute (const Matrix< Scalar > &ex, const Matrix< Scalar > &v, const Matrix< Scalar > &vdef) |
static std::vector< Matrix< Scalar > > | substitute (const std::vector< Matrix< Scalar > > &ex, const std::vector< Matrix< Scalar > > &v, const std::vector< Matrix< Scalar > > &vdef) |
static void | substitute_inplace (const std::vector< Matrix< Scalar > > &v, std::vector< Matrix< Scalar > > &vdef, std::vector< Matrix< Scalar > > &ex, bool revers) |
static Matrix< Scalar > | pinv (const Matrix< Scalar > &x) |
static Matrix< Scalar > | pinv (const Matrix< Scalar > &A, const std::string &lsolver, const Dict &opts) |
static Matrix< Scalar > | expm_const (const Matrix< Scalar > &A, const Matrix< Scalar > &t) |
static Matrix< Scalar > | expm (const Matrix< Scalar > &A) |
static Matrix< Scalar > | solve (const Matrix< Scalar > &A, const Matrix< Scalar > &b) |
static Matrix< Scalar > | solve (const Matrix< Scalar > &A, const Matrix< Scalar > &b, const std::string &lsolver, const Dict &opts) |
static Matrix< Scalar > | inv (const Matrix< Scalar > &A) |
static Matrix< Scalar > | inv (const Matrix< Scalar > &A, const std::string &lsolver, const Dict &opts) |
static casadi_int | n_nodes (const Matrix< Scalar > &x) |
static std::string | print_operator (const Matrix< Scalar > &x, const std::vector< std::string > &args) |
static void | extract (std::vector< Matrix< Scalar >> &ex, std::vector< Matrix< Scalar >> &v, std::vector< Matrix< Scalar >> &vdef, const Dict &opts=Dict()) |
static void | shared (std::vector< Matrix< Scalar > > &ex, std::vector< Matrix< Scalar > > &v, std::vector< Matrix< Scalar > > &vdef, const std::string &v_prefix, const std::string &v_suffix) |
static Matrix< Scalar > | _bilin (const Matrix< Scalar > &A, const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
static Matrix< Scalar > | _rank1 (const Matrix< Scalar > &A, const Matrix< Scalar > &alpha, const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
static Matrix< Scalar > | if_else (const Matrix< Scalar > &x, const Matrix< Scalar > &if_true, const Matrix< Scalar > &if_false, bool short_circuit=false) |
static Matrix< Scalar > | conditional (const Matrix< Scalar > &ind, const std::vector< Matrix< Scalar > > &x, const Matrix< Scalar > &x_default, bool short_circuit=false) |
static bool | depends_on (const Matrix< Scalar > &x, const Matrix< Scalar > &arg) |
static bool | contains (const std::vector< Matrix< Scalar > > &v, const Matrix< Scalar > &n) |
static bool | contains_all (const std::vector< Matrix< Scalar > > &v, const std::vector< Matrix< Scalar > > &n) |
static bool | contains_any (const std::vector< Matrix< Scalar > > &v, const std::vector< Matrix< Scalar > > &n) |
static Matrix< Scalar > | mrdivide (const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
static Matrix< Scalar > | mldivide (const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
static std::vector< Matrix< Scalar > > | symvar (const Matrix< Scalar > &x) |
static Matrix< Scalar > | det (const Matrix< Scalar > &x) |
static Matrix< Scalar > | inv_minor (const Matrix< Scalar > &x) |
static Matrix< Scalar > | trace (const Matrix< Scalar > &x) |
static Matrix< Scalar > | norm_1 (const Matrix< Scalar > &x) |
static Matrix< Scalar > | norm_2 (const Matrix< Scalar > &x) |
static Matrix< Scalar > | norm_fro (const Matrix< Scalar > &x) |
static Matrix< Scalar > | norm_inf (const Matrix< Scalar > &x) |
static Matrix< Scalar > | sum2 (const Matrix< Scalar > &x) |
static Matrix< Scalar > | sum1 (const Matrix< Scalar > &x) |
static Matrix< Scalar > | dot (const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
static Matrix< Scalar > | nullspace (const Matrix< Scalar > &x) |
static Matrix< Scalar > | diag (const Matrix< Scalar > &x) |
static Matrix< Scalar > | unite (const Matrix< Scalar > &A, const Matrix< Scalar > &B) |
static Matrix< Scalar > | project (const Matrix< Scalar > &x, const Sparsity &sp, bool intersect=false) |
static Matrix< Scalar > | polyval (const Matrix< Scalar > &p, const Matrix< Scalar > &x) |
static Matrix< Scalar > | densify (const Matrix< Scalar > &x, const Matrix< Scalar > &val) |
static Matrix< Scalar > | densify (const Matrix< Scalar > &x) |
static Matrix< Scalar > | einstein (const Matrix< Scalar > &A, const Matrix< Scalar > &B, const Matrix< Scalar > &C, const std::vector< casadi_int > &dim_a, const std::vector< casadi_int > &dim_b, const std::vector< casadi_int > &dim_c, const std::vector< casadi_int > &a, const std::vector< casadi_int > &b, const std::vector< casadi_int > &c) |
static Matrix< Scalar > | einstein (const Matrix< Scalar > &A, const Matrix< Scalar > &B, const std::vector< casadi_int > &dim_a, const std::vector< casadi_int > &dim_b, const std::vector< casadi_int > &dim_c, const std::vector< casadi_int > &a, const std::vector< casadi_int > &b, const std::vector< casadi_int > &c) |
static Matrix< Scalar > | cumsum (const Matrix< Scalar > &x, casadi_int axis=-1) |
static Matrix< Scalar > | _logsumexp (const Matrix< Scalar > &x) |
static std::vector< Matrix< Scalar > > | cse (const std::vector< Matrix< Scalar > > &e) |
static Matrix< Scalar > | blockcat (const std::vector< std::vector< Matrix< Scalar > > > &v) |
static Matrix< Scalar > | horzcat (const std::vector< Matrix< Scalar > > &v) |
static std::vector< Matrix< Scalar > > | horzsplit (const Matrix< Scalar > &x, const std::vector< casadi_int > &offset) |
static Matrix< Scalar > | vertcat (const std::vector< Matrix< Scalar > > &v) |
static std::vector< Matrix< Scalar > > | vertsplit (const Matrix< Scalar > &x, const std::vector< casadi_int > &offset) |
static std::vector< Matrix< Scalar > > | diagsplit (const Matrix< Scalar > &x, const std::vector< casadi_int > &offset1, const std::vector< casadi_int > &offset2) |
static Matrix< Scalar > | reshape (const Matrix< Scalar > &x, casadi_int nrow, casadi_int ncol) |
static Matrix< Scalar > | reshape (const Matrix< Scalar > &x, const Sparsity &sp) |
static Matrix< Scalar > | sparsity_cast (const Matrix< Scalar > &x, const Sparsity &sp) |
static Matrix< Scalar > | kron (const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
static Matrix< Scalar > | mtimes (const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
static Matrix< Scalar > | mac (const Matrix< Scalar > &x, const Matrix< Scalar > &y, const Matrix< Scalar > &z) |
static void | extract_parametric (const Matrix< Scalar > &expr, const Matrix< Scalar > &par, Matrix< Scalar > &expr_ret, std::vector< Matrix< Scalar > > &symbols, std::vector< Matrix< Scalar >> ¶metric, const Dict &opts) |
static void | separate_linear (const Matrix< Scalar > &expr, const Matrix< Scalar > &sym_lin, const Matrix< Scalar > &sym_const, Matrix< Scalar > &expr_const, Matrix< Scalar > &expr_lin, Matrix< Scalar > &expr_nonlin) |
static Matrix< Scalar > | sparsify (const Matrix< Scalar > &x, double tol=0) |
static void | expand (const Matrix< Scalar > &x, Matrix< Scalar > &weights, Matrix< Scalar > &terms) |
static Matrix< Scalar > | pw_const (const Matrix< Scalar > &t, const Matrix< Scalar > &tval, const Matrix< Scalar > &val) |
static Matrix< Scalar > | pw_lin (const Matrix< Scalar > &t, const Matrix< Scalar > &tval, const Matrix< Scalar > &val) |
static Matrix< Scalar > | heaviside (const Matrix< Scalar > &x) |
static Matrix< Scalar > | rectangle (const Matrix< Scalar > &x) |
static Matrix< Scalar > | triangle (const Matrix< Scalar > &x) |
static Matrix< Scalar > | ramp (const Matrix< Scalar > &x) |
static Matrix< Scalar > | gauss_quadrature (const Matrix< Scalar > &f, const Matrix< Scalar > &x, const Matrix< Scalar > &a, const Matrix< Scalar > &b, casadi_int order=5) |
static Matrix< Scalar > | gauss_quadrature (const Matrix< Scalar > &f, const Matrix< Scalar > &x, const Matrix< Scalar > &a, const Matrix< Scalar > &b, casadi_int order, const Matrix< Scalar > &w) |
static std::vector< std::vector< Matrix< Scalar > > > | forward (const std::vector< Matrix< Scalar > > &ex, const std::vector< Matrix< Scalar > > &arg, const std::vector< std::vector< Matrix< Scalar > > > &v, const Dict &opts=Dict()) |
static std::vector< std::vector< Matrix< Scalar > > > | reverse (const std::vector< Matrix< Scalar > > &ex, const std::vector< Matrix< Scalar > > &arg, const std::vector< std::vector< Matrix< Scalar > > > &v, const Dict &opts=Dict()) |
static std::vector< bool > | which_depends (const Matrix< Scalar > &expr, const Matrix< Scalar > &var, casadi_int order=1, bool tr=false) |
static Matrix< Scalar > | taylor (const Matrix< Scalar > &ex, const Matrix< Scalar > &x, const Matrix< Scalar > &a, casadi_int order) |
static Matrix< Scalar > | mtaylor (const Matrix< Scalar > &ex, const Matrix< Scalar > &x, const Matrix< Scalar > &a, casadi_int order) |
static Matrix< Scalar > | mtaylor (const Matrix< Scalar > &ex, const Matrix< Scalar > &x, const Matrix< Scalar > &a, casadi_int order, const std::vector< casadi_int > &order_contributions) |
static Matrix< Scalar > | poly_coeff (const Matrix< Scalar > &ex, const Matrix< Scalar > &x) |
static Matrix< Scalar > | poly_roots (const Matrix< Scalar > &p) |
static Matrix< Scalar > | eig_symbolic (const Matrix< Scalar > &m) |
static Matrix< double > | evalf (const Matrix< Scalar > &m) |
static void | qr_sparse (const Matrix< Scalar > &A, Matrix< Scalar > &V, Matrix< Scalar > &R, Matrix< Scalar > &beta, std::vector< casadi_int > &prinv, std::vector< casadi_int > &pc, bool amd=true) |
static Matrix< Scalar > | qr_solve (const Matrix< Scalar > &b, const Matrix< Scalar > &v, const Matrix< Scalar > &r, const Matrix< Scalar > &beta, const std::vector< casadi_int > &prinv, const std::vector< casadi_int > &pc, bool tr=false) |
static void | qr (const Matrix< Scalar > &A, Matrix< Scalar > &Q, Matrix< Scalar > &R) |
static void | ldl (const Matrix< Scalar > &A, Matrix< Scalar > &D, Matrix< Scalar > <, std::vector< casadi_int > &p, bool amd=true) |
static Matrix< Scalar > | ldl_solve (const Matrix< Scalar > &b, const Matrix< Scalar > &D, const Matrix< Scalar > <, const std::vector< casadi_int > &p) |
static Matrix< Scalar > | all (const Matrix< Scalar > &x) |
static Matrix< Scalar > | any (const Matrix< Scalar > &x) |
static Matrix< Scalar > | adj (const Matrix< Scalar > &x) |
static Matrix< Scalar > | minor (const Matrix< Scalar > &x, casadi_int i, casadi_int j) |
static Matrix< Scalar > | cofactor (const Matrix< Scalar > &A, casadi_int i, casadi_int j) |
static Matrix< Scalar > | chol (const Matrix< Scalar > &A) |
static Matrix< Scalar > | norm_inf_mul (const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
static Matrix< Scalar > | diagcat (const std::vector< Matrix< Scalar > > &A) |
static Matrix< Scalar > | triplet (const std::vector< casadi_int > &row, const std::vector< casadi_int > &col, const Matrix< Scalar > &d) |
Construct a sparse matrix from triplet form. More... | |
static Matrix< Scalar > | triplet (const std::vector< casadi_int > &row, const std::vector< casadi_int > &col, const Matrix< Scalar > &d, casadi_int nrow, casadi_int ncol) |
Construct a sparse matrix from triplet form. More... | |
static Matrix< Scalar > | triplet (const std::vector< casadi_int > &row, const std::vector< casadi_int > &col, const Matrix< Scalar > &d, const std::pair< casadi_int, casadi_int > &rc) |
Construct a sparse matrix from triplet form. More... | |
static Matrix< Scalar > | inf (const Sparsity &sp) |
create a matrix with all inf More... | |
static Matrix< Scalar > | inf (casadi_int nrow=1, casadi_int ncol=1) |
create a matrix with all inf More... | |
static Matrix< Scalar > | inf (const std::pair< casadi_int, casadi_int > &rc) |
create a matrix with all inf More... | |
static Matrix< Scalar > | nan (const Sparsity &sp) |
create a matrix with all nan More... | |
static Matrix< Scalar > | nan (casadi_int nrow=1, casadi_int ncol=1) |
create a matrix with all nan More... | |
static Matrix< Scalar > | nan (const std::pair< casadi_int, casadi_int > &rc) |
create a matrix with all nan More... | |
static Matrix< Scalar > | rand (casadi_int nrow=1, casadi_int ncol=1) |
Create a matrix with uniformly distributed random numbers. More... | |
static Matrix< Scalar > | rand (const Sparsity &sp) |
Create a matrix with uniformly distributed random numbers. More... | |
static Matrix< Scalar > | rand (const std::pair< casadi_int, casadi_int > &rc) |
Create a matrix with uniformly distributed random numbers. More... | |
static Matrix< Scalar > | interp1d (const std::vector< double > &x, const Matrix< Scalar > &v, const std::vector< double > &xq, const std::string &mode, bool equidistant) |
Functions called by friend functions defined here. More... | |
static casadi_int | sprank (const Matrix< Scalar > &x) |
Functions called by friend functions defined here. More... | |
static casadi_int | norm_0_mul (const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
Functions called by friend functions defined here. More... | |
static Matrix< Scalar > | tril (const Matrix< Scalar > &x, bool includeDiagonal=true) |
Functions called by friend functions defined here. More... | |
static Matrix< Scalar > | triu (const Matrix< Scalar > &x, bool includeDiagonal=true) |
Functions called by friend functions defined here. More... | |
static Matrix< Scalar > | sumsqr (const Matrix< Scalar > &x) |
Functions called by friend functions defined here. More... | |
static Matrix< Scalar > | linspace (const Matrix< Scalar > &a, const Matrix< Scalar > &b, casadi_int nsteps) |
Functions called by friend functions defined here. More... | |
static Matrix< Scalar > | cross (const Matrix< Scalar > &a, const Matrix< Scalar > &b, casadi_int dim=-1) |
Functions called by friend functions defined here. More... | |
static Matrix< Scalar > | skew (const Matrix< Scalar > &a) |
Functions called by friend functions defined here. More... | |
static Matrix< Scalar > | inv_skew (const Matrix< Scalar > &a) |
Functions called by friend functions defined here. More... | |
static Matrix< Scalar > | tril2symm (const Matrix< Scalar > &x) |
Functions called by friend functions defined here. More... | |
static Matrix< Scalar > | triu2symm (const Matrix< Scalar > &x) |
Functions called by friend functions defined here. More... | |
static Matrix< Scalar > | repsum (const Matrix< Scalar > &x, casadi_int n, casadi_int m=1) |
Functions called by friend functions defined here. More... | |
static Matrix< Scalar > | diff (const Matrix< Scalar > &x, casadi_int n=1, casadi_int axis=-1) |
Functions called by friend functions defined here. More... | |
static bool | is_linear (const Matrix< Scalar > &expr, const Matrix< Scalar > &var) |
Functions called by friend functions defined here. More... | |
static bool | is_quadratic (const Matrix< Scalar > &expr, const Matrix< Scalar > &var) |
Functions called by friend functions defined here. More... | |
static void | quadratic_coeff (const Matrix< Scalar > &expr, const Matrix< Scalar > &var, Matrix< Scalar > &A, Matrix< Scalar > &b, Matrix< Scalar > &c, bool check) |
Functions called by friend functions defined here. More... | |
static void | linear_coeff (const Matrix< Scalar > &expr, const Matrix< Scalar > &var, Matrix< Scalar > &A, Matrix< Scalar > &b, bool check) |
Functions called by friend functions defined here. More... | |
static Matrix< Scalar > | mpower (const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
static Matrix< Scalar > | soc (const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
static Matrix< Scalar > | linearize (const Matrix< Scalar > &f, const Matrix< Scalar > &x, const Matrix< Scalar > &x0, const Dict &opts=Dict()) |
static Matrix< Scalar > | gradient (const Matrix< Scalar > &ex, const Matrix< Scalar > &arg, const Dict &opts=Dict()) |
static Matrix< Scalar > | tangent (const Matrix< Scalar > &ex, const Matrix< Scalar > &arg, const Dict &opts=Dict()) |
static Matrix< Scalar > | jtimes (const Matrix< Scalar > &ex, const Matrix< Scalar > &arg, const Matrix< Scalar > &v, bool tr=false, const Dict &opts=Dict()) |
static Matrix< Scalar > | bilin (const Matrix< Scalar > &A, const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
Calculate bilinear/quadratic form x^T A y. More... | |
static Matrix< Scalar > | rank1 (const Matrix< Scalar > &A, const Matrix< Scalar > &alpha, const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
Make a rank-1 update to a matrix A. More... | |
Construct symbolic primitives | |
The "sym" function is intended to work in a similar way as "sym" used in the Symbolic Toolbox for Matlab but instead creating a CasADi symbolic primitive. | |
static Matrix< Scalar > | sym (const std::string &name, casadi_int nrow=1, casadi_int ncol=1) |
Create an nrow-by-ncol symbolic primitive. More... | |
static Matrix< Scalar > | sym (const std::string &name, const std::pair< casadi_int, casadi_int > &rc) |
Construct a symbolic primitive with given dimensions. More... | |
static Matrix< Scalar > | sym (const std::string &name, const Sparsity &sp) |
Create symbolic primitive with a given sparsity pattern. More... | |
static std::vector< Matrix< Scalar > > | sym (const std::string &name, const Sparsity &sp, casadi_int p) |
Create a vector of length p with with matrices. More... | |
static std::vector< Matrix< Scalar > > | sym (const std::string &name, casadi_int nrow, casadi_int ncol, casadi_int p) |
Create a vector of length p with nrow-by-ncol symbolic primitives. More... | |
static std::vector< std::vector< Matrix< Scalar > > > | sym (const std::string &name, const Sparsity &sp, casadi_int p, casadi_int r) |
Create a vector of length r of vectors of length p with. More... | |
static std::vector< std::vector< Matrix< Scalar > > > | sym (const std::string &name, casadi_int nrow, casadi_int ncol, casadi_int p, casadi_int r) |
Create a vector of length r of vectors of length p. More... | |
static Matrix< Scalar > | zeros (casadi_int nrow=1, casadi_int ncol=1) |
Create a dense matrix or a matrix with specified sparsity with all entries zero. More... | |
static Matrix< Scalar > | zeros (const Sparsity &sp) |
Create a dense matrix or a matrix with specified sparsity with all entries zero. More... | |
static Matrix< Scalar > | zeros (const std::pair< casadi_int, casadi_int > &rc) |
Create a dense matrix or a matrix with specified sparsity with all entries zero. More... | |
static Matrix< Scalar > | ones (casadi_int nrow=1, casadi_int ncol=1) |
Create a dense matrix or a matrix with specified sparsity with all entries one. More... | |
static Matrix< Scalar > | ones (const Sparsity &sp) |
Create a dense matrix or a matrix with specified sparsity with all entries one. More... | |
static Matrix< Scalar > | ones (const std::pair< casadi_int, casadi_int > &rc) |
Create a dense matrix or a matrix with specified sparsity with all entries one. More... | |
Static Private Member Functions | |
static Matrix< Scalar > | printme (const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
Friends | |
Matrix< Scalar > | adj (const Matrix< Scalar > &A) |
Matrix adjoint. More... | |
Matrix< Scalar > | minor (const Matrix< Scalar > &x, casadi_int i, casadi_int j) |
Get the (i,j) minor matrix. More... | |
Matrix< Scalar > | cofactor (const Matrix< Scalar > &x, casadi_int i, casadi_int j) |
Get the (i,j) cofactor matrix. More... | |
void | qr (const Matrix< Scalar > &A, Matrix< Scalar > &Q, Matrix< Scalar > &R) |
QR factorization using the modified Gram-Schmidt algorithm. More... | |
void | qr_sparse (const Matrix< Scalar > &A, Matrix< Scalar > &V, Matrix< Scalar > &R, Matrix< Scalar > &beta, std::vector< casadi_int > &prinv, std::vector< casadi_int > &pc, bool amd=true) |
Sparse direct QR factorization. More... | |
Matrix< Scalar > | qr_solve (const Matrix< Scalar > &b, const Matrix< Scalar > &v, const Matrix< Scalar > &r, const Matrix< Scalar > &beta, const std::vector< casadi_int > &prinv, const std::vector< casadi_int > &pc, bool tr=false) |
Solve using a sparse QR factorization. More... | |
Matrix< Scalar > | chol (const Matrix< Scalar > &A) |
Obtain a Cholesky factorisation of a matrix. More... | |
void | ldl (const Matrix< Scalar > &A, Matrix< Scalar > &D, Matrix< Scalar > <, std::vector< casadi_int > &p, bool amd=true) |
Sparse LDL^T factorization. More... | |
Matrix< Scalar > | ldl_solve (const Matrix< Scalar > &b, const Matrix< Scalar > &D, const Matrix< Scalar > <, const std::vector< casadi_int > &p) |
Solve using a sparse LDL^T factorization. More... | |
Matrix< Scalar > | any (const Matrix< Scalar > &x) |
Returns true only if any element in the matrix is true. More... | |
Matrix< Scalar > | all (const Matrix< Scalar > &x) |
Returns true only if every element in the matrix is true. More... | |
Matrix< Scalar > | norm_inf_mul (const Matrix< Scalar > &x, const Matrix< Scalar > &y) |
Inf-norm of a Matrix-Matrix product. More... | |
Matrix< Scalar > | sparsify (const Matrix< Scalar > &A, double tol=0) |
Make a matrix sparse by removing numerical zeros. More... | |
void | expand (const Matrix< Scalar > &ex, Matrix< Scalar > &weights, Matrix< Scalar > &terms) |
Expand the expression as a weighted sum (with constant weights) More... | |
Matrix< Scalar > | pw_const (const Matrix< Scalar > &t, const Matrix< Scalar > &tval, const Matrix< Scalar > &val) |
Create a piecewise constant function. More... | |
Matrix< Scalar > | pw_lin (const Matrix< Scalar > &t, const Matrix< Scalar > &tval, const Matrix< Scalar > &val) |
t a scalar variable (e.g. time) More... | |
Matrix< Scalar > | heaviside (const Matrix< Scalar > &x) |
Heaviside function. More... | |
Matrix< Scalar > | rectangle (const Matrix< Scalar > &x) |
rectangle function More... | |
Matrix< Scalar > | triangle (const Matrix< Scalar > &x) |
triangle function More... | |
Matrix< Scalar > | ramp (const Matrix< Scalar > &x) |
ramp function More... | |
Matrix< Scalar > | mtaylor (const Matrix< Scalar > &ex, const Matrix< Scalar > &x, const Matrix< Scalar > &a, casadi_int order=1) |
multivariate Taylor series expansion More... | |
Matrix< Scalar > | mtaylor (const Matrix< Scalar > &ex, const Matrix< Scalar > &x, const Matrix< Scalar > &a, casadi_int order, const std::vector< casadi_int > &order_contributions) |
multivariate Taylor series expansion More... | |
Matrix< Scalar > | poly_coeff (const Matrix< Scalar > &f, const Matrix< Scalar > &x) |
extracts polynomial coefficients from an expression More... | |
Matrix< Scalar > | poly_roots (const Matrix< Scalar > &p) |
Attempts to find the roots of a polynomial. More... | |
Matrix< Scalar > | eig_symbolic (const Matrix< Scalar > &m) |
Attempts to find the eigenvalues of a symbolic matrix. More... | |
Matrix< double > | evalf (const Matrix< Scalar > &expr) |
Evaluates the expression numerically. More... | |
Matrix< Scalar > | gauss_quadrature (const Matrix< Scalar > &f, const Matrix< Scalar > &x, const Matrix< Scalar > &a, const Matrix< Scalar > &b, casadi_int order=5) |
Integrate f from a to b using Gaussian quadrature with n points. More... | |
Matrix< Scalar > | gauss_quadrature (const Matrix< Scalar > &f, const Matrix< Scalar > &x, const Matrix< Scalar > &a, const Matrix< Scalar > &b, casadi_int order, const Matrix< Scalar > &w) |
Integrate f from a to b using Gaussian quadrature with n points. More... | |
Matrix< Scalar > | taylor (const Matrix< Scalar > &ex, const Matrix< Scalar > &x, const Matrix< Scalar > &a, casadi_int order=1) |
univariate Taylor series expansion More... | |
Matrix< Scalar > | taylor (const Matrix< Scalar > &ex, const Matrix< Scalar > &x) |
univariate Taylor series expansion More... | |
Scalar * | ptr () |
const Scalar * | ptr () const |
Scalar * | get_ptr (Matrix< Scalar > &v) |
const Scalar * | get_ptr (const Matrix< Scalar > &v) |
typedef GenericMatrix<Matrix<Scalar> > casadi::Matrix< Scalar >::B |
Definition at line 193 of file matrix_decl.hpp.
typedef Scalar casadi::Matrix< Scalar >::ScalarType |
Definition at line 190 of file matrix_decl.hpp.
casadi::Matrix< Scalar >::Matrix |
Extra doc: https://github.com/casadi/casadi/wiki/L_18f empty 0-by-0 matrix constructor
Definition at line 576 of file matrix_impl.hpp.
casadi::Matrix< Scalar >::Matrix | ( | const Matrix< Scalar > & | m | ) |
Definition at line 580 of file matrix_impl.hpp.
casadi::Matrix< Scalar >::Matrix | ( | casadi_int | nrow, |
casadi_int | ncol | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_18g
|
explicit |
Extra doc: https://github.com/casadi/casadi/wiki/L_18h
|
explicit |
Same as Matrix::ones(sparsity)
Extra doc: https://github.com/casadi/casadi/wiki/L_18k
casadi::Matrix< Scalar >::Matrix | ( | const Sparsity & | sp, |
const Matrix< Scalar > & | d | ||
) |
Extra doc: https://github.com/casadi/casadi/wiki/L_18l
casadi::Matrix< Scalar >::Matrix | ( | double | val | ) |
|
explicit |
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_18m
Definition at line 161 of file matrix_decl.hpp.
|
inline |
Assumes that the scalar conversion is valid.
Extra doc: https://github.com/casadi/casadi/wiki/L_18n
Definition at line 174 of file matrix_decl.hpp.
casadi::Matrix< Scalar >::Matrix | ( | const std::vector< Scalar > & | x | ) |
Definition at line 584 of file matrix_impl.hpp.
|
inline |
Definition at line 184 of file matrix_decl.hpp.
casadi::Matrix< Scalar >::Matrix | ( | const Sparsity & | sp, |
const Scalar & | val, | ||
bool | dummy | ||
) |
casadi::Matrix< Scalar >::Matrix | ( | const Sparsity & | sp, |
const std::vector< Scalar > & | d, | ||
bool | dummy | ||
) |
bool CASADI_EXPORT casadi::SX::__nonzero__ |
Definition at line 70 of file matrix_impl.hpp.
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
Definition at line 52 of file sx_instantiator.cpp.
References casadi::Sparsity::is_scalar(), casadi::Matrix< Scalar >::name(), casadi::Sparsity::nnz(), and casadi::SXElem::sym().
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined here
|
staticinherited |
[in] | y | can be omitted, in which case x^T A x is calculated |
Extra doc: https://github.com/casadi/casadi/wiki/L_1bo
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_18o
|
static |
Functions called by friend functions defined for SparsityInterface
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_18o
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_18o
|
static |
Functions called by friend functions defined here
void casadi::Matrix< Scalar >::clear | ( | ) |
|
static |
Functions called by friend functions defined here
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b8
Definition at line 198 of file generic_matrix.hpp.
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b8
Definition at line 201 of file generic_matrix.hpp.
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1av
Definition at line 124 of file generic_matrix.hpp.
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
staticinherited |
Definition at line 227 of file generic_matrix.hpp.
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
Definition at line 527 of file matrix_impl.hpp.
References casadi::GenericMatrix< MatType >::is_row(), casadi::GenericMatrix< MatType >::size1(), and casadi::GenericMatrix< MatType >::size2().
|
static |
Functions called by friend functions defined for GenericMatrix
Definition at line 492 of file matrix_impl.hpp.
|
static |
Functions called by friend functions defined for GenericMatrix
Definition at line 497 of file matrix_impl.hpp.
References casadi::GenericMatrix< MatType >::colind(), casadi::Sparsity::dense(), casadi::GenericMatrix< MatType >::is_dense(), casadi::GenericMatrix< MatType >::is_scalar(), casadi::Matrix< Scalar >::nonzeros(), casadi::GenericMatrix< MatType >::row(), casadi::Matrix< Scalar >::scalar(), casadi::GenericMatrix< MatType >::size(), casadi::GenericMatrix< MatType >::size1(), and casadi::GenericMatrix< MatType >::size2().
SX CASADI_EXPORT casadi::SX::dep | ( | casadi_int | ch = 0 | ) | const |
Only defined if symbolic scalar. Wraps SXElem SXElem::dep(casadi_int ch=0) const.
Extra doc: https://github.com/casadi/casadi/wiki/L_1a9
Definition at line 223 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::scalar().
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ag
|
static |
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_1af
Referenced by casadi::DeserializingStream::unpack().
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined for SparsityInterface
|
staticinherited |
Definition at line 233 of file generic_matrix.hpp.
|
inherited |
The representation is e.g. "4x5" or "4x5,10nz"
Extra doc: https://github.com/casadi/casadi/wiki/L_1aw
Definition at line 131 of file generic_matrix.hpp.
void casadi::Matrix< Scalar >::disp | ( | std::ostream & | stream, |
bool | more = false |
||
) | const |
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined for GenericMatrix
Definition at line 541 of file matrix_impl.hpp.
References casadi::C, casadi::einstein_eval(), casadi::einstein_process(), casadi::get_ptr(), and casadi::Matrix< Scalar >::nonzeros().
Referenced by casadi::Matrix< Scalar >::einstein().
|
static |
Functions called by friend functions defined for GenericMatrix
Definition at line 566 of file matrix_impl.hpp.
References casadi::Matrix< Scalar >::einstein(), and casadi::product().
casadi_int CASADI_EXPORT casadi::SX::element_hash |
Only defined if symbolic scalar.
Extra doc: https://github.com/casadi/casadi/wiki/L_19n
Definition at line 126 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::scalar().
void casadi::Matrix< Scalar >::enlarge | ( | casadi_int | nrow, |
casadi_int | ncol, | ||
const std::vector< casadi_int > & | rr, | ||
const std::vector< casadi_int > & | cc, | ||
bool | ind1 = false |
||
) |
Make the matrix larger by inserting empty rows and columns, keeping the existing non-zeros
Extra doc: https://github.com/casadi/casadi/wiki/L_19i
void casadi::Matrix< Scalar >::erase | ( | const std::vector< casadi_int > & | rr, |
bool | ind1 = false |
||
) |
Erase elements of a matrix
Extra doc: https://github.com/casadi/casadi/wiki/L_19g
void casadi::Matrix< Scalar >::erase | ( | const std::vector< casadi_int > & | rr, |
const std::vector< casadi_int > & | cc, | ||
bool | ind1 = false |
||
) |
Erase rows and/or columns of a matrix
Extra doc: https://github.com/casadi/casadi/wiki/L_19f
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
void casadi::Matrix< Scalar >::export_code | ( | const std::string & | lang, |
std::ostream & | stream = casadi::uout() , |
||
const Dict & | options = Dict() |
||
) | const |
lang: only 'matlab' supported for now
* options: * inline: Indicates if you want everything on a single line (default: False) * name: Name of exported variable (default: 'm') * indent_level: Level of indentation (default: 0) * spoof_zero: Replace numerical zero by a 1e-200 (default: false) * might be needed for matlab sparse construct, * which doesn't allow numerical zero *
Extra doc: https://github.com/casadi/casadi/wiki/L_1ac
Referenced by casadi::MXFunction::export_code_body().
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for SparsityInterface
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_19m
|
static |
Functions called by friend functions defined here
|
static |
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined here
void casadi::Matrix< Scalar >::get | ( | Matrix< Scalar > & | m, |
bool | ind1, | ||
const Matrix< casadi_int > & | rr | ||
) | const |
Get a submatrix, single argument
Definition at line 152 of file matrix_impl.hpp.
References casadi::GenericMatrix< MatType >::is_column(), casadi::GenericMatrix< MatType >::is_row(), casadi::GenericMatrix< MatType >::is_scalar(), casadi::Matrix< Scalar >::nonzeros(), casadi::Matrix< Scalar >::sparsity(), casadi::Sparsity::sub(), casadi::Sparsity::T(), casadi::to_slice(), and casadi::GenericMatrix< Matrix< Scalar > >::zeros().
void casadi::Matrix< Scalar >::get | ( | Matrix< Scalar > & | m, |
bool | ind1, | ||
const Matrix< casadi_int > & | rr, | ||
const Matrix< casadi_int > & | cc | ||
) | const |
Get a submatrix, two arguments
Definition at line 111 of file matrix_impl.hpp.
void casadi::Matrix< Scalar >::get | ( | Matrix< Scalar > & | m, |
bool | ind1, | ||
const Matrix< casadi_int > & | rr, | ||
const Slice & | cc | ||
) | const |
Get a submatrix, two arguments
Definition at line 104 of file matrix_impl.hpp.
void casadi::Matrix< Scalar >::get | ( | Matrix< Scalar > & | m, |
bool | ind1, | ||
const Slice & | rr | ||
) | const |
Get a submatrix, single argument
Definition at line 134 of file matrix_impl.hpp.
void casadi::Matrix< Scalar >::get | ( | Matrix< Scalar > & | m, |
bool | ind1, | ||
const Slice & | rr, | ||
const Matrix< casadi_int > & | cc | ||
) | const |
Get a submatrix, two arguments
Definition at line 97 of file matrix_impl.hpp.
References casadi::Slice::all().
void casadi::Matrix< Scalar >::get | ( | Matrix< Scalar > & | m, |
bool | ind1, | ||
const Slice & | rr, | ||
const Slice & | cc | ||
) | const |
Get a submatrix, two arguments
Definition at line 79 of file matrix_impl.hpp.
References casadi::Slice::all(), casadi::Slice::is_scalar(), and casadi::Slice::scalar().
void casadi::Matrix< Scalar >::get | ( | Matrix< Scalar > & | m, |
bool | ind1, | ||
const Sparsity & | sp | ||
) | const |
Get a submatrix, single argument
Definition at line 176 of file matrix_impl.hpp.
References casadi::Sparsity::size(), and casadi::str().
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b8
Definition at line 195 of file generic_matrix.hpp.
std::vector<Scalar> casadi::Matrix< Scalar >::get_elements | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_1a3
Referenced by casadi::OptiNode::show_infeasibilities().
Extra doc: https://github.com/casadi/casadi/wiki/L_19e
Definition at line 1554 of file sx_instantiator.cpp.
References casadi::Function::free_sx().
Extra doc: https://github.com/casadi/casadi/wiki/L_19d
Definition at line 1550 of file sx_instantiator.cpp.
References casadi::Function::sx_in().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_19c
Definition at line 47 of file sx_instantiator.cpp.
References casadi::SXNode::eq_depth_.
std::vector< A > casadi::Matrix< Scalar >::get_nonzeros | ( | ) | const |
Implementation of Matrix::get_nonzeros (in public API)
Extra doc: https://github.com/casadi/casadi/wiki/L_1a2
Definition at line 1392 of file matrix_decl.hpp.
std::vector<A> casadi::Matrix< Scalar >::get_nonzeros | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_1a4
void casadi::Matrix< Scalar >::get_nz | ( | Matrix< Scalar > & | m, |
bool | ind1, | ||
const Matrix< casadi_int > & | k | ||
) | const |
void casadi::Matrix< Scalar >::get_nz | ( | Matrix< Scalar > & | m, |
bool | ind1, | ||
const Slice & | k | ||
) | const |
SX CASADI_EXPORT casadi::SX::get_output | ( | casadi_int | oind | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_28i
Definition at line 165 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::scalar().
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b8
Definition at line 194 of file generic_matrix.hpp.
Sparsity casadi::Matrix< Scalar >::get_sparsity | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_19j
std::string casadi::Matrix< Scalar >::get_str | ( | bool | more = false | ) | const |
Referenced by casadi::ConstantFile::disp(), and casadi::ConstantPool::disp().
|
staticinherited |
Functions called by friend functions defined here
bool CASADI_EXPORT casadi::SX::has_duplicates |
If there are symbolic primitives appearing more than once, the function will return true and the names of the duplicate expressions will be passed to casadi_warning. Note: Will mark the node using SXElem::set_temp. Make sure to call reset_input() after usage.
Extra doc: https://github.com/casadi/casadi/wiki/L_19t
Definition at line 198 of file sx_instantiator.cpp.
References casadi::str().
bool casadi::Matrix< Scalar >::has_nz | ( | casadi_int | rr, |
casadi_int | cc | ||
) | const |
Definition at line 65 of file matrix_impl.hpp.
bool CASADI_EXPORT casadi::SX::has_output |
Extra doc: https://github.com/casadi/casadi/wiki/L_28l
Definition at line 160 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::scalar().
bool casadi::Matrix< Scalar >::has_zeros | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_1a1
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for SparsityInterface
|
static |
Functions called by friend functions defined for SparsityInterface
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_19k
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_19k
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_19k
Dict CASADI_EXPORT casadi::SX::info |
Obtain information about sparsity
Definition at line 1559 of file sx_instantiator.cpp.
|
staticinherited |
Definition at line 213 of file generic_matrix.hpp.
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
staticinherited |
Definition at line 229 of file generic_matrix.hpp.
bool CASADI_EXPORT casadi::SX::is_call |
Extra doc: https://github.com/casadi/casadi/wiki/L_28j
Definition at line 150 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::scalar().
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b5
Definition at line 178 of file generic_matrix.hpp.
bool CASADI_EXPORT casadi::SX::is_commutative |
Only defined if symbolic scalar.
Extra doc: https://github.com/casadi/casadi/wiki/L_19q
Definition at line 136 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::scalar().
bool casadi::Matrix< Scalar >::is_constant | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_19v
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b0
Definition at line 153 of file generic_matrix.hpp.
|
inlineinherited |
(or optionally both dimensions)
Extra doc: https://github.com/casadi/casadi/wiki/L_1az
Definition at line 148 of file generic_matrix.hpp.
|
static |
Functions called by friend functions defined for GenericExpression
bool casadi::Matrix< Scalar >::is_eye | ( | ) | const |
are possible)
Extra doc: https://github.com/casadi/casadi/wiki/L_1a0
Referenced by casadi::ConstantDM::is_eye().
bool casadi::Matrix< Scalar >::is_integer | ( | ) | const |
(note that false negative answers are possible)
Extra doc: https://github.com/casadi/casadi/wiki/L_19w
bool CASADI_EXPORT casadi::SX::is_leaf |
Only defined if symbolic scalar.
Extra doc: https://github.com/casadi/casadi/wiki/L_19p
Definition at line 131 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::scalar().
|
staticinherited |
Definition at line 235 of file generic_matrix.hpp.
bool casadi::Matrix< Scalar >::is_minus_one | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_19z
Referenced by casadi::ConstantDM::is_minus_one().
bool casadi::Matrix< Scalar >::is_one | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_19y
Referenced by casadi::ConstantDM::is_one().
bool CASADI_EXPORT casadi::SX::is_op | ( | casadi_int | op | ) | const |
Definition at line 194 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::op(), and casadi::Matrix< Scalar >::scalar().
bool CASADI_EXPORT casadi::SX::is_output |
Extra doc: https://github.com/casadi/casadi/wiki/L_28k
Definition at line 155 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::scalar().
|
staticinherited |
Definition at line 236 of file generic_matrix.hpp.
bool CASADI_EXPORT casadi::SX::is_regular |
Definition at line 100 of file sx_instantiator.cpp.
References casadi::SXElem::is_constant(), casadi::SXElem::is_inf(), casadi::SXElem::is_minus_inf(), casadi::SXElem::is_nan(), casadi::GenericMatrix< Matrix< Scalar > >::nnz(), and casadi::Matrix< Scalar >::nonzeros().
Referenced by casadi::MX::is_regular().
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b4
Definition at line 173 of file generic_matrix.hpp.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b1
Definition at line 158 of file generic_matrix.hpp.
bool CASADI_EXPORT casadi::SX::is_smooth |
Extra doc: https://github.com/casadi/casadi/wiki/L_19o
Definition at line 116 of file sx_instantiator.cpp.
References casadi::SXFunction::is_smooth().
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b2
Definition at line 163 of file generic_matrix.hpp.
bool CASADI_EXPORT casadi::SX::is_symbolic |
Check if an expression is a pure symbol. Pure means that no operations should happen on the symbol (not even vec, transpose, index, concatenation, ...) By consequence, a slice of a vector-shaped MX symbol is not a symbol. However, the SX type is really a container format with scalar entries. Therefore, a slice of a vector-shaped SX symbol is still a symbol.
Sparse matrices invariable return false
\seealso is_valid_input
Extra doc: https://github.com/casadi/casadi/wiki/L_19r
Definition at line 180 of file sx_instantiator.cpp.
References casadi::GenericMatrix< Matrix< Scalar > >::is_dense(), and casadi::Matrix< Scalar >::is_valid_input().
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b7
Definition at line 188 of file generic_matrix.hpp.
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b6
Definition at line 183 of file generic_matrix.hpp.
bool CASADI_EXPORT casadi::SX::is_valid_input |
is_valid_input is more forgiving than is_symbolic. Some compositions are allowed: vec, vertcat.
Sparse matrices can return true if all non-zero elements are symbolic
\seealso is_symbolic
Extra doc: https://github.com/casadi/casadi/wiki/L_19s
Definition at line 141 of file sx_instantiator.cpp.
References casadi::GenericMatrix< Matrix< Scalar > >::nnz(), and casadi::Matrix< Scalar >::nonzeros().
Referenced by casadi::Matrix< Scalar >::is_symbolic().
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b3
Definition at line 168 of file generic_matrix.hpp.
bool casadi::Matrix< Scalar >::is_zero | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_19x
Referenced by casadi::ConstantDM::is_zero().
|
static |
Functions called by friend functions defined for GenericMatrix
Referenced by casadi::AmplInterface::init().
|
static |
Functions called by friend functions defined for GenericMatrix
|
staticinherited |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined for SparsityInterface
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined here
|
staticinherited |
Definition at line 239 of file generic_matrix.hpp.
|
staticinherited |
Functions called by friend functions defined here
|
staticinherited |
Definition at line 226 of file generic_matrix.hpp.
|
staticinherited |
|
static |
Functions called by friend functions defined for SparsityInterface
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_18o
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_18o
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericExpression
|
static |
Functions called by friend functions defined for GenericExpression
|
staticinherited |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined for SparsityInterface
casadi_int CASADI_EXPORT casadi::SX::n_dep |
Only defined if symbolic scalar.
Extra doc: https://github.com/casadi/casadi/wiki/L_1aa
Definition at line 228 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::scalar().
|
static |
Functions called by friend functions defined for GenericMatrix
std::string CASADI_EXPORT casadi::SX::name |
Extra doc: https://github.com/casadi/casadi/wiki/L_1a8
Definition at line 218 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::scalar().
Referenced by casadi::Matrix< Scalar >::_sym().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_19l
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_19l
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_19l
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1an
Definition at line 84 of file generic_matrix.hpp.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1aq
Definition at line 99 of file generic_matrix.hpp.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ao
Definition at line 89 of file generic_matrix.hpp.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ap
Definition at line 94 of file generic_matrix.hpp.
std::vector<Scalar>& casadi::Matrix< Scalar >::nonzeros | ( | ) |
Access the non-zero elements
Referenced by casadi::MX::bspline(), casadi::ConstantMX::create(), casadi::Matrix< Scalar >::densify(), casadi::Matrix< Scalar >::einstein(), casadi::ConstantDM::generate(), casadi::Function::generate_in(), casadi::Function::generate_out(), casadi::Matrix< Scalar >::get(), casadi::MX::get(), casadi::MX::get_nz(), casadi::SuperscsInterface::init(), casadi::QpToNlp::init(), casadi::Matrix< Scalar >::is_regular(), casadi::is_slice(), casadi::Matrix< Scalar >::is_valid_input(), casadi::ConstantDM::serialize_body(), casadi::Matrix< Scalar >::set(), casadi::MX::set(), casadi::Matrix< Scalar >::set_nz(), casadi::MX::set_nz(), casadi::SnoptInterface::solve(), casadi::to_slice(), and casadi::SnoptInterface::userfun().
const std::vector<Scalar>& casadi::Matrix< Scalar >::nonzeros | ( | ) | const |
Access the non-zero elements
|
inlinestaticinherited |
Definition at line 216 of file generic_matrix.hpp.
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined for GenericMatrix
Referenced by casadi::MX::nullspace().
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ar
Definition at line 104 of file generic_matrix.hpp.
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1bc
Definition at line 258 of file generic_matrix.hpp.
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1bb
Definition at line 248 of file generic_matrix.hpp.
|
inlinestaticinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1di
Definition at line 1275 of file generic_matrix.hpp.
|
inlinestaticinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1di
Definition at line 1278 of file generic_matrix.hpp.
|
inlinestaticinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1di
Definition at line 1279 of file generic_matrix.hpp.
casadi_int CASADI_EXPORT casadi::SX::op |
Definition at line 189 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::scalar().
Referenced by casadi::Matrix< Scalar >::is_op().
|
explicit |
Extra doc: https://github.com/casadi/casadi/wiki/L_1a6
|
explicit |
Extra doc: https://github.com/casadi/casadi/wiki/L_1a5
|
explicit |
Implementation of std::vector(Matrix) (in public API)
Extra doc: https://github.com/casadi/casadi/wiki/L_1a7
Definition at line 1402 of file matrix_decl.hpp.
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1bf
Definition at line 286 of file generic_matrix.hpp.
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1bd
Definition at line 266 of file generic_matrix.hpp.
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1bg
Definition at line 294 of file generic_matrix.hpp.
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1be
Definition at line 276 of file generic_matrix.hpp.
Matrix<Scalar> casadi::Matrix< Scalar >::operator+ | ( | ) | const |
Matrix<Scalar> casadi::Matrix< Scalar >::operator- | ( | ) | const |
std::vector< Scalar > * casadi::Matrix< Scalar >::operator-> |
Extra doc: https://github.com/casadi/casadi/wiki/L_18i
Definition at line 596 of file matrix_impl.hpp.
const std::vector< Scalar > * casadi::Matrix< Scalar >::operator-> |
Extra doc: https://github.com/casadi/casadi/wiki/L_18j
Definition at line 601 of file matrix_impl.hpp.
Matrix< Scalar > & casadi::Matrix< Scalar >::operator= | ( | const Matrix< Scalar > & | m | ) |
Definition at line 589 of file matrix_impl.hpp.
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Definition at line 703 of file matrix_impl.hpp.
References casadi::Sparsity::is_column(), casadi::Sparsity::is_empty(), casadi::Sparsity::nnz(), casadi::Sparsity::numel(), casadi::Sparsity::size1(), and casadi::Sparsity::size2().
void casadi::Matrix< Scalar >::print_dense | ( | std::ostream & | stream, |
bool | truncate = true |
||
) | const |
Definition at line 686 of file matrix_impl.hpp.
|
static |
Definition at line 817 of file matrix_impl.hpp.
References casadi::Sparsity::colind(), casadi::Sparsity::nnz(), casadi::Sparsity::row(), casadi::Sparsity::size1(), and casadi::Sparsity::size2().
|
static |
Functions called by friend functions defined for GenericMatrix
void casadi::Matrix< Scalar >::print_scalar | ( | std::ostream & | stream | ) | const |
Definition at line 609 of file matrix_impl.hpp.
|
static |
Definition at line 725 of file matrix_impl.hpp.
void casadi::Matrix< Scalar >::print_sparse | ( | std::ostream & | stream, |
bool | truncate = true |
||
) | const |
Definition at line 691 of file matrix_impl.hpp.
Referenced by casadi::CsparseInterface::nfact().
|
static |
Definition at line 771 of file matrix_impl.hpp.
References casadi::InterruptHandler::check(), casadi::Sparsity::colind(), casadi::Sparsity::nnz(), casadi::Sparsity::row(), casadi::Sparsity::size1(), and casadi::Sparsity::size2().
|
static |
Definition at line 746 of file matrix_impl.hpp.
void casadi::Matrix< Scalar >::print_split | ( | std::vector< std::string > & | nz, |
std::vector< std::string > & | inter | ||
) | const |
Definition at line 696 of file matrix_impl.hpp.
void casadi::Matrix< Scalar >::print_vector | ( | std::ostream & | stream, |
bool | truncate = true |
||
) | const |
Definition at line 636 of file matrix_impl.hpp.
|
static |
Definition at line 641 of file matrix_impl.hpp.
References casadi::Sparsity::is_column(), casadi::Sparsity::nnz(), casadi::Sparsity::row(), and casadi::Sparsity::size1().
Matrix<Scalar> casadi::Matrix< Scalar >::printme | ( | const Matrix< Scalar > & | y | ) | const |
|
static |
Functions called by friend functions defined for GenericMatrix
Scalar* casadi::Matrix< Scalar >::ptr | ( | ) |
Get a pointer to the data
Referenced by casadi::SuperscsInterface::init(), casadi::Linsol::neig(), casadi::Linsol::nfact(), casadi::FunctionInternal::nz_in(), casadi::FunctionInternal::nz_out(), casadi::Linsol::rank(), casadi::Linsol::sfact(), casadi::Linsol::solve(), casadi::CplexInterface::solve(), and casadi::GurobiInterface::solve().
const Scalar* casadi::Matrix< Scalar >::ptr | ( | ) | const |
Get a pointer to the data
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined here
|
staticinherited |
Definition at line 237 of file generic_matrix.hpp.
|
static |
Functions called by friend functions defined here
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ab
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ab
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ab
|
staticinherited |
Calculates A + 1/2 * alpha * x*y'
Extra doc: https://github.com/casadi/casadi/wiki/L_1bp
|
static |
Functions called by friend functions defined here
void casadi::Matrix< Scalar >::remove | ( | const std::vector< casadi_int > & | rr, |
const std::vector< casadi_int > & | cc | ||
) |
Remove/delete rows and/or columns of a matrix
Extra doc: https://github.com/casadi/casadi/wiki/L_19h
|
staticinherited |
Definition at line 232 of file generic_matrix.hpp.
void casadi::Matrix< Scalar >::reserve | ( | casadi_int | nnz | ) |
void casadi::Matrix< Scalar >::reserve | ( | casadi_int | nnz, |
casadi_int | ncol | ||
) |
void CASADI_EXPORT casadi::SX::reset_input |
Extra doc: https://github.com/casadi/casadi/wiki/L_19u
Definition at line 211 of file sx_instantiator.cpp.
|
static |
Functions called by friend functions defined for SparsityInterface
|
static |
Functions called by friend functions defined for SparsityInterface
void casadi::Matrix< Scalar >::resize | ( | casadi_int | nrow, |
casadi_int | ncol | ||
) |
|
static |
Functions called by friend functions defined here
|
static |
Definition at line 60 of file matrix_impl.hpp.
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b8
Definition at line 197 of file generic_matrix.hpp.
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1b8
Definition at line 200 of file generic_matrix.hpp.
|
inlineinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1at
Definition at line 114 of file generic_matrix.hpp.
const Scalar casadi::Matrix< Scalar >::scalar | ( | ) | const |
Referenced by casadi::ConstantMX::create(), casadi::Matrix< Scalar >::densify(), casadi::Matrix< Scalar >::dep(), casadi::Matrix< Scalar >::element_hash(), casadi::Matrix< Scalar >::get_output(), casadi::Matrix< Scalar >::has_output(), casadi::Matrix< Scalar >::is_call(), casadi::Matrix< Scalar >::is_commutative(), casadi::Matrix< Scalar >::is_leaf(), casadi::Matrix< Scalar >::is_op(), casadi::Matrix< Scalar >::is_output(), casadi::Matrix< Scalar >::n_dep(), casadi::Matrix< Scalar >::name(), casadi::Matrix< Scalar >::op(), casadi::Matrix< Scalar >::set(), casadi::Matrix< Scalar >::set_nz(), casadi::to_slice(), casadi::Matrix< Scalar >::which_function(), and casadi::Matrix< Scalar >::which_output().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_18o
|
static |
Functions called by friend functions defined for SparsityInterface
std::string casadi::Matrix< Scalar >::serialize | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ae
void casadi::Matrix< Scalar >::serialize | ( | SerializingStream & | s | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ah
void casadi::Matrix< Scalar >::serialize | ( | std::ostream & | stream | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ad
Referenced by casadi::SerializingStream::pack().
void casadi::Matrix< Scalar >::set | ( | const Matrix< Scalar > & | m, |
bool | ind1, | ||
const Matrix< casadi_int > & | rr | ||
) |
Set a submatrix, single argument
Definition at line 304 of file matrix_impl.hpp.
References casadi::GenericMatrix< MatType >::is_dense(), casadi::GenericMatrix< MatType >::is_scalar(), casadi::GenericMatrix< MatType >::nnz(), casadi::Matrix< Scalar >::nonzeros(), casadi::GenericMatrix< MatType >::size(), casadi::GenericMatrix< MatType >::size1(), casadi::GenericMatrix< MatType >::size2(), casadi::Matrix< Scalar >::sparsity(), casadi::str(), casadi::Matrix< Scalar >::T(), casadi::to_slice(), and casadi::Sparsity::triplet().
void casadi::Matrix< Scalar >::set | ( | const Matrix< Scalar > & | m, |
bool | ind1, | ||
const Matrix< casadi_int > & | rr, | ||
const Matrix< casadi_int > & | cc | ||
) |
Set a submatrix, two arguments
Definition at line 218 of file matrix_impl.hpp.
References casadi::GenericMatrix< MatType >::is_dense(), casadi::GenericMatrix< MatType >::is_scalar(), and casadi::to_slice().
void casadi::Matrix< Scalar >::set | ( | const Matrix< Scalar > & | m, |
bool | ind1, | ||
const Matrix< casadi_int > & | rr, | ||
const Slice & | cc | ||
) |
Set a submatrix, two arguments
Definition at line 211 of file matrix_impl.hpp.
References casadi::Slice::all().
void casadi::Matrix< Scalar >::set | ( | const Matrix< Scalar > & | m, |
bool | ind1, | ||
const Slice & | rr | ||
) |
Set a submatrix, single argument
Definition at line 285 of file matrix_impl.hpp.
References casadi::Slice::all(), casadi::GenericMatrix< MatType >::is_dense(), casadi::Slice::is_scalar(), casadi::Matrix< Scalar >::scalar(), and casadi::Slice::scalar().
Referenced by casadi::override_num().
void casadi::Matrix< Scalar >::set | ( | const Matrix< Scalar > & | m, |
bool | ind1, | ||
const Slice & | rr, | ||
const Matrix< casadi_int > & | cc | ||
) |
Set a submatrix, two arguments
Definition at line 204 of file matrix_impl.hpp.
References casadi::Slice::all().
void casadi::Matrix< Scalar >::set | ( | const Matrix< Scalar > & | m, |
bool | ind1, | ||
const Slice & | rr, | ||
const Slice & | cc | ||
) |
Set a submatrix, two arguments
Definition at line 185 of file matrix_impl.hpp.
References casadi::Slice::all(), casadi::GenericMatrix< MatType >::is_dense(), casadi::Slice::is_scalar(), casadi::Matrix< Scalar >::scalar(), and casadi::Slice::scalar().
void casadi::Matrix< Scalar >::set | ( | const Matrix< Scalar > & | m, |
bool | ind1, | ||
const Sparsity & | sp | ||
) |
Set a submatrix, single argument
Definition at line 380 of file matrix_impl.hpp.
References casadi::Sparsity::find(), casadi::GenericMatrix< MatType >::is_scalar(), casadi::Sparsity::size(), and casadi::str().
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_19b
Definition at line 42 of file sx_instantiator.cpp.
References casadi::SXNode::eq_depth_.
void casadi::Matrix< Scalar >::set_nz | ( | const Matrix< Scalar > & | m, |
bool | ind1, | ||
const Matrix< casadi_int > & | k | ||
) |
Set a set of nonzeros
Definition at line 447 of file matrix_impl.hpp.
References casadi::GenericMatrix< MatType >::is_dense(), casadi::GenericMatrix< MatType >::is_scalar(), casadi::Matrix< Scalar >::nonzeros(), casadi::GenericMatrix< MatType >::size(), casadi::GenericMatrix< MatType >::size1(), casadi::GenericMatrix< MatType >::size2(), casadi::Matrix< Scalar >::sparsity(), casadi::str(), casadi::Matrix< Scalar >::T(), and casadi::to_slice().
void casadi::Matrix< Scalar >::set_nz | ( | const Matrix< Scalar > & | m, |
bool | ind1, | ||
const Slice & | k | ||
) |
Set a set of nonzeros
Definition at line 435 of file matrix_impl.hpp.
References casadi::Slice::all(), casadi::Slice::is_scalar(), casadi::Matrix< Scalar >::scalar(), and casadi::Slice::scalar().
|
static |
Definition at line 39 of file matrix_impl.hpp.
|
static |
Definition at line 45 of file matrix_impl.hpp.
|
static |
Definition at line 42 of file matrix_impl.hpp.
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ax
Definition at line 136 of file generic_matrix.hpp.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ay
Definition at line 141 of file generic_matrix.hpp.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1as
Definition at line 109 of file generic_matrix.hpp.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1au
Definition at line 119 of file generic_matrix.hpp.
|
staticinherited |
Definition at line 228 of file generic_matrix.hpp.
|
staticinherited |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined for GenericMatrix
Referenced by casadi::SymbolicQr::init().
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined here
const Sparsity& casadi::Matrix< Scalar >::sparsity | ( | ) | const |
Referenced by casadi::HpmpcInterface::blocksparsity(), casadi::HpipmInterface::blocksparsity(), casadi::FatropConicInterface::blocksparsity(), casadi::ConstantMX::create(), casadi::dplesol(), casadi::Matrix< Scalar >::get(), casadi::MX::get(), casadi::FunctionInternal::get_jac_sparsity_hierarchical(), casadi::FunctionInternal::get_jac_sparsity_hierarchical_symm(), casadi::MX::get_nz(), casadi::SnoptInterface::init(), casadi::SuperscsInterface::init(), casadi::SymbolicQr::init(), casadi::CplexInterface::init_mem(), casadi::SuperscsInterface::init_mem(), casadi::Linsol::neig(), casadi::Linsol::nfact(), casadi::CsparseInterface::nfact(), casadi::Linsol::rank(), casadi::Matrix< Scalar >::set(), casadi::MX::set(), casadi::Matrix< Scalar >::set_nz(), casadi::MX::set_nz(), casadi::Linsol::sfact(), casadi::CplexInterface::solve(), casadi::GurobiInterface::solve(), casadi::SuperscsInterface::solve(), casadi::SnoptInterface::userfun(), and casadi::OptiNode::value().
|
static |
Functions called by friend functions defined for SparsityInterface
|
inlinestaticinherited |
Definition at line 215 of file generic_matrix.hpp.
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for GenericMatrix
|
inlinestaticinherited |
Definition at line 225 of file generic_matrix.hpp.
|
inlinestaticinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1de
Definition at line 1234 of file generic_matrix.hpp.
|
inlinestaticinherited |
with nrow-by-ncol symbolic primitives
Extra doc: https://github.com/casadi/casadi/wiki/L_1dg
Definition at line 1253 of file generic_matrix.hpp.
|
inlinestaticinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1da
Definition at line 1206 of file generic_matrix.hpp.
|
inlinestaticinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1dc
Definition at line 1220 of file generic_matrix.hpp.
|
staticinherited |
with symbolic primitives of given sparsity
Extra doc: https://github.com/casadi/casadi/wiki/L_1dd
Definition at line 1229 of file generic_matrix.hpp.
|
staticinherited |
symbolic primitives with given sparsity
Extra doc: https://github.com/casadi/casadi/wiki/L_1df
Definition at line 1245 of file generic_matrix.hpp.
|
inlinestaticinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1db
Definition at line 1213 of file generic_matrix.hpp.
|
static |
Functions called by friend functions defined for GenericMatrix
Matrix<Scalar> casadi::Matrix< Scalar >::T | ( | ) | const |
|
staticinherited |
Functions called by friend functions defined here
|
static |
Functions called by friend functions defined here
|
static |
void casadi::Matrix< Scalar >::to_file | ( | const std::string & | filename, |
const std::string & | format = "" |
||
) | const |
Export numerical matrix to file
Supported formats:
* - .mtx Matrix Market (sparse) * - .txt Ascii full precision representation (sparse) * Whitespace separated, aligned. * Comments with # % or / * Uses C locale * Structural zeros represented by 00 * Does not scale well for large sparse matrices *
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined here
|
inlinestaticinherited |
Definition at line 219 of file generic_matrix.hpp.
|
staticinherited |
Definition at line 230 of file generic_matrix.hpp.
|
static |
Default matrix size is max(col) x max(row)
Extra doc: https://github.com/casadi/casadi/wiki/L_23t
|
static |
Default matrix size is max(col) x max(row)
Extra doc: https://github.com/casadi/casadi/wiki/L_23t
|
static |
Default matrix size is max(col) x max(row)
Extra doc: https://github.com/casadi/casadi/wiki/L_23t
|
inlinestaticinherited |
Definition at line 222 of file generic_matrix.hpp.
|
staticinherited |
Definition at line 231 of file generic_matrix.hpp.
|
static |
Definition at line 606 of file matrix_impl.hpp.
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_18o
|
static |
Functions called by friend functions defined for GenericMatrix
|
static |
Functions called by friend functions defined for SparsityInterface
|
static |
Functions called by friend functions defined for SparsityInterface
|
static |
Functions called by friend functions defined here
Function CASADI_EXPORT casadi::SX::which_function |
Extra doc: https://github.com/casadi/casadi/wiki/L_28n
Definition at line 170 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::scalar().
casadi_int CASADI_EXPORT casadi::SX::which_output |
Extra doc: https://github.com/casadi/casadi/wiki/L_28m
Definition at line 175 of file sx_instantiator.cpp.
References casadi::Matrix< Scalar >::scalar().
|
inlinestaticinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1dh
Definition at line 1262 of file generic_matrix.hpp.
|
inlinestaticinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1dh
Definition at line 1265 of file generic_matrix.hpp.
|
inlinestaticinherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1dh
Definition at line 1266 of file generic_matrix.hpp.
|
friend |
|
friend |