Functions | Friends
Expression tools

Functions

static ExType casadi::GenericExpression< ExType >::plus (const ExType &x, const ExType &y)
 Addition: (x,y) -> x + y. More...
 
ExType & casadi::GenericExpression< ExType >::operator+= (const ExType &y)
 
static MatType casadi::GenericMatrix< MatType >::logsumexp (const MatType &x)
 

Friends

ExType casadi::GenericExpression< ExType >::plus (const ExType &x, const ExType &y)
 
ExType casadi::GenericExpression< ExType >::operator+ (const ExType &x, const ExType &y)
 
MatType casadi::GenericMatrix< MatType >::interp1d (const std::vector< double > &x, const MatType &v, const std::vector< double > &xq, const std::string &mode, bool equidistant=false)
 Performs 1d linear interpolation. More...
 
MatType casadi::GenericMatrix< MatType >::mpower (const MatType &x, const MatType &n)
 Matrix power x^n. More...
 
MatType casadi::GenericMatrix< MatType >::soc (const MatType &x, const MatType &y)
 Construct second-order-convex. More...
 
MatType casadi::GenericMatrix< MatType >::mrdivide (const MatType &x, const MatType &n)
 Matrix divide (cf. slash '/' in MATLAB) More...
 
MatType casadi::GenericMatrix< MatType >::mldivide (const MatType &x, const MatType &n)
 Matrix divide (cf. backslash '\' in MATLAB) More...
 
std::vector< MatType > casadi::GenericMatrix< MatType >::symvar (const MatType &x)
 Get all symbols contained in the supplied expression. More...
 
MatType casadi::GenericMatrix< MatType >::sumsqr (const MatType &x)
 Calculate sum of squares: sum_ij X_ij^2. More...
 
MatType casadi::GenericMatrix< MatType >::logsumexp (const MatType &x)
 x -> log(sum_i exp(x_i)) More...
 
MatType casadi::GenericMatrix< MatType >::logsumexp (const MatType &x, const MatType &margin)
 Scaled version of logsumexp. More...
 
MatType casadi::GenericMatrix< MatType >::linspace (const MatType &a, const MatType &b, casadi_int nsteps)
 Matlab's linspace command. More...
 
MatType casadi::GenericMatrix< MatType >::cross (const MatType &a, const MatType &b, casadi_int dim=-1)
 Matlab's cross command. More...
 
MatType casadi::GenericMatrix< MatType >::skew (const MatType &a)
 Generate a skew symmetric matrix from a 3-vector. More...
 
MatType casadi::GenericMatrix< MatType >::inv_skew (const MatType &a)
 Generate the 3-vector progenitor of a skew symmetric matrix. More...
 
MatType casadi::GenericMatrix< MatType >::det (const MatType &A)
 Matrix determinant (experimental) More...
 
MatType casadi::GenericMatrix< MatType >::det (const MatType &A, const std::string &lsolver, const Dict &dict=Dict())
 Matrix determinant (experimental) More...
 
MatType casadi::GenericMatrix< MatType >::inv_minor (const MatType &A)
 Matrix inverse (experimental) More...
 
MatType casadi::GenericMatrix< MatType >::inv (const MatType &A)
 Matrix inverse. More...
 
MatType casadi::GenericMatrix< MatType >::inv (const MatType &A, const std::string &lsolver, const Dict &options=Dict())
 Matrix inverse. More...
 
MatType casadi::GenericMatrix< MatType >::trace (const MatType &x)
 Matrix trace. More...
 
MatType casadi::GenericMatrix< MatType >::tril2symm (const MatType &a)
 Convert a lower triangular matrix to a symmetric one. More...
 
MatType casadi::GenericMatrix< MatType >::triu2symm (const MatType &a)
 Convert a upper triangular matrix to a symmetric one. More...
 
MatType casadi::GenericMatrix< MatType >::norm_fro (const MatType &x)
 Frobenius norm. More...
 
MatType casadi::GenericMatrix< MatType >::norm_2 (const MatType &x)
 2-norm More...
 
MatType casadi::GenericMatrix< MatType >::norm_1 (const MatType &x)
 1-norm More...
 
MatType casadi::GenericMatrix< MatType >::norm_inf (const MatType &x)
 Infinity-norm. More...
 
MatType casadi::GenericMatrix< MatType >::diff (const MatType &x, casadi_int n=1, casadi_int axis=-1)
 Returns difference (n-th order) along given axis (MATLAB convention) More...
 
MatType casadi::GenericMatrix< MatType >::cumsum (const MatType &x, casadi_int axis=-1)
 Returns cumulative sum along given axis (MATLAB convention) More...
 
MatType casadi::GenericMatrix< MatType >::dot (const MatType &x, const MatType &y)
 Inner product of two matrices. More...
 
MatType casadi::GenericMatrix< MatType >::nullspace (const MatType &A)
 Computes the nullspace of a matrix A. More...
 
MatType casadi::GenericMatrix< MatType >::polyval (const MatType &p, const MatType &x)
 Evaluate a polynomial with coefficients p in x. More...
 
MatType casadi::GenericMatrix< MatType >::diag (const MatType &A)
 Get the diagonal of a matrix or construct a diagonal. More...
 
MatType casadi::GenericMatrix< MatType >::unite (const MatType &A, const MatType &B)
 Unite two matrices no overlapping sparsity. More...
 
MatType casadi::GenericMatrix< MatType >::densify (const MatType &x)
 Make the matrix dense if not already. More...
 
MatType casadi::GenericMatrix< MatType >::densify (const MatType &x, const MatType &val)
 Make the matrix dense and assign nonzeros to a value. More...
 
MatType casadi::GenericMatrix< MatType >::project (const MatType &A, const Sparsity &sp, bool intersect=false)
 Create a new matrix with a given sparsity pattern but with the. More...
 
MatType casadi::GenericMatrix< MatType >::if_else (const MatType &cond, const MatType &if_true, const MatType &if_false, bool short_circuit=false)
 Branching on MX nodes. More...
 
MatType casadi::GenericMatrix< MatType >::conditional (const MatType &ind, const std::vector< MatType > &x, const MatType &x_default, bool short_circuit=false)
 Create a switch. More...
 
bool casadi::GenericMatrix< MatType >::depends_on (const MatType &f, const MatType &arg)
 Check if expression depends on the argument. More...
 
MatType casadi::GenericMatrix< MatType >::substitute (const MatType &ex, const MatType &v, const MatType &vdef)
 Substitute variable v with expression vdef in an expression ex. More...
 
std::vector< MatType > casadi::GenericMatrix< MatType >::substitute (const std::vector< MatType > &ex, const std::vector< MatType > &v, const std::vector< MatType > &vdef)
 Substitute variable var with expression expr in multiple expressions. More...
 
void casadi::GenericMatrix< MatType >::substitute_inplace (const std::vector< MatType > &v, std::vector< MatType > &inout_vdef, std::vector< MatType > &inout_ex, bool reverse=false)
 Inplace substitution with piggyback expressions. More...
 
MatType casadi::GenericMatrix< MatType >::cse (const MatType &e)
 Common subexpression elimination. More...
 
std::vector< MatType > casadi::GenericMatrix< MatType >::cse (const std::vector< MatType > &e)
 Common subexpression elimination. More...
 
MatType casadi::GenericMatrix< MatType >::solve (const MatType &A, const MatType &b)
 Solve a system of equations: A*x = b. More...
 
MatType casadi::GenericMatrix< MatType >::solve (const MatType &A, const MatType &b, const std::string &lsolver, const Dict &dict=Dict())
 Solve a system of equations: A*x = b. More...
 
MatType casadi::GenericMatrix< MatType >::linearize (const MatType &f, const MatType &x, const MatType &x0, const Dict &opts=Dict())
 Linearize an expression. More...
 
MatType casadi::GenericMatrix< MatType >::pinv (const MatType &A)
 Computes the Moore-Penrose pseudo-inverse. More...
 
MatType casadi::GenericMatrix< MatType >::pinv (const MatType &A, const std::string &lsolver, const Dict &dict=Dict())
 Computes the Moore-Penrose pseudo-inverse. More...
 
MatType casadi::GenericMatrix< MatType >::expm_const (const MatType &A, const MatType &t)
 Calculate Matrix exponential. More...
 
MatType casadi::GenericMatrix< MatType >::expm (const MatType &A)
 Calculate Matrix exponential. More...
 
MatType casadi::GenericMatrix< MatType >::jacobian (const MatType &ex, const MatType &arg, const Dict &opts=Dict())
 Calculate Jacobian. More...
 
MatType casadi::GenericMatrix< MatType >::gradient (const MatType &ex, const MatType &arg, const Dict &opts=Dict())
 Calculate the gradient of an expression. More...
 
MatType casadi::GenericMatrix< MatType >::tangent (const MatType &ex, const MatType &arg, const Dict &opts=Dict())
 Calculate the tangent of an expression. More...
 
MatType casadi::GenericMatrix< MatType >::jtimes (const MatType &ex, const MatType &arg, const MatType &v, bool tr=false, const Dict &opts=Dict())
 Calculate the Jacobian and multiply by a vector from the right. More...
 
std::vector< std::vector< MatType > > casadi::GenericMatrix< MatType >::forward (const std::vector< MatType > &ex, const std::vector< MatType > &arg, const std::vector< std::vector< MatType > > &v, const Dict &opts=Dict())
 Forward directional derivative. More...
 
std::vector< std::vector< MatType > > casadi::GenericMatrix< MatType >::reverse (const std::vector< MatType > &ex, const std::vector< MatType > &arg, const std::vector< std::vector< MatType > > &v, const Dict &opts=Dict())
 Reverse directional derivative. More...
 
std::vector< bool > casadi::GenericMatrix< MatType >::which_depends (const MatType &expr, const MatType &var, casadi_int order, bool tr)
 Find out which variables enter with some order. More...
 
Sparsity casadi::GenericMatrix< MatType >::jacobian_sparsity (const MatType &f, const MatType &x)
 Get the sparsity pattern of a jacobian. More...
 
bool casadi::GenericMatrix< MatType >::is_linear (const MatType &expr, const MatType &var)
 Is expr linear in var? More...
 
bool casadi::GenericMatrix< MatType >::is_quadratic (const MatType &expr, const MatType &var)
 Is expr quadratic in var? More...
 
void casadi::GenericMatrix< MatType >::quadratic_coeff (const MatType &expr, const MatType &var, MatType &A, MatType &b, MatType &c, bool check=true)
 Recognizes quadratic form in scalar expression. More...
 
void casadi::GenericMatrix< MatType >::linear_coeff (const MatType &expr, const MatType &var, MatType &A, MatType &b, bool check=true)
 Recognizes linear form in vector expression. More...
 
void casadi::GenericMatrix< MatType >::extract_parametric (const MatType &expr, const MatType &par, MatType &expr_ret, std::vector< MatType > &symbols, std::vector< MatType > &parametric, const Dict &opts=Dict())
 Extract purely parametric parts from an expression graph. More...
 
void casadi::GenericMatrix< MatType >::extract_parametric (const std::vector< MatType > &expr, const MatType &par, std::vector< MatType > &expr_ret, std::vector< MatType > &symbols, std::vector< MatType > &parametric, const Dict &opts=Dict())
 
void casadi::GenericMatrix< MatType >::extract_parametric (const std::vector< MatType > &expr, const std::vector< MatType > &par, std::vector< MatType > &expr_ret, std::vector< MatType > &symbols, std::vector< MatType > &parametric, const Dict &opts=Dict())
 
void casadi::GenericMatrix< MatType >::extract_parametric (const MatType &expr, const std::vector< MatType > &par, MatType &expr_ret, std::vector< MatType > &symbols, std::vector< MatType > &parametric, const Dict &opts=Dict())
 
void casadi::GenericMatrix< MatType >::separate_linear (const MatType &expr, const MatType &sym_lin, const MatType &sym_const, MatType &expr_const, MatType &expr_lin, MatType &expr_nonlin)
 
void casadi::GenericMatrix< MatType >::separate_linear (const MatType &expr, const std::vector< MatType > &sym_lin, const std::vector< MatType > &sym_const, MatType &expr_const, MatType &expr_lin, MatType &expr_nonlin)
 
casadi_int casadi::GenericMatrix< MatType >::n_nodes (const MatType &A)
 
MatType casadi::GenericMatrix< MatType >::simplify (const MatType &x)
 Simplify an expression. More...
 
std::string casadi::GenericMatrix< MatType >::print_operator (const MatType &xb, const std::vector< std::string > &args)
 Get a string representation for a binary MatType, using custom arguments. More...
 
void casadi::GenericMatrix< MatType >::extract (std::vector< MatType > &ex, std::vector< MatType > &v, std::vector< MatType > &vdef, const Dict &opts=Dict())
 Introduce intermediate variables for selected nodes in a graph. More...
 
void casadi::GenericMatrix< MatType >::shared (std::vector< MatType > &ex, std::vector< MatType > &v, std::vector< MatType > &vdef, const std::string &v_prefix="v_", const std::string &v_suffix="")
 Extract shared subexpressions from an set of expressions. More...
 
MatType casadi::GenericMatrix< MatType >::repsum (const MatType &A, casadi_int n, casadi_int m=1)
 Given a repeated matrix, computes the sum of repeated parts. More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::adj (const Matrix< Scalar > &A)
 Matrix adjoint. More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::minor (const Matrix< Scalar > &x, casadi_int i, casadi_int j)
 Get the (i,j) minor matrix. More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::cofactor (const Matrix< Scalar > &x, casadi_int i, casadi_int j)
 Get the (i,j) cofactor matrix. More...
 
void casadi::Matrix< Scalar >::qr (const Matrix< Scalar > &A, Matrix< Scalar > &Q, Matrix< Scalar > &R)
 QR factorization using the modified Gram-Schmidt algorithm. More...
 
void casadi::Matrix< Scalar >::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 > casadi::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 > casadi::Matrix< Scalar >::chol (const Matrix< Scalar > &A)
 Obtain a Cholesky factorisation of a matrix. More...
 
void casadi::Matrix< Scalar >::ldl (const Matrix< Scalar > &A, Matrix< Scalar > &D, Matrix< Scalar > &LT, std::vector< casadi_int > &p, bool amd=true)
 Sparse LDL^T factorization. More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::ldl_solve (const Matrix< Scalar > &b, const Matrix< Scalar > &D, const Matrix< Scalar > &LT, const std::vector< casadi_int > &p)
 Solve using a sparse LDL^T factorization. More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::any (const Matrix< Scalar > &x)
 Returns true only if any element in the matrix is true. More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::all (const Matrix< Scalar > &x)
 Returns true only if every element in the matrix is true. More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::norm_inf_mul (const Matrix< Scalar > &x, const Matrix< Scalar > &y)
 Inf-norm of a Matrix-Matrix product. More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::sparsify (const Matrix< Scalar > &A, double tol=0)
 Make a matrix sparse by removing numerical zeros. More...
 
void casadi::Matrix< Scalar >::expand (const Matrix< Scalar > &ex, Matrix< Scalar > &weights, Matrix< Scalar > &terms)
 Expand the expression as a weighted sum (with constant weights) More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::pw_const (const Matrix< Scalar > &t, const Matrix< Scalar > &tval, const Matrix< Scalar > &val)
 Create a piecewise constant function. More...
 
Matrix< Scalar > casadi::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 > casadi::Matrix< Scalar >::heaviside (const Matrix< Scalar > &x)
 Heaviside function. More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::rectangle (const Matrix< Scalar > &x)
 rectangle function More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::triangle (const Matrix< Scalar > &x)
 triangle function More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::ramp (const Matrix< Scalar > &x)
 ramp function More...
 
Matrix< Scalar > casadi::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 > casadi::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 > casadi::Matrix< Scalar >::poly_coeff (const Matrix< Scalar > &f, const Matrix< Scalar > &x)
 extracts polynomial coefficients from an expression More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::poly_roots (const Matrix< Scalar > &p)
 Attempts to find the roots of a polynomial. More...
 
Matrix< Scalar > casadi::Matrix< Scalar >::eig_symbolic (const Matrix< Scalar > &m)
 Attempts to find the eigenvalues of a symbolic matrix. More...
 
Matrix< double > casadi::Matrix< Scalar >::evalf (const Matrix< Scalar > &expr)
 Evaluates the expression numerically. More...
 
MX casadi::MX::find (const MX &x)
 Find first nonzero, returned as row index. More...
 
MX casadi::MX::low (const MX &v, const MX &p, const Dict &options=Dict())
 Find first nonzero. More...
 
MX casadi::MX::graph_substitute (const MX &ex, const std::vector< MX > &v, const std::vector< MX > &vdef)
 Substitute single expression in graph. More...
 
MX casadi::MX::graph_substitute (const MX &ex, const std::vector< MX > &v, const std::vector< MX > &vdef, bool &updated)
 
std::vector< MXcasadi::MX::graph_substitute (const std::vector< MX > &ex, const std::vector< MX > &v, const std::vector< MX > &vdef)
 Substitute multiple expressions in graph. More...
 
std::vector< MXcasadi::MX::graph_substitute (const std::vector< MX > &ex, const std::vector< MX > &v, const std::vector< MX > &vdef, bool &updated)
 
MX casadi::MX::matrix_expand (const MX &e, const std::vector< MX > &boundary=std::vector< MX >(), const Dict &options=Dict())
 Expand MX graph to SXFunction call. More...
 
std::vector< MXcasadi::MX::matrix_expand (const std::vector< MX > &e, const std::vector< MX > &boundary=std::vector< MX >(), const Dict &options=Dict())
 Expand MX graph to SXFunction call. More...
 
MX casadi::MX::bspline (const MX &x, const DM &coeffs, const std::vector< std::vector< double > > &knots, const std::vector< casadi_int > &degree, casadi_int m, const Dict &opts=Dict())
 
MX casadi::MX::bspline (const MX &x, const MX &coeffs, const std::vector< std::vector< double > > &knots, const std::vector< casadi_int > &degree, casadi_int m, const Dict &opts=Dict())
 
MX casadi::MX::bspline (const MX &x, const MX &coeffs, const std::vector< MX > &knots, const std::vector< casadi_int > &degree, casadi_int m, const Dict &opts=Dict())
 
DM casadi::MX::bspline_dual (const std::vector< double > &x, const std::vector< std::vector< double > > &knots, const std::vector< casadi_int > &degree, const Dict &opts=Dict())
 
MX casadi::MX::convexify (const MX &H, const Dict &opts=Dict())
 
MX casadi::MX::lift (const MX &x, const MX &x_guess)
 Lift the expression. More...
 
MX casadi::MX::inv_node (const MX &x)
 Inverse node. More...
 
DM casadi::MX::evalf (const MX &expr)
 Evaluates the expression numerically. More...
 
MX casadi::MX::stop_diff (const MX &expr, casadi_int order)
 Stop derivatives of an expression wrt to all its symbolic variables. More...
 
MX casadi::MX::no_grad (const MX &expr)
 Stop first derivatives of an expression wrt to all its symbolic variables. More...
 
MX casadi::MX::no_hess (const MX &expr)
 Stop second derivatives of an expression wrt to all its symbolic variables. More...
 
MX casadi::MX::stop_diff (const MX &expr, const MX &var, casadi_int order)
 Stop derivatives of an expression wrt to a select set of symbolic variables. More...
 
std::vector< MXcasadi::MX::difference (const std::vector< MX > &a, const std::vector< MX > &b)
 
MatType casadi::SparsityInterface< MatType >::horzcat (const std::vector< MatType > &v)
 Concatenate a list of matrices horizontally. More...
 
MatType casadi::SparsityInterface< MatType >::vertcat (const std::vector< MatType > &v)
 Concatenate a list of matrices vertically. More...
 
std::vector< MatType > casadi::SparsityInterface< MatType >::horzsplit (const MatType &x, const std::vector< casadi_int > &offset)
 split horizontally, retaining groups of columns More...
 
std::vector< MatType > casadi::SparsityInterface< MatType >::horzsplit (const MatType &x, casadi_int incr=1)
 split horizontally, retaining fixed-sized groups of columns More...
 
std::vector< MatType > casadi::SparsityInterface< MatType >::horzsplit_n (const MatType &x, casadi_int n)
 split horizontally, retaining fixed-sized groups of columns More...
 
std::vector< MatType > casadi::SparsityInterface< MatType >::vertsplit (const MatType &x, const std::vector< casadi_int > &offset)
 split vertically, retaining groups of rows More...
 
std::vector< casadi_int > casadi::SparsityInterface< MatType >::offset (const std::vector< MatType > &v, bool vert=true)
 Helper function, get offsets corresponding to a vector of matrices. More...
 
std::vector< MatType > casadi::SparsityInterface< MatType >::vertsplit (const MatType &x, casadi_int incr=1)
 split vertically, retaining fixed-sized groups of rows More...
 
std::vector< MatType > casadi::SparsityInterface< MatType >::vertsplit_n (const MatType &x, casadi_int n)
 split vertically, retaining fixed-sized groups of rows More...
 
MatType casadi::SparsityInterface< MatType >::blockcat (const std::vector< std::vector< MatType > > &v)
 Construct a matrix from a list of list of blocks. More...
 
MatType casadi::SparsityInterface< MatType >::blockcat (const MatType &A, const MatType &B, const MatType &C, const MatType &D)
 Construct a matrix from 4 blocks. More...
 
std::vector< std::vector< MatType > > casadi::SparsityInterface< MatType >::blocksplit (const MatType &x, const std::vector< casadi_int > &vert_offset, const std::vector< casadi_int > &horz_offset)
 chop up into blocks More...
 
std::vector< std::vector< MatType > > casadi::SparsityInterface< MatType >::blocksplit (const MatType &x, casadi_int vert_incr=1, casadi_int horz_incr=1)
 chop up into blocks More...
 
MatType casadi::SparsityInterface< MatType >::diagcat (const std::vector< MatType > &A)
 Construct a matrix with given block on the diagonal. More...
 
std::vector< MatType > casadi::SparsityInterface< MatType >::diagsplit (const MatType &x, const std::vector< casadi_int > &output_offset1, const std::vector< casadi_int > &output_offset2)
 split diagonally, retaining square matrices More...
 
std::vector< MatType > casadi::SparsityInterface< MatType >::diagsplit (const MatType &x, const std::vector< casadi_int > &output_offset)
 split diagonally, retaining square matrices More...
 
std::vector< MatType > casadi::SparsityInterface< MatType >::diagsplit (const MatType &x, casadi_int incr=1)
 split diagonally, retaining groups of square matrices More...
 
std::vector< MatType > casadi::SparsityInterface< MatType >::diagsplit (const MatType &x, casadi_int incr1, casadi_int incr2)
 split diagonally, retaining fixed-sized matrices More...
 
MatType casadi::SparsityInterface< MatType >::veccat (const std::vector< MatType > &x)
 concatenate vertically while vectorizing all arguments with vec More...
 
MatType casadi::SparsityInterface< MatType >::mtimes (const MatType &x, const MatType &y, const std::string &blas="reference")
 Matrix product of two matrices. More...
 
MatType casadi::SparsityInterface< MatType >::mtimes (const std::vector< MatType > &args, const std::string &blas="reference")
 Matrix product of n matrices. More...
 
MatType casadi::SparsityInterface< MatType >::mac (const MatType &x, const MatType &y, const MatType &z, const std::string &blas="reference")
 Multiply-accumulate operation. More...
 
MatType casadi::SparsityInterface< MatType >::transpose (const MatType &X)
 Transpose. More...
 
MatType casadi::SparsityInterface< MatType >::vec (const MatType &x)
 make a vector More...
 
MatType casadi::SparsityInterface< MatType >::reshape (const MatType &x, casadi_int nrow, casadi_int ncol)
 Returns a reshaped version of the matrix. More...
 
MatType casadi::SparsityInterface< MatType >::reshape (const MatType &x, std::pair< casadi_int, casadi_int > rc)
 Returns a reshaped version of the matrix, dimensions as a vector. More...
 
MatType casadi::SparsityInterface< MatType >::reshape (const MatType &x, const Sparsity &sp)
 Reshape the matrix. More...
 
MatType casadi::SparsityInterface< MatType >::sparsity_cast (const MatType &x, const Sparsity &sp)
 Cast matrix nonzeros to different Sparsity. More...
 
casadi_int casadi::SparsityInterface< MatType >::sprank (const MatType &x)
 Obtain the structural rank of a sparsity-pattern. More...
 
casadi_int casadi::SparsityInterface< MatType >::norm_0_mul (const MatType &x, const MatType &y)
 0-norm (nonzero count) of a Matrix-matrix product More...
 
MatType casadi::SparsityInterface< MatType >::triu (const MatType &x, bool includeDiagonal=true)
 Get the upper triangular part of a matrix. More...
 
MatType casadi::SparsityInterface< MatType >::tril (const MatType &x, bool includeDiagonal=true)
 Get the lower triangular part of a matrix. More...
 
MatType casadi::SparsityInterface< MatType >::kron (const MatType &a, const MatType &b)
 Kronecker tensor product. More...
 
MatType casadi::SparsityInterface< MatType >::repmat (const MatType &A, casadi_int n, casadi_int m=1)
 Repeat matrix A n times vertically and m times horizontally. More...
 
MatType casadi::SparsityInterface< MatType >::repmat (const MatType &A, const std::pair< casadi_int, casadi_int > &rc)
 Repeat matrix A n times vertically and m times horizontally. More...
 
MatType casadi::SparsityInterface< MatType >::horzcat (const MatType &x, const MatType &y)
 Concatenate horizontally, two matrices. More...
 
MatType casadi::SparsityInterface< MatType >::horzcat (const MatType &x, const MatType &y, const MatType &z)
 Concatenate horizontally, three matrices. More...
 
MatType casadi::SparsityInterface< MatType >::horzcat (const MatType &x, const MatType &y, const MatType &z, const MatType &w)
 Concatenate horizontally, four matrices. More...
 
MatType casadi::SparsityInterface< MatType >::horzcat (const MatType &x, const MatType &y, const MatType &z, const MatType &w, const MatType &v)
 Concatenate horizontally, five matrices. More...
 
MatType casadi::SparsityInterface< MatType >::horzcat (const MatType &x, const MatType &y, const MatType &z, const MatType &w, const MatType &v, const MatType &u)
 Concatenate horizontally, six matrices. More...
 
MatType casadi::SparsityInterface< MatType >::vertcat (const MatType &x, const MatType &y)
 Concatenate vertically, two matrices. More...
 
MatType casadi::SparsityInterface< MatType >::vertcat (const MatType &x, const MatType &y, const MatType &z)
 Concatenate vertically, three matrices. More...
 
MatType casadi::SparsityInterface< MatType >::vertcat (const MatType &x, const MatType &y, const MatType &z, const MatType &w)
 Concatenate vertically, four matrices. More...
 
MatType casadi::SparsityInterface< MatType >::vertcat (const MatType &x, const MatType &y, const MatType &z, const MatType &w, const MatType &v)
 Concatenate vertically, five matrices. More...
 
MatType casadi::SparsityInterface< MatType >::vertcat (const MatType &x, const MatType &y, const MatType &z, const MatType &w, const MatType &v, const MatType &u)
 Concatenate vertically, six matrices. More...
 
MatType casadi::SparsityInterface< MatType >::diagcat (const MatType &x, const MatType &y)
 Concatenate along diagonal, two matrices. More...
 
MatType casadi::SparsityInterface< MatType >::diagcat (const MatType &x, const MatType &y, const MatType &z)
 Concatenate along diagonal, three matrices. More...
 
MatType casadi::SparsityInterface< MatType >::diagcat (const MatType &x, const MatType &y, const MatType &z, const MatType &w)
 Concatenate along diagonal, four matrices. More...
 
MatType casadi::SparsityInterface< MatType >::diagcat (const MatType &x, const MatType &y, const MatType &z, const MatType &w, const MatType &v)
 Concatenate along diagonal, five matrices. More...
 
MatType casadi::SparsityInterface< MatType >::diagcat (const MatType &x, const MatType &y, const MatType &z, const MatType &w, const MatType &v, const MatType &u)
 Concatenate along diagonal, six matrices. More...
 
MatType casadi::SparsityInterface< MatType >::sum1 (const MatType &x)
 Return a row-wise summation of elements. More...
 
MatType casadi::SparsityInterface< MatType >::sum2 (const MatType &x)
 Return a column-wise summation of elements. More...
 
MatType casadi::SparsityInterface< MatType >::sum (const MatType &x)
 Returns summation of all elements. More...
 
static ExType casadi::GenericExpression< ExType >::minus (const ExType &x, const ExType &y)
 Subtraction: (x,y) -> x - y. More...
 
ExType & casadi::GenericExpression< ExType >::operator-= (const ExType &y)
 Subtraction: (x,y) -> x - y. More...
 
ExType casadi::GenericExpression< ExType >::minus (const ExType &x, const ExType &y)
 Subtraction: (x,y) -> x - y. More...
 
ExType casadi::GenericExpression< ExType >::operator- (const ExType &x, const ExType &y)
 Subtraction: (x,y) -> x - y. More...
 
static ExType casadi::GenericExpression< ExType >::times (const ExType &x, const ExType &y)
 Elementwise multiplication: (x,y) -> x .* y. More...
 
ExType & casadi::GenericExpression< ExType >::operator*= (const ExType &y)
 Elementwise multiplication: (x,y) -> x .* y. More...
 
ExType casadi::GenericExpression< ExType >::times (const ExType &x, const ExType &y)
 Elementwise multiplication: (x,y) -> x .* y. More...
 
ExType casadi::GenericExpression< ExType >::operator* (const ExType &x, const ExType &y)
 Elementwise multiplication: (x,y) -> x .* y. More...
 
static ExType casadi::GenericExpression< ExType >::rdivide (const ExType &x, const ExType &y)
 Elementwise division: (x,y) -> x ./ y. More...
 
ExType & casadi::GenericExpression< ExType >::operator/= (const ExType &y)
 Elementwise division: (x,y) -> x ./ y. More...
 
ExType casadi::GenericExpression< ExType >::rdivide (const ExType &x, const ExType &y)
 Elementwise division: (x,y) -> x ./ y. More...
 
ExType casadi::GenericExpression< ExType >::operator/ (const ExType &x, const ExType &y)
 Elementwise division: (x,y) -> x ./ y. More...
 
static ExType casadi::GenericExpression< ExType >::lt (const ExType &x, const ExType &y)
 Logical less than: (x,y) -> x < y. More...
 
ExType casadi::GenericExpression< ExType >::lt (const ExType &x, const ExType &y)
 Logical less than: (x,y) -> x < y. More...
 
ExType casadi::GenericExpression< ExType >::operator< (const ExType &x, const ExType &y)
 Logical less than: (x,y) -> x < y. More...
 
static ExType casadi::GenericExpression< ExType >::le (const ExType &x, const ExType &y)
 Logical less or equal to: (x,y) -> x <= y. More...
 
ExType casadi::GenericExpression< ExType >::le (const ExType &x, const ExType &y)
 Logical less or equal to: (x,y) -> x <= y. More...
 
ExType casadi::GenericExpression< ExType >::operator<= (const ExType &x, const ExType &y)
 Logical less or equal to: (x,y) -> x <= y. More...
 
static ExType casadi::GenericExpression< ExType >::gt (const ExType &x, const ExType &y)
 Logical greater than: (x,y) -> x > y. More...
 
ExType casadi::GenericExpression< ExType >::gt (const ExType &x, const ExType &y)
 Logical greater than: (x,y) -> x > y. More...
 
ExType casadi::GenericExpression< ExType >::operator> (const ExType &x, const ExType &y)
 Logical greater than: (x,y) -> x > y. More...
 
static ExType casadi::GenericExpression< ExType >::ge (const ExType &x, const ExType &y)
 Logical greater or equal to: (x,y) -> x >= y. More...
 
ExType casadi::GenericExpression< ExType >::ge (const ExType &x, const ExType &y)
 Logical greater or equal to: (x,y) -> x >= y. More...
 
ExType casadi::GenericExpression< ExType >::operator>= (const ExType &x, const ExType &y)
 Logical greater or equal to: (x,y) -> x >= y. More...
 
static ExType casadi::GenericExpression< ExType >::eq (const ExType &x, const ExType &y)
 Logical equal to: (x,y) -> x == y. More...
 
ExType casadi::GenericExpression< ExType >::eq (const ExType &x, const ExType &y)
 Logical equal to: (x,y) -> x == y. More...
 
ExType casadi::GenericExpression< ExType >::operator== (const ExType &x, const ExType &y)
 Logical equal to: (x,y) -> x == y. More...
 
static ExType casadi::GenericExpression< ExType >::ne (const ExType &x, const ExType &y)
 Logical not equal to: (x,y) -> x != y. More...
 
ExType casadi::GenericExpression< ExType >::ne (const ExType &x, const ExType &y)
 Logical not equal to: (x,y) -> x != y. More...
 
ExType casadi::GenericExpression< ExType >::operator!= (const ExType &x, const ExType &y)
 Logical not equal to: (x,y) -> x != y. More...
 
static ExType casadi::GenericExpression< ExType >::logic_and (const ExType &x, const ExType &y)
 Logical and More...
 
ExType casadi::GenericExpression< ExType >::logic_and (const ExType &x, const ExType &y)
 Logical and More...
 
ExType casadi::GenericExpression< ExType >::operator&& (const ExType &x, const ExType &y)
 Logical and More...
 
static ExType casadi::GenericExpression< ExType >::logic_or (const ExType &x, const ExType &y)
 Logical or More...
 
ExType casadi::GenericExpression< ExType >::logic_or (const ExType &x, const ExType &y)
 Logical or More...
 
ExType casadi::GenericExpression< ExType >::operator|| (const ExType &x, const ExType &y)
 Logical or More...
 
static ExType casadi::GenericExpression< ExType >::logic_not (const ExType &x)
 Logical not x -> !x. More...
 
ExType casadi::GenericExpression< ExType >::operator! () const
 Logical not x -> !x. More...
 
ExType casadi::GenericExpression< ExType >::logic_not (const ExType &x)
 Logical not x -> !x. More...
 
static ExType casadi::GenericExpression< ExType >::abs (const ExType &x)
 Absolute value: x -> abs(x) More...
 
ExType casadi::GenericExpression< ExType >::abs (const ExType &x)
 Absolute value: x -> abs(x) More...
 
ExType casadi::GenericExpression< ExType >::fabs (const ExType &x)
 Absolute value: x -> abs(x) More...
 
static ExType casadi::GenericExpression< ExType >::sqrt (const ExType &x)
 Square root: x -> sqrt(x) More...
 
ExType casadi::GenericExpression< ExType >::sqrt (const ExType &x)
 Square root: x -> sqrt(x) More...
 
static ExType casadi::GenericExpression< ExType >::sq (const ExType &x)
 Square: x -> x^2. More...
 
ExType casadi::GenericExpression< ExType >::sq (const ExType &x)
 Square: x -> x^2. More...
 
static ExType casadi::GenericExpression< ExType >::sin (const ExType &x)
 Sine: x -> sin(x) More...
 
ExType casadi::GenericExpression< ExType >::sin (const ExType &x)
 Sine: x -> sin(x) More...
 
static ExType casadi::GenericExpression< ExType >::cos (const ExType &x)
 Cosine: x -> cos(x) More...
 
ExType casadi::GenericExpression< ExType >::cos (const ExType &x)
 Cosine: x -> cos(x) More...
 
static ExType casadi::GenericExpression< ExType >::tan (const ExType &x)
 Tangent: x -> tan(x) More...
 
ExType casadi::GenericExpression< ExType >::tan (const ExType &x)
 Tangent: x -> tan(x) More...
 
static ExType casadi::GenericExpression< ExType >::atan (const ExType &x)
 Arc tangent: x -> atan(x) More...
 
ExType casadi::GenericExpression< ExType >::atan (const ExType &x)
 Arc tangent: x -> atan(x) More...
 
static ExType casadi::GenericExpression< ExType >::asin (const ExType &x)
 Arc sine: x -> asin(x) More...
 
ExType casadi::GenericExpression< ExType >::asin (const ExType &x)
 Arc sine: x -> asin(x) More...
 
static ExType casadi::GenericExpression< ExType >::acos (const ExType &x)
 Arc cosine: x -> acos(x) More...
 
ExType casadi::GenericExpression< ExType >::acos (const ExType &x)
 Arc cosine: x -> acos(x) More...
 
static ExType casadi::GenericExpression< ExType >::tanh (const ExType &x)
 Hyperbolic tangent: x -> tanh(x) More...
 
ExType casadi::GenericExpression< ExType >::tanh (const ExType &x)
 Hyperbolic tangent: x -> tanh(x) More...
 
static ExType casadi::GenericExpression< ExType >::sinh (const ExType &x)
 Hyperbolic sin: x -> sinh(x) More...
 
ExType casadi::GenericExpression< ExType >::sinh (const ExType &x)
 Hyperbolic sin: x -> sinh(x) More...
 
static ExType casadi::GenericExpression< ExType >::cosh (const ExType &x)
 Hyperbolic cosine: x -> cosh(x) More...
 
ExType casadi::GenericExpression< ExType >::cosh (const ExType &x)
 Hyperbolic cosine: x -> cosh(x) More...
 
static ExType casadi::GenericExpression< ExType >::atanh (const ExType &x)
 Inverse hyperbolic tangent: x -> atanh(x) More...
 
ExType casadi::GenericExpression< ExType >::atanh (const ExType &x)
 Inverse hyperbolic tangent: x -> atanh(x) More...
 
static ExType casadi::GenericExpression< ExType >::asinh (const ExType &x)
 Inverse hyperbolic sin: x -> asinh(x) More...
 
ExType casadi::GenericExpression< ExType >::asinh (const ExType &x)
 Inverse hyperbolic sin: x -> asinh(x) More...
 
static ExType casadi::GenericExpression< ExType >::acosh (const ExType &x)
 Inverse hyperbolic cosine: x -> acosh(x) More...
 
ExType casadi::GenericExpression< ExType >::acosh (const ExType &x)
 Inverse hyperbolic cosine: x -> acosh(x) More...
 
static ExType casadi::GenericExpression< ExType >::exp (const ExType &x)
 Elementwise exponential: x -> exp(x) More...
 
ExType casadi::GenericExpression< ExType >::exp (const ExType &x)
 Elementwise exponential: x -> exp(x) More...
 
static ExType casadi::GenericExpression< ExType >::log (const ExType &x)
 Natural logarithm: x -> log(x) More...
 
ExType casadi::GenericExpression< ExType >::log (const ExType &x)
 Natural logarithm: x -> log(x) More...
 
static ExType casadi::GenericExpression< ExType >::log10 (const ExType &x)
 Base-10 logarithm: x -> log10(x) More...
 
ExType casadi::GenericExpression< ExType >::log10 (const ExType &x)
 Base-10 logarithm: x -> log10(x) More...
 
static ExType casadi::GenericExpression< ExType >::log1p (const ExType &x)
 Precision variant for natural logarithm: x -> log(x+1) More...
 
ExType casadi::GenericExpression< ExType >::log1p (const ExType &x)
 Precision variant for natural logarithm: x -> log(x+1) More...
 
static ExType casadi::GenericExpression< ExType >::expm1 (const ExType &x)
 Precision variant for elementwise exponential: x -> exp(x)-1. More...
 
ExType casadi::GenericExpression< ExType >::expm1 (const ExType &x)
 Precision variant for elementwise exponential: x -> exp(x)-1. More...
 
static ExType casadi::GenericExpression< ExType >::floor (const ExType &x)
 Round down to nearest integer: x -> floor(x) More...
 
ExType casadi::GenericExpression< ExType >::floor (const ExType &x)
 Round down to nearest integer: x -> floor(x) More...
 
static ExType casadi::GenericExpression< ExType >::ceil (const ExType &x)
 Round up to nearest integer: x -> ceil(x) More...
 
ExType casadi::GenericExpression< ExType >::ceil (const ExType &x)
 Round up to nearest integer: x -> ceil(x) More...
 
static ExType casadi::GenericExpression< ExType >::erf (const ExType &x)
 Error function: x -> erf(x) More...
 
ExType casadi::GenericExpression< ExType >::erf (const ExType &x)
 Error function: x -> erf(x) More...
 
static ExType casadi::GenericExpression< ExType >::erfinv (const ExType &x)
 Inverse error function: x -> erfinv(x) More...
 
ExType casadi::GenericExpression< ExType >::erfinv (const ExType &x)
 Inverse error function: x -> erfinv(x) More...
 
static ExType casadi::GenericExpression< ExType >::sign (const ExType &x)
 Sign function: More...
 
ExType casadi::GenericExpression< ExType >::sign (const ExType &x)
 Sign function: More...
 
static ExType casadi::GenericExpression< ExType >::pow (const ExType &x, const ExType &y)
 Elementwise power: (x,y) -> x.^y. More...
 
ExType casadi::GenericExpression< ExType >::pow (const ExType &x, const ExType &y)
 Elementwise power: (x,y) -> x.^y. More...
 
static ExType casadi::GenericExpression< ExType >::mod (const ExType &x, const ExType &y)
 Remainder after division: (x,y) -> fmod(x,y) More...
 
ExType casadi::GenericExpression< ExType >::mod (const ExType &x, const ExType &y)
 Remainder after division: (x,y) -> fmod(x,y) More...
 
ExType casadi::GenericExpression< ExType >::fmod (const ExType &x, const ExType &y)
 Remainder after division: (x,y) -> fmod(x,y) More...
 
static ExType casadi::GenericExpression< ExType >::remainder (const ExType &x, const ExType &y)
 Remainder after division: (x,y) -> remainder(x,y) More...
 
ExType casadi::GenericExpression< ExType >::remainder (const ExType &x, const ExType &y)
 Remainder after division: (x,y) -> remainder(x,y) More...
 
static ExType casadi::GenericExpression< ExType >::atan2 (const ExType &y, const ExType &x)
 Two argument arc tangent: (y,x) -> atan2(y,x) More...
 
ExType casadi::GenericExpression< ExType >::atan2 (const ExType &y, const ExType &x)
 Two argument arc tangent: (y,x) -> atan2(y,x) More...
 
static ExType casadi::GenericExpression< ExType >::if_else_zero (const ExType &x, const ExType &y)
 Conditional assignment: (x,y) -> x ? y : 0. More...
 
ExType casadi::GenericExpression< ExType >::if_else_zero (const ExType &x, const ExType &y)
 Conditional assignment: (x,y) -> x ? y : 0. More...
 
static ExType casadi::GenericExpression< ExType >::fmin (const ExType &x, const ExType &y)
 Smallest of two values: (x,y) -> min(x,y) More...
 
ExType casadi::GenericExpression< ExType >::fmin (const ExType &x, const ExType &y)
 Smallest of two values: (x,y) -> min(x,y) More...
 
static ExType casadi::GenericExpression< ExType >::fmax (const ExType &x, const ExType &y)
 Largest of two values: (x,y) -> max(x,y) More...
 
ExType casadi::GenericExpression< ExType >::fmax (const ExType &x, const ExType &y)
 Largest of two values: (x,y) -> max(x,y) More...
 
static ExType casadi::GenericExpression< ExType >::copysign (const ExType &x, const ExType &y)
 
ExType casadi::GenericExpression< ExType >::copysign (const ExType &x, const ExType &y)
 
static ExType casadi::GenericExpression< ExType >::constpow (const ExType &x, const ExType &y)
 
ExType casadi::GenericExpression< ExType >::constpow (const ExType &x, const ExType &y)
 
static ExType casadi::GenericExpression< ExType >::printme (const ExType &x, const ExType &y)
 
ExType casadi::GenericExpression< ExType >::printme (const ExType &x, const ExType &y)
 
static ExType casadi::GenericExpression< ExType >::hypot (const ExType &x, const ExType &y)
 Precision variant for 2 norm: (x,y) -> sqrt(x^2+y^2) More...
 
ExType casadi::GenericExpression< ExType >::hypot (const ExType &x, const ExType &y)
 Precision variant for 2 norm: (x,y) -> sqrt(x^2+y^2) More...
 
static MatType casadi::GenericMatrix< MatType >::bilin (const MatType &A, const MatType &x, const MatType &y)
 Calculate bilinear/quadratic form x^T A y. More...
 
MatType casadi::GenericMatrix< MatType >::bilin (const MatType &A, const MatType &x, const MatType &y)
 Calculate bilinear/quadratic form x^T A y. More...
 
MatType casadi::GenericMatrix< MatType >::bilin (const MatType &A, const MatType &x)
 Calculate bilinear/quadratic form x^T A y. More...
 
static MatType casadi::GenericMatrix< MatType >::rank1 (const MatType &A, const MatType &alpha, const MatType &x, const MatType &y)
 Make a rank-1 update to a matrix A. More...
 
MatType casadi::GenericMatrix< MatType >::rank1 (const MatType &A, const MatType &alpha, const MatType &x, const MatType &y)
 Make a rank-1 update to a matrix A. More...
 
static MatType casadi::GenericMatrix< MatType >::jtimes (const MatType &ex, const MatType &arg, const MatType &v, bool tr=false, const Dict &opts=Dict())
 
static MatType casadi::GenericMatrix< MatType >::gradient (const MatType &ex, const MatType &arg, const Dict &opts=Dict())
 
static MatType casadi::GenericMatrix< MatType >::tangent (const MatType &ex, const MatType &arg, const Dict &opts=Dict())
 
static MatType casadi::GenericMatrix< MatType >::linearize (const MatType &f, const MatType &x, const MatType &x0, const Dict &opts=Dict())
 
static MatType casadi::GenericMatrix< MatType >::mpower (const MatType &x, const MatType &y)
 
static MatType casadi::GenericMatrix< MatType >::soc (const MatType &x, const MatType &y)
 
bool casadi::GenericExpression< ExType >::is_equal (const ExType &x, const ExType &y, casadi_int depth=0)
 Check if two nodes are equivalent up to a given depth. More...
 
MatType casadi::GenericMatrix< MatType >::einstein (const MatType &A, const MatType &B, const MatType &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)
 Compute any contraction of two dense tensors, using index/einstein notation. More...
 
MatType casadi::GenericMatrix< MatType >::einstein (const MatType &A, const MatType &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)
 Compute any contraction of two dense tensors, using index/einstein notation. More...
 
bool casadi::GenericMatrix< MatType >::contains (const std::vector< MatType > &v, const MatType &n)
 Check if expression n is listed in v. More...
 
bool casadi::GenericMatrix< MatType >::contains_all (const std::vector< MatType > &v, const std::vector< MatType > &n)
 Check if expression n is listed in v. More...
 
bool casadi::GenericMatrix< MatType >::contains_any (const std::vector< MatType > &v, const std::vector< MatType > &n)
 Check if expression n is listed in v. More...
 
MatType casadi::GenericMatrix< MatType >::hessian (const MatType &ex, const MatType &arg, const Dict &opts=Dict())
 Hessian and (optionally) gradient. More...
 
MatType casadi::GenericMatrix< MatType >::hessian (const MatType &ex, const MatType &arg, MatType &output_g, const Dict &opts=Dict())
 Hessian and (optionally) gradient. More...
 
MatType casadi::GenericMatrix< MatType >::transform (const MatType &x, const Dict &opts=Dict())
 
MatType casadi::GenericMatrix< MatType >::transform (const MatType &x, const std::vector< std::vector< GenericType > > &passes, const Dict &opts=Dict())
 
std::vector< MatType > casadi::GenericMatrix< MatType >::transform (const std::vector< MatType > &x, const Dict &opts=Dict())
 
std::vector< MatType > casadi::GenericMatrix< MatType >::transform (const std::vector< MatType > &x, const std::vector< std::vector< GenericType > > &passes, const Dict &opts=Dict())
 
MatType casadi::GenericMatrix< MatType >::mmin (const MatType &x)
 Smallest element in a matrix. More...
 
MatType casadi::GenericMatrix< MatType >::mmax (const MatType &x)
 Largest element in a matrix. More...
 
Matrix< Scalar > casadi::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 > casadi::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 > casadi::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 > casadi::Matrix< Scalar >::taylor (const Matrix< Scalar > &ex, const Matrix< Scalar > &x)
 univariate Taylor series expansion More...
 

Detailed Description

Functions for manipulating DM, SX, MX or Sparsity

Function Documentation

◆ abs()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::abs ( const ExType &  x)
inlinestatic

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

Definition at line 275 of file generic_expression.hpp.

275  {
276  return ExType::unary(OP_FABS, x);
277  }
@ OP_FABS
Definition: calculus.hpp:71

References casadi::OP_FABS.

◆ acos()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::acos ( const ExType &  x)
inlinestatic

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

Definition at line 374 of file generic_expression.hpp.

374  {
375  return ExType::unary(OP_ACOS, x);
376  }
@ OP_ACOS
Definition: calculus.hpp:69

References casadi::OP_ACOS.

◆ acosh()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::acosh ( const ExType &  x)
inlinestatic

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

Definition at line 446 of file generic_expression.hpp.

446  {
447  return ExType::unary(OP_ACOSH, x);
448  }
@ OP_ACOSH
Definition: calculus.hpp:75

References casadi::OP_ACOSH.

◆ asin()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::asin ( const ExType &  x)
inlinestatic

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

Definition at line 362 of file generic_expression.hpp.

362  {
363  return ExType::unary(OP_ASIN, x);
364  }
@ OP_ASIN
Definition: calculus.hpp:69

References casadi::OP_ASIN.

◆ asinh()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::asinh ( const ExType &  x)
inlinestatic

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

Definition at line 434 of file generic_expression.hpp.

434  {
435  return ExType::unary(OP_ASINH, x);
436  }
@ OP_ASINH
Definition: calculus.hpp:75

References casadi::OP_ASINH.

◆ atan()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::atan ( const ExType &  x)
inlinestatic

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

Definition at line 350 of file generic_expression.hpp.

350  {
351  return ExType::unary(OP_ATAN, x);
352  }
@ OP_ATAN
Definition: calculus.hpp:69

References casadi::OP_ATAN.

◆ atan2()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::atan2 ( const ExType &  y,
const ExType &  x 
)
inlinestatic

theta = atan2(y,x) corresponds to x = r cos(theta), y = r sin(theta)

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

Definition at line 648 of file generic_expression.hpp.

648  {
649  return ExType::binary(OP_ATAN2, y, x);
650  }
@ OP_ATAN2
Definition: calculus.hpp:76

References casadi::OP_ATAN2.

◆ atanh()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::atanh ( const ExType &  x)
inlinestatic

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

Definition at line 422 of file generic_expression.hpp.

422  {
423  return ExType::unary(OP_ATANH, x);
424  }
@ OP_ATANH
Definition: calculus.hpp:75

References casadi::OP_ATANH.

◆ bilin()

template<typename MatType >
static MatType casadi::GenericMatrix< MatType >::bilin ( const MatType &  A,
const MatType &  x,
const MatType &  y 
)
static
Parameters
[in]ycan be omitted, in which case x^T A x is calculated

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

◆ ceil()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::ceil ( const ExType &  x)
inlinestatic

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

Definition at line 530 of file generic_expression.hpp.

530  {
531  return ExType::unary(OP_CEIL, x);
532  }
@ OP_CEIL
Definition: calculus.hpp:71

References casadi::OP_CEIL.

◆ constpow()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::constpow ( const ExType &  x,
const ExType &  y 
)
inlinestatic

Elementwise power with const power

Definition at line 720 of file generic_expression.hpp.

720  {
721  return ExType::binary(OP_CONSTPOW, x, y);
722  }
@ OP_CONSTPOW
Definition: calculus.hpp:66

References casadi::OP_CONSTPOW.

◆ copysign()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::copysign ( const ExType &  x,
const ExType &  y 
)
inlinestatic

Copy sign

Definition at line 710 of file generic_expression.hpp.

710  {
711  return ExType::binary(OP_COPYSIGN, x, y);
712  }
@ OP_COPYSIGN
Definition: calculus.hpp:71

References casadi::OP_COPYSIGN.

◆ cos()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::cos ( const ExType &  x)
inlinestatic

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

Definition at line 326 of file generic_expression.hpp.

326  {
327  return ExType::unary(OP_COS, x);
328  }
@ OP_COS
Definition: calculus.hpp:68

References casadi::OP_COS.

◆ cosh()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::cosh ( const ExType &  x)
inlinestatic

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

Definition at line 410 of file generic_expression.hpp.

410  {
411  return ExType::unary(OP_COSH, x);
412  }
@ OP_COSH
Definition: calculus.hpp:74

References casadi::OP_COSH.

◆ eq()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::eq ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 191 of file generic_expression.hpp.

191  {
192  return ExType::binary(OP_EQ, x, y);
193  }
@ OP_EQ
Definition: calculus.hpp:70

References casadi::OP_EQ.

◆ erf()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::erf ( const ExType &  x)
inlinestatic

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

Definition at line 542 of file generic_expression.hpp.

542  {
543  return ExType::unary(OP_ERF, x);
544  }
@ OP_ERF
Definition: calculus.hpp:72

References casadi::OP_ERF.

◆ erfinv()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::erfinv ( const ExType &  x)
inlinestatic

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

Definition at line 554 of file generic_expression.hpp.

554  {
555  return ExType::unary(OP_ERFINV, x);
556  }
@ OP_ERFINV
Definition: calculus.hpp:189

References casadi::OP_ERFINV.

◆ exp()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::exp ( const ExType &  x)
inlinestatic

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

Definition at line 458 of file generic_expression.hpp.

458  {
459  return ExType::unary(OP_EXP, x);
460  }
@ OP_EXP
Definition: calculus.hpp:66

References casadi::OP_EXP.

◆ expm1()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::expm1 ( const ExType &  x)
inlinestatic

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

Definition at line 506 of file generic_expression.hpp.

506  {
507  return ExType::unary(OP_EXPM1, x);
508  }
@ OP_EXPM1
Definition: calculus.hpp:204

References casadi::OP_EXPM1.

◆ floor()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::floor ( const ExType &  x)
inlinestatic

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

Definition at line 518 of file generic_expression.hpp.

518  {
519  return ExType::unary(OP_FLOOR, x);
520  }
@ OP_FLOOR
Definition: calculus.hpp:71

References casadi::OP_FLOOR.

◆ fmax()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::fmax ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 684 of file generic_expression.hpp.

684  {
685  return ExType::binary(OP_FMAX, x, y);
686  }
@ OP_FMAX
Definition: calculus.hpp:72

References casadi::OP_FMAX.

◆ fmin()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::fmin ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 672 of file generic_expression.hpp.

672  {
673  return ExType::binary(OP_FMIN, x, y);
674  }
@ OP_FMIN
Definition: calculus.hpp:72

References casadi::OP_FMIN.

◆ ge()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::ge ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 176 of file generic_expression.hpp.

176  {
177  return ExType::le(y, x);
178  }

◆ gradient()

template<typename MatType >
static MatType casadi::GenericMatrix< MatType >::gradient ( const MatType &  ex,
const MatType &  arg,
const Dict opts = Dict() 
)
static

Functions called by friend functions defined here

◆ gt()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::gt ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 161 of file generic_expression.hpp.

161  {
162  return ExType::lt(y, x);
163  }

◆ hypot()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::hypot ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 742 of file generic_expression.hpp.

742  {
743  return ExType::binary(OP_HYPOT, x, y);
744  }
@ OP_HYPOT
Definition: calculus.hpp:206

References casadi::OP_HYPOT.

◆ if_else_zero()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::if_else_zero ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 660 of file generic_expression.hpp.

660  {
661  return ExType::binary(OP_IF_ELSE_ZERO, x, y);
662  }
@ OP_IF_ELSE_ZERO
Definition: calculus.hpp:71

References casadi::OP_IF_ELSE_ZERO.

◆ jtimes()

template<typename MatType >
static MatType casadi::GenericMatrix< MatType >::jtimes ( const MatType &  ex,
const MatType &  arg,
const MatType &  v,
bool  tr = false,
const Dict opts = Dict() 
)
static

Functions called by friend functions defined here

◆ le()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::le ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 146 of file generic_expression.hpp.

146  {
147  return ExType::binary(OP_LE, x, y);
148  }
@ OP_LE
Definition: calculus.hpp:70

References casadi::OP_LE.

◆ linearize()

template<typename MatType >
static MatType casadi::GenericMatrix< MatType >::linearize ( const MatType &  f,
const MatType &  x,
const MatType &  x0,
const Dict opts = Dict() 
)
static

Functions called by friend functions defined here

◆ log()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::log ( const ExType &  x)
inlinestatic

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

Definition at line 470 of file generic_expression.hpp.

470  {
471  return ExType::unary(OP_LOG, x);
472  }
@ OP_LOG
Definition: calculus.hpp:66

References casadi::OP_LOG.

Referenced by casadi::GenericExpression< ExType >::log10().

◆ log10()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::log10 ( const ExType &  x)
inlinestatic

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

Definition at line 482 of file generic_expression.hpp.

482  {
483  return log(x)*(1/std::log(10.));
484  }
static ExType log(const ExType &x)
Natural logarithm: x -> log(x)

References casadi::GenericExpression< ExType >::log().

◆ log1p()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::log1p ( const ExType &  x)
inlinestatic

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

Definition at line 494 of file generic_expression.hpp.

494  {
495  return ExType::unary(OP_LOG1P, x);
496  }
@ OP_LOG1P
Definition: calculus.hpp:202

References casadi::OP_LOG1P.

◆ logic_and()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::logic_and ( const ExType &  x,
const ExType &  y 
)
inlinestatic

Returns (an expression evaluating to) 1 if both expressions are nonzero and 0 otherwise

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

Definition at line 224 of file generic_expression.hpp.

224  {
225  return ExType::binary(OP_AND, x, y);
226  }
@ OP_AND
Definition: calculus.hpp:70

References casadi::OP_AND.

◆ logic_not()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::logic_not ( const ExType &  x)
inlinestatic

Returns (an expression evaluating to) 1 if expression is zero and 0 otherwise

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

Definition at line 260 of file generic_expression.hpp.

260  {
261  return ExType::unary(OP_NOT, x);
262  }
@ OP_NOT
Definition: calculus.hpp:70

References casadi::OP_NOT.

Referenced by casadi::GenericExpression< ExType >::operator!().

◆ logic_or()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::logic_or ( const ExType &  x,
const ExType &  y 
)
inlinestatic

returns (an expression evaluating to) 1 if at least one expression is nonzero and 0 otherwise

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

Definition at line 242 of file generic_expression.hpp.

242  {
243  return ExType::binary(OP_OR, x, y);
244  }
@ OP_OR
Definition: calculus.hpp:70

References casadi::OP_OR.

◆ logsumexp()

template<typename MatType >
static MatType casadi::GenericMatrix< MatType >::logsumexp ( const MatType &  x)
static

◆ lt()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::lt ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 131 of file generic_expression.hpp.

131  {
132  return ExType::binary(OP_LT, x, y);
133  }
@ OP_LT
Definition: calculus.hpp:70

References casadi::OP_LT.

◆ minus()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::minus ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 83 of file generic_expression.hpp.

83  {
84  return ExType::binary(OP_SUB, x, y);
85  }
@ OP_SUB
Definition: calculus.hpp:65

References casadi::OP_SUB.

◆ mod()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::mod ( const ExType &  x,
const ExType &  y 
)
inlinestatic

This Function follows the convention of https://en.cppreference.com/w/c/numeric/math/fmod

Notably:

  • fmod(5,3) -> 2
  • fmod(5,-3) -> 2
  • fmod(-5,3) -> -2
  • fmod(-5,-3) -> -2

This is equivalent to Python's numpy.fmod and Matlab's rem.

\seealso remainder

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

Definition at line 607 of file generic_expression.hpp.

607  {
608  return ExType::binary(OP_FMOD, x, y);
609  }
@ OP_FMOD
Definition: calculus.hpp:71

References casadi::OP_FMOD.

◆ mpower()

template<typename MatType >
static MatType casadi::GenericMatrix< MatType >::mpower ( const MatType &  x,
const MatType &  y 
)
static

Functions called by friend functions defined here

◆ ne()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::ne ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 206 of file generic_expression.hpp.

206  {
207  return ExType::binary(OP_NE, x, y);
208  }
@ OP_NE
Definition: calculus.hpp:70

References casadi::OP_NE.

◆ operator!()

template<typename ExType >
ExType casadi::GenericExpression< ExType >::operator! ( ) const
inline

Returns (an expression evaluating to) 1 if expression is zero and 0 otherwise

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

Definition at line 266 of file generic_expression.hpp.

266  {
267  return logic_not(self());
268  }
static ExType logic_not(const ExType &x)
Logical not x -> !x.

References casadi::GenericExpression< ExType >::logic_not().

◆ operator*=()

template<typename ExType >
ExType& casadi::GenericExpression< ExType >::operator*= ( const ExType &  y)
inline

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

Definition at line 108 of file generic_expression.hpp.

108 {return self() = self() * y;}

◆ operator+=()

template<typename ExType >
ExType& casadi::GenericExpression< ExType >::operator+= ( const ExType &  y)
inline

Definition at line 76 of file generic_expression.hpp.

76 { return self() = self() + y; }

◆ operator-=()

template<typename ExType >
ExType& casadi::GenericExpression< ExType >::operator-= ( const ExType &  y)
inline

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

Definition at line 92 of file generic_expression.hpp.

92 { return self() = self() - y; }

◆ operator/=()

template<typename ExType >
ExType& casadi::GenericExpression< ExType >::operator/= ( const ExType &  y)
inline

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

Definition at line 124 of file generic_expression.hpp.

124 {return self() = self() / y;}

◆ plus()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::plus ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 67 of file generic_expression.hpp.

67  {
68  return ExType::binary(OP_ADD, x, y);
69  }
@ OP_ADD
Definition: calculus.hpp:65

References casadi::OP_ADD.

◆ pow()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::pow ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 583 of file generic_expression.hpp.

583  {
584  return ExType::binary(OP_POW, x, y);
585  }
@ OP_POW
Definition: calculus.hpp:66

References casadi::OP_POW.

◆ printme()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::printme ( const ExType &  x,
const ExType &  y 
)
inlinestatic

Debug printing

Definition at line 730 of file generic_expression.hpp.

730  {
731  return ExType::binary(OP_PRINTME, x, y);
732  }
@ OP_PRINTME
Definition: calculus.hpp:190

References casadi::OP_PRINTME.

◆ rank1()

template<typename MatType >
static MatType casadi::GenericMatrix< MatType >::rank1 ( const MatType &  A,
const MatType &  alpha,
const MatType &  x,
const MatType &  y 
)
static

Calculates A + 1/2 * alpha * x*y'

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

◆ rdivide()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::rdivide ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 115 of file generic_expression.hpp.

115  {
116  return ExType::binary(OP_DIV, x, y);
117  }
@ OP_DIV
Definition: calculus.hpp:65

References casadi::OP_DIV.

◆ remainder()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::remainder ( const ExType &  x,
const ExType &  y 
)
inlinestatic

This Function follows the convention of https://en.cppreference.com/w/c/numeric/math/remainder

Notably:

  • remainder(5,3) -> -1
  • remainder(5,-3) -> -1
  • remainder(-5,3) -> 1
  • remainder(-5,-3) -> 1

This is equivalent to Python's math.remainder. There is no equivalence in Matlab.

\seealso fmod

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

Definition at line 634 of file generic_expression.hpp.

634  {
635  return ExType::binary(OP_REMAINDER, x, y);
636  }
@ OP_REMAINDER
Definition: calculus.hpp:210

References casadi::OP_REMAINDER.

◆ sign()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::sign ( const ExType &  x)
inlinestatic

sign(x) := -1 for x<0 sign(x) := 1 for x>0, sign(0) := 0 sign(NaN) := NaN

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

Definition at line 571 of file generic_expression.hpp.

571  {
572  return ExType::unary(OP_SIGN, x);
573  }
@ OP_SIGN
Definition: calculus.hpp:71

References casadi::OP_SIGN.

◆ sin()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::sin ( const ExType &  x)
inlinestatic

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

Definition at line 314 of file generic_expression.hpp.

314  {
315  return ExType::unary(OP_SIN, x);
316  }
@ OP_SIN
Definition: calculus.hpp:68

References casadi::OP_SIN.

◆ sinh()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::sinh ( const ExType &  x)
inlinestatic

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

Definition at line 398 of file generic_expression.hpp.

398  {
399  return ExType::unary(OP_SINH, x);
400  }
@ OP_SINH
Definition: calculus.hpp:74

References casadi::OP_SINH.

◆ soc()

template<typename MatType >
static MatType casadi::GenericMatrix< MatType >::soc ( const MatType &  x,
const MatType &  y 
)
static

Functions called by friend functions defined here

◆ sq()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::sq ( const ExType &  x)
inlinestatic

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

Definition at line 302 of file generic_expression.hpp.

302  {
303  return ExType::unary(OP_SQ, x);
304  }
@ OP_SQ
Definition: calculus.hpp:67

References casadi::OP_SQ.

◆ sqrt()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::sqrt ( const ExType &  x)
inlinestatic

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

Definition at line 290 of file generic_expression.hpp.

290  {
291  return ExType::unary(OP_SQRT, x);
292  }
@ OP_SQRT
Definition: calculus.hpp:67

References casadi::OP_SQRT.

◆ tan()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::tan ( const ExType &  x)
inlinestatic

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

Definition at line 338 of file generic_expression.hpp.

338  {
339  return ExType::unary(OP_TAN, x);
340  }
@ OP_TAN
Definition: calculus.hpp:68

References casadi::OP_TAN.

◆ tangent()

template<typename MatType >
static MatType casadi::GenericMatrix< MatType >::tangent ( const MatType &  ex,
const MatType &  arg,
const Dict opts = Dict() 
)
static

Functions called by friend functions defined here

◆ tanh()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::tanh ( const ExType &  x)
inlinestatic

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

Definition at line 386 of file generic_expression.hpp.

386  {
387  return ExType::unary(OP_TANH, x);
388  }
@ OP_TANH
Definition: calculus.hpp:74

References casadi::OP_TANH.

◆ times()

template<typename ExType >
static ExType casadi::GenericExpression< ExType >::times ( const ExType &  x,
const ExType &  y 
)
inlinestatic

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

Definition at line 99 of file generic_expression.hpp.

99  {
100  return ExType::binary(OP_MUL, x, y);
101  }
@ OP_MUL
Definition: calculus.hpp:65

References casadi::OP_MUL.

Friends

◆ abs

template<typename ExType >
ExType abs ( const ExType &  x)
friend

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

Definition at line 278 of file generic_expression.hpp.

278  {
279  return ExType::abs(x);
280  }

◆ acos

template<typename ExType >
ExType acos ( const ExType &  x)
friend

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

Definition at line 377 of file generic_expression.hpp.

377  {
378  return ExType::acos(x);
379  }

◆ acosh

template<typename ExType >
ExType acosh ( const ExType &  x)
friend

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

Definition at line 449 of file generic_expression.hpp.

449  {
450  return ExType::acosh(x);
451  }

◆ adj

template<typename Scalar >
Matrix<Scalar> adj ( const Matrix< Scalar > &  A)
friend

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

Definition at line 556 of file matrix_decl.hpp.

556  {
557  return Matrix<Scalar>::adj(A);
558  }
static Matrix< Scalar > adj(const Matrix< Scalar > &x)

◆ all

template<typename Scalar >
Matrix<Scalar> all ( const Matrix< Scalar > &  x)
friend

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

Definition at line 649 of file matrix_decl.hpp.

649  {
650  return Matrix<Scalar>::all(x);
651  }
static Matrix< Scalar > all(const Matrix< Scalar > &x)

◆ any

template<typename Scalar >
Matrix<Scalar> any ( const Matrix< Scalar > &  x)
friend

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

Definition at line 642 of file matrix_decl.hpp.

642  {
643  return Matrix<Scalar>::any(x);
644  }
static Matrix< Scalar > any(const Matrix< Scalar > &x)

◆ asin

template<typename ExType >
ExType asin ( const ExType &  x)
friend

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

Definition at line 365 of file generic_expression.hpp.

365  {
366  return ExType::asin(x);
367  }

◆ asinh

template<typename ExType >
ExType asinh ( const ExType &  x)
friend

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

Definition at line 437 of file generic_expression.hpp.

437  {
438  return ExType::asinh(x);
439  }

◆ atan

template<typename ExType >
ExType atan ( const ExType &  x)
friend

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

Definition at line 353 of file generic_expression.hpp.

353  {
354  return ExType::atan(x);
355  }

◆ atan2

template<typename ExType >
ExType atan2 ( const ExType &  y,
const ExType &  x 
)
friend

theta = atan2(y,x) corresponds to x = r cos(theta), y = r sin(theta)

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

Definition at line 651 of file generic_expression.hpp.

651  {
652  return ExType::atan2(y, x);
653  }

◆ atanh

template<typename ExType >
ExType atanh ( const ExType &  x)
friend

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

Definition at line 425 of file generic_expression.hpp.

425  {
426  return ExType::atanh(x);
427  }

◆ bilin [1/2]

template<typename MatType >
MatType bilin ( const MatType &  A,
const MatType &  x 
)
friend
Parameters
[in]ycan be omitted, in which case x^T A x is calculated

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

Definition at line 406 of file generic_matrix.hpp.

406  {
407  return MatType::bilin(A, x, x);
408  }

◆ bilin [2/2]

template<typename MatType >
MatType casadi::GenericMatrix< MatType >::bilin ( const MatType &  A,
const MatType &  x,
const MatType &  y 
)
friend
Parameters
[in]ycan be omitted, in which case x^T A x is calculated

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

Definition at line 403 of file generic_matrix.hpp.

403  {
404  return MatType::bilin(A, x, y);
405  }

◆ blockcat [1/2]

template<typename MatType >
MatType blockcat ( const MatType &  A,
const MatType &  B,
const MatType &  C,
const MatType &  D 
)
friend

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

Definition at line 235 of file sparsity_interface.hpp.

235  {
236  return vertcat(horzcat(A, B), horzcat(C, D));
237  }
friend MatType vertcat(const std::vector< MatType > &v)
Concatenate a list of matrices vertically.
friend MatType horzcat(const std::vector< MatType > &v)
Concatenate a list of matrices horizontally.

◆ blockcat [2/2]

template<typename MatType >
MatType blockcat ( const std::vector< std::vector< MatType > > &  v)
friend

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

Definition at line 227 of file sparsity_interface.hpp.

227  {
228  return MatType::blockcat(v);
229  }

◆ blocksplit [1/2]

template<typename MatType >
std::vector< std::vector< MatType > > blocksplit ( const MatType &  x,
casadi_int  vert_incr = 1,
casadi_int  horz_incr = 1 
)
friend
Parameters
vert_incrDefines the increment for block boundaries in row dimension
horz_incrDefines the increment for block boundaries in column dimension

blockcat(blocksplit(x,..., ...)) = x

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

Definition at line 263 of file sparsity_interface.hpp.

263  {
264  return MatType::blocksplit(x, vert_incr, horz_incr);
265  }

◆ blocksplit [2/2]

template<typename MatType >
std::vector< std::vector< MatType > > blocksplit ( const MatType &  x,
const std::vector< casadi_int > &  vert_offset,
const std::vector< casadi_int > &  horz_offset 
)
friend
Parameters
vert_offsetDefines the boundaries of the block rows
horz_offsetDefines the boundaries of the block columns

blockcat(blocksplit(x,..., ...)) = x

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

Definition at line 248 of file sparsity_interface.hpp.

250  {
251  return MatType::blocksplit(x, vert_offset, horz_offset);
252  }

◆ bspline [1/3]

MX bspline ( const MX x,
const DM coeffs,
const std::vector< std::vector< double > > &  knots,
const std::vector< casadi_int > &  degree,
casadi_int  m,
const Dict opts = Dict() 
)
friend

Definition at line 903 of file mx.hpp.

908  {
909  return MX::bspline(x, coeffs, knots, degree, m, opts);
910  }
static MX bspline(const MX &x, const DM &coeffs, const std::vector< std::vector< double > > &knots, const std::vector< casadi_int > &degree, casadi_int m, const Dict &opts=Dict())
Definition: mx.cpp:2224

◆ bspline [2/3]

MX bspline ( const MX x,
const MX coeffs,
const std::vector< MX > &  knots,
const std::vector< casadi_int > &  degree,
casadi_int  m,
const Dict opts = Dict() 
)
friend

Definition at line 920 of file mx.hpp.

924  {
925  return MX::bspline(x, coeffs, knots, degree, m, opts);
926  }

◆ bspline [3/3]

MX bspline ( const MX x,
const MX coeffs,
const std::vector< std::vector< double > > &  knots,
const std::vector< casadi_int > &  degree,
casadi_int  m,
const Dict opts = Dict() 
)
friend

Definition at line 912 of file mx.hpp.

916  {
917  return MX::bspline(x, coeffs, knots, degree, m, opts);
918  }

◆ bspline_dual

DM bspline_dual ( const std::vector< double > &  x,
const std::vector< std::vector< double > > &  knots,
const std::vector< casadi_int > &  degree,
const Dict opts = Dict() 
)
friend

Definition at line 928 of file mx.hpp.

931  {
932  return MX::bspline_dual(x, knots, degree, opts);
933  }
static DM bspline_dual(const std::vector< double > &x, const std::vector< std::vector< double > > &knots, const std::vector< casadi_int > &degree, const Dict &opts=Dict())
Definition: mx.cpp:2249

◆ ceil

template<typename ExType >
ExType ceil ( const ExType &  x)
friend

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

Definition at line 533 of file generic_expression.hpp.

533  {
534  return ExType::ceil(x);
535  }

◆ chol

template<typename Scalar >
Matrix<Scalar> chol ( const Matrix< Scalar > &  A)
friend

Performs and LDL transformation [L,D] = ldl(A) and returns diag(sqrt(D))*L'

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

Definition at line 614 of file matrix_decl.hpp.

614  {
615  return Matrix<Scalar>::chol(A);
616  }
static Matrix< Scalar > chol(const Matrix< Scalar > &A)

◆ cofactor

template<typename Scalar >
Matrix<Scalar> cofactor ( const Matrix< Scalar > &  x,
casadi_int  i,
casadi_int  j 
)
friend

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

Definition at line 570 of file matrix_decl.hpp.

570  {
571  return Matrix<Scalar>::cofactor(x, i, j);
572  }
static Matrix< Scalar > cofactor(const Matrix< Scalar > &A, casadi_int i, casadi_int j)

◆ conditional

template<typename MatType >
MatType conditional ( const MatType &  ind,
const std::vector< MatType > &  x,
const MatType &  x_default,
bool  short_circuit = false 
)
friend

If the condition

Parameters
indevaluates to the integer k, where 0<=k<f.size(), then x[k] will be returned, otherwise
x_defaultwill be returned.

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

Definition at line 655 of file generic_matrix.hpp.

656  {
657  return MatType::conditional(ind, x, x_default, short_circuit);
658  }

◆ constpow

template<typename ExType >
ExType constpow ( const ExType &  x,
const ExType &  y 
)
friend

Elementwise power with const power

Definition at line 723 of file generic_expression.hpp.

723  {
724  return ExType::constpow(x, y);
725  }

◆ contains

template<typename MatType >
bool contains ( const std::vector< MatType > &  v,
const MatType &  n 
)
friend

This function checks for correspondence between nodes. The detection does not descend into the expression graph.

contains({a,b},b) -> true contains({a+b},b) -> false

e = a+b contains({e},e) -> true

For mathematical dependency, see depends_on

See also
depends_on

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

Definition at line 693 of file generic_matrix.hpp.

693  {
694  return contains_all(v, std::vector<MatType>{n});
695  }
friend bool contains_all(const std::vector< MatType > &v, const std::vector< MatType > &n)
Check if expression n is listed in v.

◆ contains_all

template<typename MatType >
bool contains_all ( const std::vector< MatType > &  v,
const std::vector< MatType > &  n 
)
friend

This function checks for correspondence between nodes. The detection does not descend into the expression graph.

contains({a,b},b) -> true contains({a+b},b) -> false

e = a+b contains({e},e) -> true

For mathematical dependency, see depends_on

See also
depends_on

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

Definition at line 697 of file generic_matrix.hpp.

697  {
698  return MatType::contains_all(v, n);
699  }

◆ contains_any

template<typename MatType >
bool contains_any ( const std::vector< MatType > &  v,
const std::vector< MatType > &  n 
)
friend

This function checks for correspondence between nodes. The detection does not descend into the expression graph.

contains({a,b},b) -> true contains({a+b},b) -> false

e = a+b contains({e},e) -> true

For mathematical dependency, see depends_on

See also
depends_on

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

Definition at line 701 of file generic_matrix.hpp.

701  {
702  return MatType::contains_any(v, n);
703  }

◆ convexify

MX convexify ( const MX H,
const Dict opts = Dict() 
)
friend

Definition at line 935 of file mx.hpp.

936  {
937  return MX::convexify(H, opts);
938  }
static MX convexify(const MX &H, const Dict &opts=Dict())
Definition: mx.cpp:2256

◆ copysign

template<typename ExType >
ExType copysign ( const ExType &  x,
const ExType &  y 
)
friend

Copy sign

Definition at line 713 of file generic_expression.hpp.

713  {
714  return ExType::copysign(x, y);
715  }

◆ cos

template<typename ExType >
ExType cos ( const ExType &  x)
friend

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

Definition at line 329 of file generic_expression.hpp.

329  {
330  return ExType::cos(x);
331  }

◆ cosh

template<typename ExType >
ExType cosh ( const ExType &  x)
friend

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

Definition at line 413 of file generic_expression.hpp.

413  {
414  return ExType::cosh(x);
415  }

◆ cross

template<typename MatType >
MatType cross ( const MatType &  a,
const MatType &  b,
casadi_int  dim = -1 
)
friend

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

Definition at line 467 of file generic_matrix.hpp.

467  {
468  return MatType::cross(a, b, dim);
469  }
std::string dim(bool with_nz=false) const
Get string representation of dimensions.

◆ cse [1/2]

template<typename MatType >
MatType cse ( const MatType &  e)
friend

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

Definition at line 739 of file generic_matrix.hpp.

739  {
740  return MatType::cse({e}).at(0);
741  }

◆ cse [2/2]

template<typename MatType >
std::vector<MatType> cse ( const std::vector< MatType > &  e)
friend

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

Definition at line 747 of file generic_matrix.hpp.

747  {
748  return MatType::cse(e);
749  }

◆ cumsum

template<typename MatType >
MatType cumsum ( const MatType &  x,
casadi_int  axis = -1 
)
friend

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

Definition at line 564 of file generic_matrix.hpp.

564  {
565  return MatType::cumsum(x, axis);
566  }

◆ densify [1/2]

template<typename MatType >
MatType densify ( const MatType &  x)
friend

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

Definition at line 618 of file generic_matrix.hpp.

618  {
619  return MatType::densify(x);
620  }

◆ densify [2/2]

template<typename MatType >
MatType densify ( const MatType &  x,
const MatType &  val 
)
friend

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

Definition at line 625 of file generic_matrix.hpp.

625  {
626  return MatType::densify(x, val);
627  }

◆ depends_on

template<typename MatType >
bool depends_on ( const MatType &  f,
const MatType &  arg 
)
friend

The argument must be symbolic

The dependency is in a mathematical way: Does the value of the argument affect the value of the expression? Equivalently, will the corresponding entry of the Jacobian by a non-zero?

The symbol could still be present in the expression graph.

To check that kind of dependency, use contains(symvar(f),arg)

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

Definition at line 673 of file generic_matrix.hpp.

673  {
674  return MatType::depends_on(f, arg);
675  }

◆ det [1/2]

template<typename MatType >
MatType det ( const MatType &  A)
friend

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

Definition at line 488 of file generic_matrix.hpp.

488 { return MatType::det(A);}

◆ det [2/2]

template<typename MatType >
MatType det ( const MatType &  A,
const std::string &  lsolver,
const Dict dict = Dict() 
)
friend

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

Definition at line 493 of file generic_matrix.hpp.

494  {
495  return MatType::det(A, lsolver, dict);
496  }

◆ diag

template<typename MatType >
MatType diag ( const MatType &  A)
friend

When the input is square, the diagonal elements are returned. If the input is vector-like, a diagonal matrix is constructed with it.

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

Definition at line 604 of file generic_matrix.hpp.

604  {
605  return MatType::diag(A);
606  }

◆ diagcat [1/6]

template<typename MatType >
MatType diagcat ( const MatType &  x,
const MatType &  y 
)
friend

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

Definition at line 572 of file sparsity_interface.hpp.

572  {
573  return diagcat(std::vector<MatType>{x, y});
574  }
friend MatType diagcat(const std::vector< MatType > &A)
Construct a matrix with given block on the diagonal.

◆ diagcat [2/6]

template<typename MatType >
MatType diagcat ( const MatType &  x,
const MatType &  y,
const MatType &  z 
)
friend

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

Definition at line 579 of file sparsity_interface.hpp.

579  {
580  return diagcat(std::vector<MatType>{x, y, z});
581  }

◆ diagcat [3/6]

template<typename MatType >
MatType diagcat ( const MatType &  x,
const MatType &  y,
const MatType &  z,
const MatType &  w 
)
friend

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

Definition at line 586 of file sparsity_interface.hpp.

587  {
588  return diagcat(std::vector<MatType>{x, y, z, w});
589  }

◆ diagcat [4/6]

template<typename MatType >
MatType diagcat ( const MatType &  x,
const MatType &  y,
const MatType &  z,
const MatType &  w,
const MatType &  v 
)
friend

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

Definition at line 594 of file sparsity_interface.hpp.

595  {
596  return diagcat(std::vector<MatType>{x, y, z, w, v});
597  }

◆ diagcat [5/6]

template<typename MatType >
MatType diagcat ( const MatType &  x,
const MatType &  y,
const MatType &  z,
const MatType &  w,
const MatType &  v,
const MatType &  u 
)
friend

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

Definition at line 602 of file sparsity_interface.hpp.

603  {
604  return diagcat(std::vector<MatType>{x, y, z, w, v, u});
605  }

◆ diagcat [6/6]

template<typename MatType >
MatType diagcat ( const std::vector< MatType > &  A)
friend

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

Definition at line 270 of file sparsity_interface.hpp.

270  {
271  return MatType::diagcat(A);
272  }

◆ diagsplit [1/4]

template<typename MatType >
std::vector< MatType > diagsplit ( const MatType &  x,
casadi_int  incr1,
casadi_int  incr2 
)
friend
Parameters
incr1Row dimension of each matrix
incr2Column dimension of each matrix

diagsplit(diagsplit(x, ...)) = x

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

Definition at line 325 of file sparsity_interface.hpp.

325  {
326  return MatType::diagsplit(x, incr1, incr2);
327  }

◆ diagsplit [2/4]

template<typename MatType >
std::vector< MatType > diagsplit ( const MatType &  x,
casadi_int  incr = 1 
)
friend
Parameters
incrSize of each matrix

diagsplit(diagsplit(x, ...)) = x

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

Definition at line 312 of file sparsity_interface.hpp.

312  {
313  return MatType::diagsplit(x, incr);
314  }

◆ diagsplit [3/4]

template<typename MatType >
std::vector< MatType > diagsplit ( const MatType &  x,
const std::vector< casadi_int > &  output_offset 
)
friend
Parameters
output_offsetList of all start locations for each group the last matrix will run to the end.

diagcat(diagsplit(x, ...)) = x

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

Definition at line 300 of file sparsity_interface.hpp.

300  {
301  return MatType::diagsplit(x, output_offset);
302  }

◆ diagsplit [4/4]

template<typename MatType >
std::vector< MatType > diagsplit ( const MatType &  x,
const std::vector< casadi_int > &  output_offset1,
const std::vector< casadi_int > &  output_offset2 
)
friend
Parameters
output_offset1List of all start locations (row) for each group the last matrix will run to the end.
output_offset2List of all start locations (row) for each group the last matrix will run to the end.

diagcat(diagsplit(x, ...)) = x

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

Definition at line 285 of file sparsity_interface.hpp.

287  {
288  return MatType::diagsplit(x, output_offset1, output_offset2);
289  }

◆ diff

template<typename MatType >
MatType diff ( const MatType &  x,
casadi_int  n = 1,
casadi_int  axis = -1 
)
friend

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

Definition at line 557 of file generic_matrix.hpp.

557  {
558  return MatType::diff(x, n, axis);
559  }

◆ difference

std::vector<MX> difference ( const std::vector< MX > &  a,
const std::vector< MX > &  b 
)
friend

\bried Return all elements of a that do not occur in b, preserving order

Definition at line 999 of file mx.hpp.

999  {
1000  return MX::difference(a, b);
1001  }
static std::vector< MX > difference(const std::vector< MX > &a, const std::vector< MX > &b)
Definition: mx.cpp:3099

◆ dot

template<typename MatType >
MatType dot ( const MatType &  x,
const MatType &  y 
)
friend

with x and y matrices of the same dimension

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

Definition at line 573 of file generic_matrix.hpp.

573  {
574  return MatType::dot(x, y);
575  }

Referenced by casadi::GenericMatrix< MatType >::sumsqr().

◆ eig_symbolic

template<typename Scalar >
Matrix<Scalar> eig_symbolic ( const Matrix< Scalar > &  m)
friend

This will only work for up to 3x3 matrices

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

Definition at line 893 of file matrix_decl.hpp.

893  {
895  }
static Matrix< Scalar > eig_symbolic(const Matrix< Scalar > &m)

◆ einstein [1/2]

template<typename MatType >
MatType einstein ( const MatType &  A,
const MatType &  B,
const MatType &  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 
)
friend

einstein(A, B, a, b, c) -> C

Given two tensors, A and B, computes a third tensor C such that:

C_c = A_a * B_b

With a, b, c representing einstein indices. Instead of the classical index labels i,j,k,... we employ -1,-2,-3,...

A, B, C are represented as CasADi vectors, with dim_a, dim_b, dim_c indictating theire tensorial dimensions.

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

Definition at line 355 of file generic_matrix.hpp.

359  {
360  return MatType::einstein(A, B, C, dim_a, dim_b, dim_c, a, b, c);
361  }

◆ einstein [2/2]

template<typename MatType >
MatType einstein ( const MatType &  A,
const MatType &  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 
)
friend

einstein(A, B, a, b, c) -> C

Given two tensors, A and B, computes a third tensor C such that:

C_c = A_a * B_b

With a, b, c representing einstein indices. Instead of the classical index labels i,j,k,... we employ -1,-2,-3,...

A, B, C are represented as CasADi vectors, with dim_a, dim_b, dim_c indictating theire tensorial dimensions.

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

Definition at line 364 of file generic_matrix.hpp.

368  {
369  return MatType::einstein(A, B, dim_a, dim_b, dim_c, a, b, c);
370  }

◆ eq

template<typename ExType >
ExType eq ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 194 of file generic_expression.hpp.

194  {
195  return ExType::eq(x, y);
196  }

◆ erf

template<typename ExType >
ExType erf ( const ExType &  x)
friend

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

Definition at line 545 of file generic_expression.hpp.

545  {
546  return ExType::erf(x);
547  }

◆ erfinv

template<typename ExType >
ExType erfinv ( const ExType &  x)
friend

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

Definition at line 557 of file generic_expression.hpp.

557  {
558  return ExType::erfinv(x);
559  }

◆ evalf [1/2]

template<typename Scalar >
Matrix<double> evalf ( const Matrix< Scalar > &  expr)
friend

An error is raised when the expression contains symbols

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

Definition at line 903 of file matrix_decl.hpp.

903  {
904  return Matrix<Scalar>::evalf(expr);
905  }
static Matrix< double > evalf(const Matrix< Scalar > &m)

◆ evalf [2/2]

DM evalf ( const MX expr)
friend

An error is raised when the expression contains symbols

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

Definition at line 961 of file mx.hpp.

961  {
962  return MX::evalf(expr);
963  }
static DM evalf(const MX &m)
Definition: mx.cpp:768

◆ exp

template<typename ExType >
ExType exp ( const ExType &  x)
friend

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

Definition at line 461 of file generic_expression.hpp.

461  {
462  return ExType::exp(x);
463  }

◆ expand

template<typename Scalar >
void expand ( const Matrix< Scalar > &  ex,
Matrix< Scalar > &  weights,
Matrix< Scalar > &  terms 
)
friend

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

Definition at line 672 of file matrix_decl.hpp.

673  {
674  Matrix<Scalar>::expand(ex, weights, terms);
675  }
static void expand(const Matrix< Scalar > &x, Matrix< Scalar > &weights, Matrix< Scalar > &terms)

◆ expm

template<typename MatType >
MatType expm ( const MatType &  A)
friend

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

Definition at line 854 of file generic_matrix.hpp.

854  {
855  return MatType::expm(A);
856  }

◆ expm1

template<typename ExType >
ExType expm1 ( const ExType &  x)
friend

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

Definition at line 509 of file generic_expression.hpp.

509  {
510  return ExType::expm1(x);
511  }

◆ expm_const

template<typename MatType >
MatType expm_const ( const MatType &  A,
const MatType &  t 
)
friend

Computes expm(A*t) with A constant

Parameters
A[in]Square matrix
t[in]Scalar

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

Definition at line 846 of file generic_matrix.hpp.

846  {
847  return MatType::expm_const(A, t);
848  }

◆ extract

template<typename MatType >
void extract ( std::vector< MatType > &  ex,
std::vector< MatType > &  v,
std::vector< MatType > &  vdef,
const Dict opts = Dict() 
)
friend

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

Definition at line 1165 of file generic_matrix.hpp.

1168  {
1169  MatType::extract(ex, v, vdef, opts);
1170  }

◆ extract_parametric [1/4]

template<typename MatType >
void extract_parametric ( const MatType &  expr,
const MatType &  par,
MatType &  expr_ret,
std::vector< MatType > &  symbols,
std::vector< MatType > &  parametric,
const Dict opts = Dict() 
)
friend

The purpose of extract_parametric is ultimately to save on evaluation time of an expression, by extracting out the parts that are only solely dependent on parameters.

For any: [expr_ret, symbols, parametric] = extract_parametric(expr, par) It holds that: substitute(expr_ret,symbols,parametric) == expr

parametric is only dependant on par expr_ret is not dependant on par, but is dependant on symbols

Example: [expr_ret, symbols, parametric] = extract_parametric((x-sqrt(p))*y+cos(p)**2, p)

expr_ret: (((x-extracted1)*y)+extracted2) symbols: [extracted1, extracted2] parametric: [sqrt(p),cos(p)**2]

Options to control the name of new symbols:

  • offset (int), default 0: Offset for new symbol counter
  • prefix (str), default 'e_': Prefix for new symbols
  • suffix (str), default '': Suffix for new symbols

Option 'extract_trivial' controls the behaviour for extracted parts that consist of pure symbols. If false (default), these parts are not extracted.

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

Definition at line 1033 of file generic_matrix.hpp.

1037  {
1038  MatType::extract_parametric(expr, par, expr_ret, symbols, parametric, opts);
1039  }

◆ extract_parametric [2/4]

template<typename MatType >
void extract_parametric ( const MatType &  expr,
const std::vector< MatType > &  par,
MatType &  expr_ret,
std::vector< MatType > &  symbols,
std::vector< MatType > &  parametric,
const Dict opts = Dict() 
)
friend

Definition at line 1077 of file generic_matrix.hpp.

1081  {
1082  extract_parametric(expr, veccat(par), expr_ret, symbols, parametric, opts);
1083  }
static MatType veccat(const std::vector< MatType > &x)
friend void extract_parametric(const MatType &expr, const MatType &par, MatType &expr_ret, std::vector< MatType > &symbols, std::vector< MatType > &parametric, const Dict &opts=Dict())
Extract purely parametric parts from an expression graph.

◆ extract_parametric [3/4]

template<typename MatType >
void extract_parametric ( const std::vector< MatType > &  expr,
const MatType &  par,
std::vector< MatType > &  expr_ret,
std::vector< MatType > &  symbols,
std::vector< MatType > &  parametric,
const Dict opts = Dict() 
)
friend

Definition at line 1041 of file generic_matrix.hpp.

1045  {
1046  // Concatenate all vector elements
1047  MatType expr_cat = veccat(expr);
1048  MatType expr_ret_cat;
1049 
1050  // Concatenated extract_parametric
1051  MatType::extract_parametric(expr_cat, par, expr_ret_cat, symbols, parametric, opts);
1052 
1053  // Compute edges of vertsplit needed to undo concatenate
1054  std::vector<casadi_int> edges = {0};
1055  for (const MatType& e : expr) {
1056  edges.push_back(edges.back() + e.numel());
1057  }
1058  // Perform vertsplit
1059  std::vector<MatType> expr_ret_catv = MatType::vertsplit(expr_ret_cat, edges);
1060 
1061  // Reshape all elements back into original size
1062  expr_ret.resize(expr_ret_catv.size());
1063  for (casadi_int i=0; i<expr_ret_catv.size(); ++i) {
1064  expr_ret[i] = reshape(expr_ret_catv[i], expr[i].size1(), expr[i].size2());
1065  }
1066  }
casadi_int size2() const
Get the second dimension (i.e. number of columns)
casadi_int size1() const
Get the first dimension (i.e. number of rows)
friend MatType reshape(const MatType &x, casadi_int nrow, casadi_int ncol)
Returns a reshaped version of the matrix.

◆ extract_parametric [4/4]

template<typename MatType >
void extract_parametric ( const std::vector< MatType > &  expr,
const std::vector< MatType > &  par,
std::vector< MatType > &  expr_ret,
std::vector< MatType > &  symbols,
std::vector< MatType > &  parametric,
const Dict opts = Dict() 
)
friend

Definition at line 1068 of file generic_matrix.hpp.

1073  {
1074  extract_parametric(expr, veccat(par), expr_ret, symbols, parametric, opts);
1075  }

◆ fabs

template<typename ExType >
ExType fabs ( const ExType &  x)
friend

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

Definition at line 281 of file generic_expression.hpp.

281  {
282  return abs(x);
283  }
static ExType abs(const ExType &x)
Absolute value: x -> abs(x)

◆ find

MX find ( const MX x)
friend

If failed, returns the number of rows

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

Definition at line 828 of file mx.hpp.

828  {
829  return MX::find(x);
830  }
static MX find(const MX &x)
Definition: mx.cpp:2216

◆ floor

template<typename ExType >
ExType floor ( const ExType &  x)
friend

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

Definition at line 521 of file generic_expression.hpp.

521  {
522  return ExType::floor(x);
523  }

◆ fmax

template<typename ExType >
ExType fmax ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 687 of file generic_expression.hpp.

687  {
688  return ExType::fmax(x, y);
689  }

◆ fmin

template<typename ExType >
ExType fmin ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 675 of file generic_expression.hpp.

675  {
676  return ExType::fmin(x, y);
677  }

◆ fmod

template<typename ExType >
ExType fmod ( const ExType &  x,
const ExType &  y 
)
friend

This Function follows the convention of https://en.cppreference.com/w/c/numeric/math/fmod

Notably:

  • fmod(5,3) -> 2
  • fmod(5,-3) -> 2
  • fmod(-5,3) -> -2
  • fmod(-5,-3) -> -2

This is equivalent to Python's numpy.fmod and Matlab's rem.

\seealso remainder

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

Definition at line 613 of file generic_expression.hpp.

613  {
614  return mod(x, y);
615  }
static ExType mod(const ExType &x, const ExType &y)
Remainder after division: (x,y) -> fmod(x,y)

◆ forward

template<typename MatType >
std::vector<std::vector<MatType> > forward ( const std::vector< MatType > &  ex,
const std::vector< MatType > &  arg,
const std::vector< std::vector< MatType > > &  v,
const Dict opts = Dict() 
)
friend

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

Definition at line 905 of file generic_matrix.hpp.

907  {
908  return MatType::forward(ex, arg, v, opts);
909  }

◆ gauss_quadrature [1/2]

template<typename Scalar >
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 
)
friend

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

Definition at line 784 of file matrix_decl.hpp.

786  {
787  return Matrix<Scalar>::gauss_quadrature(f, x, a, b, order, w);
788  }
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)

◆ gauss_quadrature [2/2]

template<typename Scalar >
Matrix<Scalar> gauss_quadrature ( const Matrix< Scalar > &  f,
const Matrix< Scalar > &  x,
const Matrix< Scalar > &  a,
const Matrix< Scalar > &  b,
casadi_int  order = 5 
)
friend

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

Definition at line 778 of file matrix_decl.hpp.

780  {
781  return Matrix<Scalar>::gauss_quadrature(f, x, a, b, order);
782  }

◆ ge

template<typename ExType >
ExType ge ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 179 of file generic_expression.hpp.

179  {
180  return ExType::ge(x, y);
181  }

◆ gradient

template<typename MatType >
MatType casadi::GenericMatrix< MatType >::gradient ( const MatType &  ex,
const MatType &  arg,
const Dict opts = Dict() 
)
friend
Parameters
ex[in]Scalar expression to take the gradient of
arg[in]Vector expression of symbols
opts[in]Options
Returns
Dense column vector

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

Definition at line 876 of file generic_matrix.hpp.

876  {
877  return MatType::gradient(ex, arg, opts);
878  }

◆ graph_substitute [1/4]

MX graph_substitute ( const MX ex,
const std::vector< MX > &  v,
const std::vector< MX > &  vdef 
)
friend

Substitute variable v with expression vdef in an expression ex, preserving nodes

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

Definition at line 846 of file mx.hpp.

847  {
848  return MX::graph_substitute(ex, v, vdef);
849  }
static MX graph_substitute(const MX &x, const std::vector< MX > &v, const std::vector< MX > &vdef)
Definition: mx.cpp:1551

◆ graph_substitute [2/4]

MX graph_substitute ( const MX ex,
const std::vector< MX > &  v,
const std::vector< MX > &  vdef,
bool &  updated 
)
friend

Definition at line 851 of file mx.hpp.

852  {
853  return MX::graph_substitute(ex, v, vdef, updated);
854  }

◆ graph_substitute [3/4]

std::vector<MX> graph_substitute ( const std::vector< MX > &  ex,
const std::vector< MX > &  v,
const std::vector< MX > &  vdef 
)
friend

Substitute variable var with expression expr in multiple expressions, preserving nodes

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

Definition at line 863 of file mx.hpp.

865  {
866  return MX::graph_substitute(ex, v, vdef);
867  }

◆ graph_substitute [4/4]

std::vector<MX> graph_substitute ( const std::vector< MX > &  ex,
const std::vector< MX > &  v,
const std::vector< MX > &  vdef,
bool &  updated 
)
friend

Definition at line 870 of file mx.hpp.

873  {
874  return MX::graph_substitute(ex, v, vdef, updated);
875  }

◆ gt

template<typename ExType >
ExType gt ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 164 of file generic_expression.hpp.

164  {
165  return ExType::gt(x, y);
166  }

◆ heaviside

template<typename Scalar >
Matrix<Scalar> heaviside ( const Matrix< Scalar > &  x)
friend

\[ \begin {cases} H(x) = 0 & x<0 \\ H(x) = 1/2 & x=0 \\ H(x) = 1 & x>0 \\ \end {cases} \]

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

Definition at line 720 of file matrix_decl.hpp.

720  {
721  return Matrix<Scalar>::heaviside(x);
722  }
static Matrix< Scalar > heaviside(const Matrix< Scalar > &x)

◆ hessian [1/2]

template<typename MatType >
MatType hessian ( const MatType &  ex,
const MatType &  arg,
const Dict opts = Dict() 
)
friend

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

Definition at line 925 of file generic_matrix.hpp.

926  {
927  return MatType::hessian(ex, arg, opts);
928  }

◆ hessian [2/2]

template<typename MatType >
MatType hessian ( const MatType &  ex,
const MatType &  arg,
MatType &  output_g,
const Dict opts = Dict() 
)
friend

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

Definition at line 929 of file generic_matrix.hpp.

930  {
931  return MatType::hessian(ex, arg, output_g, opts);
932  }

◆ horzcat [1/6]

template<typename MatType >
MatType horzcat ( const MatType &  x,
const MatType &  y 
)
friend

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

Definition at line 496 of file sparsity_interface.hpp.

496  {
497  return horzcat(std::vector<MatType>{x, y});
498  }

◆ horzcat [2/6]

template<typename MatType >
MatType horzcat ( const MatType &  x,
const MatType &  y,
const MatType &  z 
)
friend

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

Definition at line 503 of file sparsity_interface.hpp.

503  {
504  return horzcat(std::vector<MatType>{x, y, z});
505  }

◆ horzcat [3/6]

template<typename MatType >
MatType horzcat ( const MatType &  x,
const MatType &  y,
const MatType &  z,
const MatType &  w 
)
friend

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

Definition at line 510 of file sparsity_interface.hpp.

511  {
512  return horzcat(std::vector<MatType>{x, y, z, w});
513  }

◆ horzcat [4/6]

template<typename MatType >
MatType horzcat ( const MatType &  x,
const MatType &  y,
const MatType &  z,
const MatType &  w,
const MatType &  v 
)
friend

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

Definition at line 518 of file sparsity_interface.hpp.

519  {
520  return horzcat(std::vector<MatType>{x, y, z, w, v});
521  }

◆ horzcat [5/6]

template<typename MatType >
MatType horzcat ( const MatType &  x,
const MatType &  y,
const MatType &  z,
const MatType &  w,
const MatType &  v,
const MatType &  u 
)
friend

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

Definition at line 526 of file sparsity_interface.hpp.

527  {
528  return horzcat(std::vector<MatType>{x, y, z, w, v, u});
529  }

◆ horzcat [6/6]

template<typename MatType >
MatType horzcat ( const std::vector< MatType > &  v)
friend

Alternative terminology: horizontal stack, hstack, horizontal append, [a b]

horzcat(horzsplit(x, ...)) = x

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

Definition at line 98 of file sparsity_interface.hpp.

98  {
99  return MatType::horzcat(v);
100  }

◆ horzsplit [1/2]

template<typename MatType >
std::vector<MatType > horzsplit ( const MatType &  x,
casadi_int  incr = 1 
)
friend
Parameters
incrSize (width) of each group of columns

horzcat(horzsplit(x, ...)) = x

\seealso horzsplit_n

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

Definition at line 135 of file sparsity_interface.hpp.

135  {
136  return MatType::horzsplit(x, incr);
137  }

◆ horzsplit [2/2]

template<typename MatType >
std::vector<MatType > horzsplit ( const MatType &  x,
const std::vector< casadi_int > &  offset 
)
friend
Parameters
offsetList of all start columns for each group the last column group will run to the end.

horzcat(horzsplit(x, ...)) = x

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

Definition at line 122 of file sparsity_interface.hpp.

122  {
123  return MatType::horzsplit(x, offset);
124  }
static std::vector< casadi_int > offset(const std::vector< MatType > &v, bool vert=true)

◆ horzsplit_n

template<typename MatType >
std::vector<MatType > horzsplit_n ( const MatType &  x,
casadi_int  n 
)
friend
Parameters
nNumber of groups of columns

Will error when the number of columns is not a multiple of n

horzcat(horzsplit(x, ...)) = x

\seealso horzsplit

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

Definition at line 150 of file sparsity_interface.hpp.

150  {
151  return MatType::horzsplit_n(x, n);
152  }

◆ hypot

template<typename ExType >
ExType hypot ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 745 of file generic_expression.hpp.

745  {
746  return ExType::hypot(x, y);
747  }

◆ if_else

template<typename MatType >
MatType if_else ( const MatType &  cond,
const MatType &  if_true,
const MatType &  if_false,
bool  short_circuit = false 
)
friend

Ternary operator, "cond ? if_true : if_false"

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

Definition at line 644 of file generic_matrix.hpp.

645  {
646  return MatType::if_else(cond, if_true, if_false, short_circuit);
647  }

◆ if_else_zero

template<typename ExType >
ExType if_else_zero ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 663 of file generic_expression.hpp.

663  {
664  return ExType::if_else_zero(x, y);
665  }

◆ interp1d

template<typename MatType >
MatType interp1d ( const std::vector< double > &  x,
const MatType &  v,
const std::vector< double > &  xq,
const std::string &  mode,
bool  equidistant = false 
)
friend

The data-points to be interpolated are given as (x[i], v[i]). xq[j] is used as interpolating value

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

Definition at line 311 of file generic_matrix.hpp.

312  {
313  return MatType::interp1d(x, v, xq, mode, equidistant);
314  }

◆ inv [1/2]

template<typename MatType >
MatType inv ( const MatType &  A)
friend

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

Definition at line 506 of file generic_matrix.hpp.

506  {
507  return MatType::inv(A);
508  }

◆ inv [2/2]

template<typename MatType >
MatType inv ( const MatType &  A,
const std::string &  lsolver,
const Dict options = Dict() 
)
friend

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

Definition at line 513 of file generic_matrix.hpp.

515  {
516  return MatType::inv(A, lsolver, options);
517  }

◆ inv_minor

template<typename MatType >
MatType inv_minor ( const MatType &  A)
friend

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

Definition at line 501 of file generic_matrix.hpp.

501 { return MatType::inv_minor(A);}

◆ inv_node

MX inv_node ( const MX x)
friend

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

Definition at line 952 of file mx.hpp.

952  {
953  return MX::inv_node(x);
954  }
static MX inv_node(const MX &A)
Definition: mx.cpp:2029

◆ inv_skew

template<typename MatType >
MatType inv_skew ( const MatType &  a)
friend

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

Definition at line 481 of file generic_matrix.hpp.

481  {
482  return MatType::inv_skew(a);
483  }

◆ is_equal

template<typename ExType >
bool is_equal ( const ExType &  x,
const ExType &  y,
casadi_int  depth = 0 
)
friend

Depth=0 checks if the expressions are identical, i.e. points to the same node.

a = x*x b = x*x

is_equal(a,b,0) will return false, but a.is_equal(a,b,1) will return true

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

Definition at line 703 of file generic_expression.hpp.

703  {
704  return ExType::is_equal(x, y, depth);
705  }

◆ is_linear

template<typename MatType >
bool is_linear ( const MatType &  expr,
const MatType &  var 
)
friend

False negatives are possible (an expression may not be recognised as linear while it really is), false positives not.

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

Definition at line 959 of file generic_matrix.hpp.

959  {
960  return MatType::is_linear(expr, var);
961  }

◆ is_quadratic

template<typename MatType >
bool is_quadratic ( const MatType &  expr,
const MatType &  var 
)
friend

False negatives are possible (an expression may not be recognised as quadratic while it really is), false positives not.

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

Definition at line 970 of file generic_matrix.hpp.

970  {
971  return MatType::is_quadratic(expr, var);
972  }

◆ jacobian

template<typename MatType >
MatType jacobian ( const MatType &  ex,
const MatType &  arg,
const Dict opts = Dict() 
)
friend
Returns
Sparse matrix

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

Definition at line 863 of file generic_matrix.hpp.

864  {
865  return MatType::jacobian(ex, arg, opts);
866  }

◆ jacobian_sparsity

template<typename MatType >
Sparsity jacobian_sparsity ( const MatType &  f,
const MatType &  x 
)
friend

Equivalent to, but cheaper to compute than, jacobian(f,x).sparsity()

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

Definition at line 948 of file generic_matrix.hpp.

948  {
949  return MatType::jacobian_sparsity(f, x);
950  }

◆ jtimes

template<typename MatType >
MatType casadi::GenericMatrix< MatType >::jtimes ( const MatType &  ex,
const MatType &  arg,
const MatType &  v,
bool  tr = false,
const Dict opts = Dict() 
)
friend

This is equivalent to mul(jacobian(ex, arg), v) or mul(jacobian(ex, arg).T, v) for tr set to false and true respectively. If contrast to these expressions, it will use directional derivatives which is typically (but not necessarily) more efficient if the complete Jacobian is not needed and v has few rows.

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

Definition at line 896 of file generic_matrix.hpp.

897  {
898  return MatType::jtimes(ex, arg, v, tr, opts);
899  }

◆ kron

template<typename MatType >
MatType kron ( const MatType &  a,
const MatType &  b 
)
friend

Creates a block matrix in which each element (i, j) is a_ij*b

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

Definition at line 475 of file sparsity_interface.hpp.

475  {
476  return MatType::kron(a, b);
477  }

◆ ldl

template<typename Scalar >
void ldl ( const Matrix< Scalar > &  A,
Matrix< Scalar > &  D,
Matrix< Scalar > &  LT,
std::vector< casadi_int > &  p,
bool  amd = true 
)
friend

Returns D and the strictly upper triangular entries of L^T I.e. ones on the diagonal are ignored. Only guarenteed to work for positive definite matrices.

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

Definition at line 625 of file matrix_decl.hpp.

626  {
627  return Matrix<Scalar>::ldl(A, D, LT, p, amd);
628  }
static void ldl(const Matrix< Scalar > &A, Matrix< Scalar > &D, Matrix< Scalar > &LT, std::vector< casadi_int > &p, bool amd=true)

◆ ldl_solve

template<typename Scalar >
Matrix<Scalar> ldl_solve ( const Matrix< Scalar > &  b,
const Matrix< Scalar > &  D,
const Matrix< Scalar > &  LT,
const std::vector< casadi_int > &  p 
)
friend

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

Definition at line 634 of file matrix_decl.hpp.

635  {
636  return Matrix<Scalar>::ldl_solve(b, D, LT, p);
637  }
static Matrix< Scalar > ldl_solve(const Matrix< Scalar > &b, const Matrix< Scalar > &D, const Matrix< Scalar > &LT, const std::vector< casadi_int > &p)

◆ le

template<typename ExType >
ExType le ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 149 of file generic_expression.hpp.

149  {
150  return ExType::le(x, y);
151  }

◆ lift

MX lift ( const MX x,
const MX x_guess 
)
friend

Experimental feature

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

Definition at line 945 of file mx.hpp.

945  {
946  return MX::lift(x, x_guess);
947  }
static MX lift(const MX &x, const MX &x_guess)
Definition: mx.cpp:763

◆ linear_coeff

template<typename MatType >
void linear_coeff ( const MatType &  expr,
const MatType &  var,
MatType &  A,
MatType &  b,
bool  check = true 
)
friend

A x + b

Parameters
check[in]When true (default)m, A is checked to be independent of x. Provided to deal with false positive dependency checks.

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

Definition at line 997 of file generic_matrix.hpp.

998  {
999  MatType::linear_coeff(expr, var, A, b, check);
1000  }

◆ linearize

template<typename MatType >
MatType casadi::GenericMatrix< MatType >::linearize ( const MatType &  f,
const MatType &  x,
const MatType &  x0,
const Dict opts = Dict() 
)
friend

[DEPRECATED] confusing behaviour

This function linearizes an expression around a point x0, using x as delta around that point.

linearize(sin(x),x,x0) -> sin(x0)+cos(x0)*x
friend MatType linearize(const MatType &f, const MatType &x, const MatType &x0, const Dict &opts=Dict())
Linearize an expression.

For a variant that returns sin(x0)+cos(x0)*(x-x0), see taylor.

See also
taylor, linear_coeff

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

Definition at line 803 of file generic_matrix.hpp.

804  {
805  return MatType::linearize(f, x, x0, opts);
806  }

◆ linspace

template<typename MatType >
MatType linspace ( const MatType &  a,
const MatType &  b,
casadi_int  nsteps 
)
friend

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

Definition at line 460 of file generic_matrix.hpp.

460  {
461  return MatType::linspace(a, b, nsteps);
462  }

◆ log

template<typename ExType >
ExType log ( const ExType &  x)
friend

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

Definition at line 473 of file generic_expression.hpp.

473  {
474  return ExType::log(x);
475  }

◆ log10

template<typename ExType >
ExType log10 ( const ExType &  x)
friend

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

Definition at line 485 of file generic_expression.hpp.

485  {
486  return ExType::log10(x);
487  }

◆ log1p

template<typename ExType >
ExType log1p ( const ExType &  x)
friend

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

Definition at line 497 of file generic_expression.hpp.

497  {
498  return ExType::log1p(x);
499  }

◆ logic_and

template<typename ExType >
ExType logic_and ( const ExType &  x,
const ExType &  y 
)
friend

Returns (an expression evaluating to) 1 if both expressions are nonzero and 0 otherwise

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

Definition at line 227 of file generic_expression.hpp.

227  {
228  return ExType::logic_and(x, y);
229  }

◆ logic_not

template<typename ExType >
ExType logic_not ( const ExType &  x)
friend

Returns (an expression evaluating to) 1 if expression is zero and 0 otherwise

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

Definition at line 263 of file generic_expression.hpp.

263  {
264  return ExType::logic_not(x);
265  }

◆ logic_or

template<typename ExType >
ExType logic_or ( const ExType &  x,
const ExType &  y 
)
friend

returns (an expression evaluating to) 1 if at least one expression is nonzero and 0 otherwise

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

Definition at line 245 of file generic_expression.hpp.

245  {
246  return ExType::logic_or(x, y);
247  }

◆ logsumexp [1/2]

template<typename MatType >
MatType casadi::GenericMatrix< MatType >::logsumexp ( const MatType &  x)
friend

Can be used to achieve a smooth max.

Implementations for DM/SX/MX are hardened against overflow Implementations for DM/MX are more accurate with log1p (*)

(*) https://nhigham.com/2021/01/05/what-is-the-log-sum-exp-function/

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

Definition at line 443 of file generic_matrix.hpp.

443  {
444  return MatType::logsumexp(x);
445  }

◆ logsumexp [2/2]

template<typename MatType >
MatType logsumexp ( const MatType &  x,
const MatType &  margin 
)
friend

Scaled such that max(x) <= logsumexp(x, margin) <= max(x)+margin

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

Definition at line 451 of file generic_matrix.hpp.

451  {
452  MatType alpha = log(x.size1()) / margin;
453  return MatType::logsumexp(alpha*x)/alpha;
454  }

◆ low

MX low ( const MX v,
const MX p,
const Dict options = Dict() 
)
friend

If failed, returns the number of rows

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

Definition at line 837 of file mx.hpp.

837  {
838  return MX::low(v, p, options);
839  }
static MX low(const MX &v, const MX &p, const Dict &options=Dict())
Definition: mx.cpp:2220

◆ lt

template<typename ExType >
ExType lt ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 134 of file generic_expression.hpp.

134  {
135  return ExType::lt(x, y);
136  }

◆ mac

template<typename MatType >
MatType mac ( const MatType &  x,
const MatType &  y,
const MatType &  z,
const std::string &  blas = "reference" 
)
friend

Matrix product of two matrices (x and y), adding the result to a third matrix z. The result has the same sparsity pattern as C meaning that other entries of (x*y) are ignored. The operation is equivalent to: z+mtimes(x,y).project(z.sparsity()). See mtimes for the meaning of the blas argument.

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

Definition at line 381 of file sparsity_interface.hpp.

382  {
383  return MatType::mac(x, y, z, blas);
384  }

◆ matrix_expand [1/2]

MX matrix_expand ( const MX e,
const std::vector< MX > &  boundary = std::vector<MX>(),
const Dict options = Dict() 
)
friend

Expand the given expression e, optionally supplying expressions contained in it at which expansion should stop.

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

Definition at line 884 of file mx.hpp.

885  {
886  return MX::matrix_expand(e, boundary, options);
887  }
static MX matrix_expand(const MX &e, const std::vector< MX > &boundary, const Dict &options)
Definition: mx.cpp:2046

◆ matrix_expand [2/2]

std::vector<MX> matrix_expand ( const std::vector< MX > &  e,
const std::vector< MX > &  boundary = std::vector<MX>(),
const Dict options = Dict() 
)
friend

Expand the given expression e, optionally supplying expressions contained in it at which expansion should stop.

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

Definition at line 896 of file mx.hpp.

898  {
899  return MX::matrix_expand(e, boundary, options);
900  }

◆ minor

template<typename Scalar >
Matrix<Scalar> minor ( const Matrix< Scalar > &  x,
casadi_int  i,
casadi_int  j 
)
friend

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

Definition at line 563 of file matrix_decl.hpp.

563  {
564  return Matrix<Scalar>::minor(x, i, j);
565  }
static Matrix< Scalar > minor(const Matrix< Scalar > &x, casadi_int i, casadi_int j)

◆ minus

template<typename ExType >
ExType minus ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 86 of file generic_expression.hpp.

86  {
87  return ExType::minus(x, y);
88  }

◆ mldivide

template<typename MatType >
MatType mldivide ( const MatType &  x,
const MatType &  n 
)
friend

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

Definition at line 383 of file generic_matrix.hpp.

383  {
384  return MatType::mldivide(x, n);
385  }

◆ mmax

template<typename MatType >
MatType mmax ( const MatType &  x)
friend

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

Definition at line 1203 of file generic_matrix.hpp.

1203  {
1204  return MatType::mmax(x);
1205  }

◆ mmin

template<typename MatType >
MatType mmin ( const MatType &  x)
friend

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

Definition at line 1194 of file generic_matrix.hpp.

1194  {
1195  return MatType::mmin(x);
1196  }

◆ mod

template<typename ExType >
ExType mod ( const ExType &  x,
const ExType &  y 
)
friend

This Function follows the convention of https://en.cppreference.com/w/c/numeric/math/fmod

Notably:

  • fmod(5,3) -> 2
  • fmod(5,-3) -> 2
  • fmod(-5,3) -> -2
  • fmod(-5,-3) -> -2

This is equivalent to Python's numpy.fmod and Matlab's rem.

\seealso remainder

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

Definition at line 610 of file generic_expression.hpp.

610  {
611  return ExType::mod(x, y);
612  }

◆ mpower

template<typename MatType >
MatType casadi::GenericMatrix< MatType >::mpower ( const MatType &  x,
const MatType &  n 
)
friend

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

Definition at line 319 of file generic_matrix.hpp.

319  {
320  return MatType::mpower(x, n);
321  }

◆ mrdivide

template<typename MatType >
MatType mrdivide ( const MatType &  x,
const MatType &  n 
)
friend

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

Definition at line 376 of file generic_matrix.hpp.

376  {
377  return MatType::mrdivide(x, n);
378  }

◆ mtaylor [1/2]

template<typename Scalar >
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 
)
friend

Do Taylor expansions until the aggregated order of a term is equal to 'order'. The aggregated order of $x^n y^m$ equals $n+m$.

The argument order_contributions can denote how match each variable contributes to the aggregated order. If x=[x, y] and order_contributions=[1, 2], then the aggregated order of $x^n y^m$ equals $1n+2m$.

Example usage

taylor(sin(x+y),[x, y],[a, b], 1)
static Matrix< Scalar > taylor(const Matrix< Scalar > &ex, const Matrix< Scalar > &x, const Matrix< Scalar > &a, casadi_int order)
static Matrix< Scalar > sin(const Matrix< Scalar > &x)
Sine: x -> sin(x)

$ \sin(b+a)+\cos(b+a)(x-a)+\cos(b+a)(y-b) $

taylor(sin(x+y),[x, y],[0, 0], 4)

$ y+x-(x^3+3y x^2+3 y^2 x+y^3)/6 $

taylor(sin(x+y),[x, y],[0, 0], 4,[1, 2])

$ (-3 x^2 y-x^3)/6+y+x $

See also
taylor

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

Definition at line 861 of file matrix_decl.hpp.

863  {
864  return Matrix<Scalar>::mtaylor(ex, x, a, order, order_contributions);
865  }
static Matrix< Scalar > mtaylor(const Matrix< Scalar > &ex, const Matrix< Scalar > &x, const Matrix< Scalar > &a, casadi_int order)

◆ mtaylor [2/2]

template<typename Scalar >
Matrix<Scalar> mtaylor ( const Matrix< Scalar > &  ex,
const Matrix< Scalar > &  x,
const Matrix< Scalar > &  a,
casadi_int  order = 1 
)
friend

Do Taylor expansions until the aggregated order of a term is equal to 'order'. The aggregated order of $x^n y^m$ equals $n+m$.

See also
taylor

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

Definition at line 829 of file matrix_decl.hpp.

830  {
831  return Matrix<Scalar>::mtaylor(ex, x, a, order);
832  }

◆ mtimes [1/2]

template<typename MatType >
MatType mtimes ( const MatType &  x,
const MatType &  y,
const std::string &  blas = "reference" 
)
friend

Optional blas selects the BLAS plugin used for dense numeric kernels. The choice only takes effect on numeric DM / MX dense * dense; symbolic types (Sparsity, SX) and the sparse fallback path ignore it.

mtimes(A, B)               // default: built-in reference kernel (triple loop)
mtimes(A, B, "reference")  // same -- explicit
mtimes(A, B, "classic")    // whatever BLAS was built into casadi via
                           //   WITH_LAPACK (typically OpenBLAS)
mtimes(A, B, "blasfeo")    // BLASFEO

Plugins (classic, blasfeo) are loaded lazily on first use; if the corresponding plugin DLL isn't present in the build, calling them raises an error.

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

Definition at line 356 of file sparsity_interface.hpp.

357  {
358  return MatType::mtimes(x, y, blas);
359  }

◆ mtimes [2/2]

template<typename MatType >
MatType mtimes ( const std::vector< MatType > &  args,
const std::string &  blas = "reference" 
)
friend

See the 2-arg mtimes for the meaning of blas.

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

Definition at line 366 of file sparsity_interface.hpp.

367  {
368  return MatType::mtimes(args, blas);
369  }

◆ n_nodes

template<typename MatType >
casadi_int n_nodes ( const MatType &  A)
friend

Count number of nodes

Definition at line 1126 of file generic_matrix.hpp.

1126  {
1127  return MatType::n_nodes(A);
1128  }

◆ ne

template<typename ExType >
ExType ne ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 209 of file generic_expression.hpp.

209  {
210  return ExType::ne(x, y);
211  }

◆ no_grad

MX no_grad ( const MX expr)
friend

\seealso stop_diff

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

Definition at line 977 of file mx.hpp.

977  {
978  return MX::stop_diff(expr, 1);
979  }
static MX stop_diff(const MX &expr, casadi_int order)
Definition: mx.cpp:3027

◆ no_hess

MX no_hess ( const MX expr)
friend

\seealso stop_diff

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

Definition at line 986 of file mx.hpp.

986  {
987  return MX::stop_diff(expr, 2);
988  }

◆ norm_0_mul

template<typename MatType >
casadi_int norm_0_mul ( const MatType &  x,
const MatType &  y 
)
friend

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

Definition at line 452 of file sparsity_interface.hpp.

452  {
453  return MatType::norm_0_mul(x, y);
454  }

◆ norm_1

template<typename MatType >
MatType norm_1 ( const MatType &  x)
friend

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

Definition at line 547 of file generic_matrix.hpp.

547 { return MatType::norm_1(x);}

◆ norm_2

template<typename MatType >
MatType norm_2 ( const MatType &  x)
friend

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

Definition at line 542 of file generic_matrix.hpp.

542 { return MatType::norm_2(x);}

◆ norm_fro

template<typename MatType >
MatType norm_fro ( const MatType &  x)
friend

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

Definition at line 537 of file generic_matrix.hpp.

537 { return MatType::norm_fro(x);}

◆ norm_inf

template<typename MatType >
MatType norm_inf ( const MatType &  x)
friend

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

Definition at line 552 of file generic_matrix.hpp.

552 { return MatType::norm_inf(x);}

◆ norm_inf_mul

template<typename Scalar >
Matrix<Scalar> norm_inf_mul ( const Matrix< Scalar > &  x,
const Matrix< Scalar > &  y 
)
friend

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

Definition at line 657 of file matrix_decl.hpp.

657  {
658  return Matrix<Scalar>::norm_inf_mul(x, y);
659  }
static Matrix< Scalar > norm_inf_mul(const Matrix< Scalar > &x, const Matrix< Scalar > &y)

◆ nullspace

template<typename MatType >
MatType nullspace ( const MatType &  A)
friend

Finds Z m-by-(m-n) such that AZ = 0 with A n-by-m with m > n

Assumes A is full rank

Inspired by Numerical Methods in Scientific Computing by Ake Bjorck

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

Definition at line 587 of file generic_matrix.hpp.

587  {
588  return MatType::nullspace(A);
589  }

◆ offset

template<typename MatType >
std::vector<casadi_int > offset ( const std::vector< MatType > &  v,
bool  vert = true 
)
friend

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

Definition at line 170 of file sparsity_interface.hpp.

170  {
171  return MatType::offset(v, vert);
172  }

◆ operator!=

template<typename ExType >
ExType operator!= ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 212 of file generic_expression.hpp.

212  {
213  return ne(x, y);
214  }
static ExType ne(const ExType &x, const ExType &y)
Logical not equal to: (x,y) -> x != y.

◆ operator&&

template<typename ExType >
ExType operator&& ( const ExType &  x,
const ExType &  y 
)
friend

Returns (an expression evaluating to) 1 if both expressions are nonzero and 0 otherwise

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

Definition at line 230 of file generic_expression.hpp.

230  {
231  return logic_and(x, y);
232  }
static ExType logic_and(const ExType &x, const ExType &y)
Logical and

◆ operator*

template<typename ExType >
ExType operator* ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 105 of file generic_expression.hpp.

105  {
106  return times(x, y);
107  }
static ExType times(const ExType &x, const ExType &y)
Elementwise multiplication: (x,y) -> x .* y.

◆ operator+

template<typename ExType >
ExType operator+ ( const ExType &  x,
const ExType &  y 
)
friend

Definition at line 73 of file generic_expression.hpp.

73  {
74  return plus(x, y);
75  }
static ExType plus(const ExType &x, const ExType &y)
Addition: (x,y) -> x + y.

◆ operator-

template<typename ExType >
ExType operator- ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 89 of file generic_expression.hpp.

89  {
90  return minus(x, y);
91  }
static ExType minus(const ExType &x, const ExType &y)
Subtraction: (x,y) -> x - y.

◆ operator/

template<typename ExType >
ExType operator/ ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 121 of file generic_expression.hpp.

121  {
122  return rdivide(x, y);
123  }
static ExType rdivide(const ExType &x, const ExType &y)
Elementwise division: (x,y) -> x ./ y.

◆ operator<

template<typename ExType >
ExType operator< ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 137 of file generic_expression.hpp.

137  {
138  return lt(x, y);
139  }
static ExType lt(const ExType &x, const ExType &y)
Logical less than: (x,y) -> x < y.

◆ operator<=

template<typename ExType >
ExType operator<= ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 152 of file generic_expression.hpp.

152  {
153  return le(x, y);
154  }
static ExType le(const ExType &x, const ExType &y)
Logical less or equal to: (x,y) -> x <= y.

◆ operator==

template<typename ExType >
ExType operator== ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 197 of file generic_expression.hpp.

197  {
198  return eq(x, y);
199  }
static ExType eq(const ExType &x, const ExType &y)
Logical equal to: (x,y) -> x == y.

◆ operator>

template<typename ExType >
ExType operator> ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 167 of file generic_expression.hpp.

167  {
168  return gt(x, y);
169  }
static ExType gt(const ExType &x, const ExType &y)
Logical greater than: (x,y) -> x > y.

◆ operator>=

template<typename ExType >
ExType operator>= ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 182 of file generic_expression.hpp.

182  {
183  return ge(x, y);
184  }
static ExType ge(const ExType &x, const ExType &y)
Logical greater or equal to: (x,y) -> x >= y.

◆ operator||

template<typename ExType >
ExType operator|| ( const ExType &  x,
const ExType &  y 
)
friend

returns (an expression evaluating to) 1 if at least one expression is nonzero and 0 otherwise

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

Definition at line 248 of file generic_expression.hpp.

248  {
249  return logic_or(x, y);
250  }
static ExType logic_or(const ExType &x, const ExType &y)
Logical or

◆ pinv [1/2]

template<typename MatType >
MatType pinv ( const MatType &  A)
friend

If the matrix A is fat (size1<size2), mul(A, pinv(A)) is unity.

pinv(A)' = (AA')^(-1) A

If the matrix A is slender (size1>size2), mul(pinv(A), A) is unity.

pinv(A) = (A'A)^(-1) A'

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

Definition at line 821 of file generic_matrix.hpp.

821  {
822  return MatType::pinv(A);
823  }

◆ pinv [2/2]

template<typename MatType >
MatType pinv ( const MatType &  A,
const std::string &  lsolver,
const Dict dict = Dict() 
)
friend

If the matrix A is fat (size1>size2), mul(A, pinv(A)) is unity. If the matrix A is slender (size2<size1), mul(pinv(A), A) is unity.

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

Definition at line 831 of file generic_matrix.hpp.

832  {
833  return MatType::pinv(A, lsolver, dict);
834  }

◆ plus

template<typename ExType >
ExType plus ( const ExType &  x,
const ExType &  y 
)
friend

Definition at line 70 of file generic_expression.hpp.

70  {
71  return ExType::plus(x, y);
72  }

◆ poly_coeff

template<typename Scalar >
Matrix<Scalar> poly_coeff ( const Matrix< Scalar > &  f,
const Matrix< Scalar > &  x 
)
friend
Parameters
exScalar expression that represents a polynomial
xScalar symbol that the polynomial is build up with

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

Definition at line 873 of file matrix_decl.hpp.

874  {
875  return Matrix<Scalar>::poly_coeff(f, x);
876  }
static Matrix< Scalar > poly_coeff(const Matrix< Scalar > &ex, const Matrix< Scalar > &x)

◆ poly_roots

template<typename Scalar >
Matrix<Scalar> poly_roots ( const Matrix< Scalar > &  p)
friend

This will only work for polynomials up to order 3 It is assumed that the roots are real.

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

Definition at line 884 of file matrix_decl.hpp.

884  {
885  return Matrix<Scalar>::poly_roots(p);
886  }
static Matrix< Scalar > poly_roots(const Matrix< Scalar > &p)

◆ polyval

template<typename MatType >
MatType polyval ( const MatType &  p,
const MatType &  x 
)
friend

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

Definition at line 594 of file generic_matrix.hpp.

594  {
595  return MatType::polyval(p, x);
596  }

◆ pow

template<typename ExType >
ExType pow ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 586 of file generic_expression.hpp.

586  {
587  return ExType::pow(x, y);
588  }

◆ print_operator

template<typename MatType >
std::string print_operator ( const MatType &  xb,
const std::vector< std::string > &  args 
)
friend

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

Definition at line 1158 of file generic_matrix.hpp.

1158  {
1159  return MatType::print_operator(xb, args);
1160  }

◆ printme

template<typename ExType >
ExType printme ( const ExType &  x,
const ExType &  y 
)
friend

Debug printing

Definition at line 733 of file generic_expression.hpp.

733  {
734  return ExType::binary(OP_PRINTME, x, y);
735  }

◆ project

template<typename MatType >
MatType project ( const MatType &  A,
const Sparsity sp,
bool  intersect = false 
)
friend

nonzeros taken from an existing matrix

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

Definition at line 634 of file generic_matrix.hpp.

635  {
636  return MatType::project(A, sp, intersect);
637  }

Referenced by casadi::GenericMatrix< MatType >::tril(), and casadi::GenericMatrix< MatType >::triu().

◆ pw_const

template<typename Scalar >
Matrix<Scalar> pw_const ( const Matrix< Scalar > &  t,
const Matrix< Scalar > &  tval,
const Matrix< Scalar > &  val 
)
friend

Create a piecewise constant function with n=val.size() intervals

Inputs:

Parameters
ta scalar variable (e.g. time)
tvalvector with the discrete values of t at the interval transitions (length n-1)
valvector with the value of the function for each interval (length n)

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

Definition at line 687 of file matrix_decl.hpp.

689  {
690  return Matrix<Scalar>::pw_const(t, tval, val);
691  }
static Matrix< Scalar > pw_const(const Matrix< Scalar > &t, const Matrix< Scalar > &tval, const Matrix< Scalar > &val)

◆ pw_lin

template<typename Scalar >
Matrix<Scalar> pw_lin ( const Matrix< Scalar > &  t,
const Matrix< Scalar > &  tval,
const Matrix< Scalar > &  val 
)
friend

Create a piecewise linear function

Create a piecewise linear function:

Inputs:

tval vector with the the discrete values of t (monotonically increasing)

val vector with the corresponding function values (same length as tval)

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

Definition at line 704 of file matrix_decl.hpp.

705  {
706  return Matrix<Scalar>::pw_lin(t, tval, val);
707  }
static Matrix< Scalar > pw_lin(const Matrix< Scalar > &t, const Matrix< Scalar > &tval, const Matrix< Scalar > &val)

◆ qr

template<typename Scalar >
void qr ( const Matrix< Scalar > &  A,
Matrix< Scalar > &  Q,
Matrix< Scalar > &  R 
)
friend

More stable than the classical Gram-Schmidt, but may break down if the rows of A are nearly linearly dependent See J. Demmel: Applied Numerical Linear Algebra (algorithm 3.1.). Note that in SWIG, Q and R are returned by value.

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

Definition at line 582 of file matrix_decl.hpp.

582  {
583  return Matrix<Scalar>::qr(A, Q, R);
584  }
static void qr(const Matrix< Scalar > &A, Matrix< Scalar > &Q, Matrix< Scalar > &R)

◆ qr_solve

template<typename Scalar >
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 
)
friend

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

Definition at line 601 of file matrix_decl.hpp.

604  {
605  return Matrix<Scalar>::qr_solve(b, v, r, beta, prinv, pc, tr);
606  }
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)

◆ qr_sparse

template<typename Scalar >
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 
)
friend

See T. Davis: Direct Methods for Sparse Linear Systems

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

Definition at line 591 of file matrix_decl.hpp.

593  {
594  return Matrix<Scalar>::qr_sparse(A, V, R, beta, prinv, pc, amd);
595  }
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)

◆ quadratic_coeff

template<typename MatType >
void quadratic_coeff ( const MatType &  expr,
const MatType &  var,
MatType &  A,
MatType &  b,
MatType &  c,
bool  check = true 
)
friend

1/2*x' A x + b' x + c

e = 0.5*bilin(A,x,x)+dot(b,x)+c

Parameters
check[in]When true (default), A is checked to be independent of x. Provided to deal with false positive dependency checks.

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

Definition at line 984 of file generic_matrix.hpp.

985  {
986  MatType::quadratic_coeff(expr, var, A, b, c, check);
987  }

◆ ramp

template<typename Scalar >
Matrix<Scalar> ramp ( const Matrix< Scalar > &  x)
friend

\[ \begin {cases} R(x) = 0 & x <= 1 \\ R(x) = x & x > 1 \\ \end {cases} \]

Also called: slope function

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

Definition at line 769 of file matrix_decl.hpp.

769  {
770  return Matrix<Scalar>::ramp(x);
771  }
static Matrix< Scalar > ramp(const Matrix< Scalar > &x)

◆ rank1

template<typename MatType >
MatType casadi::GenericMatrix< MatType >::rank1 ( const MatType &  A,
const MatType &  alpha,
const MatType &  x,
const MatType &  y 
)
friend

Calculates A + 1/2 * alpha * x*y'

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

Definition at line 418 of file generic_matrix.hpp.

419  {
420  return MatType::rank1(A, alpha, x, y);
421  }

◆ rdivide

template<typename ExType >
ExType rdivide ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 118 of file generic_expression.hpp.

118  {
119  return ExType::rdivide(x, y);
120  }

◆ rectangle

template<typename Scalar >
Matrix<Scalar> rectangle ( const Matrix< Scalar > &  x)
friend

\[ \begin {cases} \Pi(x) = 1 & |x| < 1/2 \\ \Pi(x) = 1/2 & |x| = 1/2 \\ \Pi(x) = 0 & |x| > 1/2 \\ \end {cases} \]

Also called: gate function, block function, band function, pulse function, window function

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

Definition at line 737 of file matrix_decl.hpp.

737  {
738  return Matrix<Scalar>::rectangle(x);
739  }
static Matrix< Scalar > rectangle(const Matrix< Scalar > &x)

◆ remainder

template<typename ExType >
ExType remainder ( const ExType &  x,
const ExType &  y 
)
friend

This Function follows the convention of https://en.cppreference.com/w/c/numeric/math/remainder

Notably:

  • remainder(5,3) -> -1
  • remainder(5,-3) -> -1
  • remainder(-5,3) -> 1
  • remainder(-5,-3) -> 1

This is equivalent to Python's math.remainder. There is no equivalence in Matlab.

\seealso fmod

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

Definition at line 637 of file generic_expression.hpp.

637  {
638  return ExType::remainder(x, y);
639  }

◆ repmat [1/2]

template<typename MatType >
MatType repmat ( const MatType &  A,
casadi_int  n,
casadi_int  m = 1 
)
friend

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

Definition at line 482 of file sparsity_interface.hpp.

482  {
483  return MatType::repmat(A, n, m);
484  }

◆ repmat [2/2]

template<typename MatType >
MatType repmat ( const MatType &  A,
const std::pair< casadi_int, casadi_int > &  rc 
)
friend

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

Definition at line 489 of file sparsity_interface.hpp.

489  {
490  return MatType::repmat(A, rc);
491  }

◆ repsum

template<typename MatType >
MatType repsum ( const MatType &  A,
casadi_int  n,
casadi_int  m = 1 
)
friend

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

Definition at line 1186 of file generic_matrix.hpp.

1186  {
1187  return MatType::repsum(A, n, m);
1188  }

◆ reshape [1/3]

template<typename MatType >
MatType reshape ( const MatType &  x,
casadi_int  nrow,
casadi_int  ncol 
)
friend

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

Definition at line 417 of file sparsity_interface.hpp.

417  {
418  return MatType::reshape(x, nrow, ncol);
419  }

◆ reshape [2/3]

template<typename MatType >
MatType reshape ( const MatType &  x,
const Sparsity sp 
)
friend

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

Definition at line 431 of file sparsity_interface.hpp.

431  {
432  return MatType::reshape(x, sp);
433  }

◆ reshape [3/3]

template<typename MatType >
MatType reshape ( const MatType &  x,
std::pair< casadi_int, casadi_int >  rc 
)
friend

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

Definition at line 424 of file sparsity_interface.hpp.

424  {
425  return MatType::reshape(x, rc.first, rc.second);
426  }

◆ reverse

template<typename MatType >
std::vector<std::vector<MatType> > reverse ( const std::vector< MatType > &  ex,
const std::vector< MatType > &  arg,
const std::vector< std::vector< MatType > > &  v,
const Dict opts = Dict() 
)
friend

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

Definition at line 915 of file generic_matrix.hpp.

917  {
918  return MatType::reverse(ex, arg, v, opts);
919  }

◆ separate_linear [1/2]

template<typename MatType >
void separate_linear ( const MatType &  expr,
const MatType &  sym_lin,
const MatType &  sym_const,
MatType &  expr_const,
MatType &  expr_lin,
MatType &  expr_nonlin 
)
friend

Definition at line 1112 of file generic_matrix.hpp.

1114  {
1115  MatType::separate_linear(expr, sym_lin, sym_const, expr_const, expr_lin, expr_nonlin);
1116  }

◆ separate_linear [2/2]

template<typename MatType >
void separate_linear ( const MatType &  expr,
const std::vector< MatType > &  sym_lin,
const std::vector< MatType > &  sym_const,
MatType &  expr_const,
MatType &  expr_lin,
MatType &  expr_nonlin 
)
friend

Definition at line 1118 of file generic_matrix.hpp.

1120  {
1121  separate_linear(expr, veccat(sym_lin), veccat(sym_const),
1122  expr_const, expr_lin, expr_nonlin);
1123  }
friend void separate_linear(const MatType &expr, const MatType &sym_lin, const MatType &sym_const, MatType &expr_const, MatType &expr_lin, MatType &expr_nonlin)

◆ shared

template<typename MatType >
void shared ( std::vector< MatType > &  ex,
std::vector< MatType > &  v,
std::vector< MatType > &  vdef,
const std::string &  v_prefix = "v_",
const std::string &  v_suffix = "" 
)
friend

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

Definition at line 1175 of file generic_matrix.hpp.

1179  {
1180  return MatType::shared(ex, v, vdef, v_prefix, v_suffix);
1181  }

◆ sign

template<typename ExType >
ExType sign ( const ExType &  x)
friend

sign(x) := -1 for x<0 sign(x) := 1 for x>0, sign(0) := 0 sign(NaN) := NaN

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

Definition at line 574 of file generic_expression.hpp.

574  {
575  return ExType::sign(x);
576  }

◆ simplify

template<typename MatType >
MatType simplify ( const MatType &  x)
friend

Definition at line 1131 of file generic_matrix.hpp.

1131  {
1132  return MatType::simplify(x);
1133  }

◆ sin

template<typename ExType >
ExType sin ( const ExType &  x)
friend

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

Definition at line 317 of file generic_expression.hpp.

317  {
318  return ExType::sin(x);
319  }

◆ sinh

template<typename ExType >
ExType sinh ( const ExType &  x)
friend

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

Definition at line 401 of file generic_expression.hpp.

401  {
402  return ExType::sinh(x);
403  }

◆ skew

template<typename MatType >
MatType skew ( const MatType &  a)
friend

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

Definition at line 474 of file generic_matrix.hpp.

474  {
475  return MatType::skew(a);
476  }

◆ soc

template<typename MatType >
MatType casadi::GenericMatrix< MatType >::soc ( const MatType &  x,
const MatType &  y 
)
friend
Parameters
[in]xvector expression of size n
[in]yscalar expression

soc(x,y) computes [y*eye(n) x; x' y]

soc(x,y) positive semi definite <=> || x ||_2 <= y

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

Definition at line 334 of file generic_matrix.hpp.

334  {
335  return MatType::soc(x, y);
336  }

◆ solve [1/2]

template<typename MatType >
MatType solve ( const MatType &  A,
const MatType &  b 
)
friend

The solve routine works similar to Matlab's backslash when A is square and nonsingular. The algorithm used is the following:

  1. A simple forward or backward substitution if A is upper or lower triangular
  2. If the linear system is at most 3-by-3, form the inverse via minor expansion and multiply
  3. Permute the variables and equations as to get a (structurally) nonzero diagonal, then perform a QR factorization without pivoting and solve the factorized system.

Note 1: If there are entries of the linear system known to be zero, these will be removed. Elements that are very small, or will evaluate to be zero, can still cause numerical errors, due to the lack of pivoting (which is not possible since cannot compare the size of entries)

Note 2: When permuting the linear system, a BLT (block lower triangular) transformation is formed. Only the permutation part of this is however used. An improvement would be to solve block-by-block if there are multiple BLT blocks.

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

Definition at line 769 of file generic_matrix.hpp.

769  {
770  // If A is scalar, just divide
771  if (A.is_scalar()) return b/A;
772  return MatType::solve(A, b);
773  }

◆ solve [2/2]

template<typename MatType >
MatType solve ( const MatType &  A,
const MatType &  b,
const std::string &  lsolver,
const Dict dict = Dict() 
)
friend

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

Definition at line 778 of file generic_matrix.hpp.

780  {
781  // If A is scalar, just divide
782  if (A.is_scalar()) return b/A;
783  return MatType::solve(A, b, lsolver, dict);
784  }

◆ sparsify

template<typename Scalar >
Matrix<Scalar> sparsify ( const Matrix< Scalar > &  A,
double  tol = 0 
)
friend

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

Definition at line 665 of file matrix_decl.hpp.

665  {
666  return Matrix<Scalar>::sparsify(A, tol);
667  }
static Matrix< Scalar > sparsify(const Matrix< Scalar > &x, double tol=0)

◆ sparsity_cast

template<typename MatType >
MatType sparsity_cast ( const MatType &  x,
const Sparsity sp 
)
friend

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

Definition at line 438 of file sparsity_interface.hpp.

438  {
439  return MatType::sparsity_cast(x, sp);
440  }

◆ sprank

template<typename MatType >
casadi_int sprank ( const MatType &  x)
friend

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

Definition at line 445 of file sparsity_interface.hpp.

445  {
446  return MatType::sprank(x);
447  }

◆ sq

template<typename ExType >
ExType sq ( const ExType &  x)
friend

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

Definition at line 305 of file generic_expression.hpp.

305  {
306  return ExType::sq(x);
307  }

◆ sqrt

template<typename ExType >
ExType sqrt ( const ExType &  x)
friend

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

Definition at line 293 of file generic_expression.hpp.

293  {
294  return ExType::sqrt(x);
295  }

◆ stop_diff [1/2]

MX stop_diff ( const MX expr,
casadi_int  order 
)
friend

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

Definition at line 968 of file mx.hpp.

968  {
969  return MX::stop_diff(expr, order);
970  }

◆ stop_diff [2/2]

MX stop_diff ( const MX expr,
const MX var,
casadi_int  order 
)
friend

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

Definition at line 994 of file mx.hpp.

994  {
995  return MX::stop_diff(expr, var, order);
996  }

◆ substitute [1/2]

template<typename MatType >
MatType substitute ( const MatType &  ex,
const MatType &  v,
const MatType &  vdef 
)
friend

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

Definition at line 709 of file generic_matrix.hpp.

710  {
711  return MatType::substitute(ex, v, vdef);
712  }

◆ substitute [2/2]

template<typename MatType >
std::vector<MatType> substitute ( const std::vector< MatType > &  ex,
const std::vector< MatType > &  v,
const std::vector< MatType > &  vdef 
)
friend

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

Definition at line 718 of file generic_matrix.hpp.

719  {
720  return MatType::substitute(ex, v, vdef);
721  }

◆ substitute_inplace

template<typename MatType >
void substitute_inplace ( const std::vector< MatType > &  v,
std::vector< MatType > &  inout_vdef,
std::vector< MatType > &  inout_ex,
bool  reverse = false 
)
friend

Substitute variables v out of the expressions vdef sequentially, as well as out of a number of other expressions piggyback

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

Definition at line 730 of file generic_matrix.hpp.

732  {
733  return MatType::substitute_inplace(v, inout_vdef, inout_ex, reverse);
734  }
friend std::vector< std::vector< MatType > > reverse(const std::vector< MatType > &ex, const std::vector< MatType > &arg, const std::vector< std::vector< MatType > > &v, const Dict &opts=Dict())
Reverse directional derivative.

◆ sum

template<typename MatType >
MatType sum ( const MatType &  x)
friend

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

Definition at line 620 of file sparsity_interface.hpp.

620  {
621  if (x.is_vector()) {
622  if (x.is_column()) {
623  return MatType::sum1(x);
624  } else {
625  return MatType::sum2(x);
626  }
627  }
628  if (x.size1()>x.size2()) {
629  return MatType::sum2(MatType::sum1(x));
630  } else {
631  return MatType::sum1(MatType::sum2(x));
632  }
633  }

◆ sum1

template<typename MatType >
MatType sum1 ( const MatType &  x)
friend

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

Definition at line 610 of file sparsity_interface.hpp.

610 { return MatType::sum1(x);}

◆ sum2

template<typename MatType >
MatType sum2 ( const MatType &  x)
friend

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

Definition at line 615 of file sparsity_interface.hpp.

615 { return MatType::sum2(x);}

◆ sumsqr

template<typename MatType >
MatType sumsqr ( const MatType &  x)
friend

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

Definition at line 429 of file generic_matrix.hpp.

429  {
430  return MatType::sumsqr(x);
431  }

◆ symvar

template<typename MatType >
std::vector<MatType> symvar ( const MatType &  x)
friend

Get all symbols on which the supplied expression depends

See also
SXFunction::getFree(), MXFunction::getFree()

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

Definition at line 393 of file generic_matrix.hpp.

393  {
394  return MatType::symvar(x);
395  }

◆ tan

template<typename ExType >
ExType tan ( const ExType &  x)
friend

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

Definition at line 341 of file generic_expression.hpp.

341  {
342  return ExType::tan(x);
343  }

◆ tangent

template<typename MatType >
MatType casadi::GenericMatrix< MatType >::tangent ( const MatType &  ex,
const MatType &  arg,
const Dict opts = Dict() 
)
friend

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

Definition at line 883 of file generic_matrix.hpp.

883  {
884  return MatType::tangent(ex, arg, opts);
885  }

◆ tanh

template<typename ExType >
ExType tanh ( const ExType &  x)
friend

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

Definition at line 389 of file generic_expression.hpp.

389  {
390  return ExType::tanh(x);
391  }

◆ taylor [1/2]

template<typename Scalar >
Matrix<Scalar> taylor ( const Matrix< Scalar > &  ex,
const Matrix< Scalar > &  x 
)
friend

Calculate the Taylor expansion of expression 'ex' up to order 'order' with respect to variable 'x' around the point 'a'

$(x)=f(a)+f'(a)(x-a)+f''(a)\frac {(x-a)^2}{2!}+f'''(a)\frac{(x-a)^3}{3!}+\ldots$

Example usage:

taylor(sin(x), x)
>>   x 
taylor(sin(x),x,x0) -> sin(x0)+cos(x0)*(x-x0)
static Matrix< Scalar > cos(const Matrix< Scalar > &x)
Cosine: x -> cos(x)
See also
linearize, mtaylor, linear_coeff

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

Definition at line 816 of file matrix_decl.hpp.

816  {
817  return Matrix<Scalar>::taylor(ex, x, 0, 1);
818  }

◆ taylor [2/2]

template<typename Scalar >
Matrix<Scalar> taylor ( const Matrix< Scalar > &  ex,
const Matrix< Scalar > &  x,
const Matrix< Scalar > &  a,
casadi_int  order = 1 
)
friend

Calculate the Taylor expansion of expression 'ex' up to order 'order' with respect to variable 'x' around the point 'a'

$(x)=f(a)+f'(a)(x-a)+f''(a)\frac {(x-a)^2}{2!}+f'''(a)\frac{(x-a)^3}{3!}+\ldots$

Example usage:

taylor(sin(x), x)
>>   x 
taylor(sin(x),x,x0) -> sin(x0)+cos(x0)*(x-x0)
See also
linearize, mtaylor, linear_coeff

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

Definition at line 812 of file matrix_decl.hpp.

813  {
814  return Matrix<Scalar>::taylor(ex, x, a, order);
815  }

◆ times

template<typename ExType >
ExType times ( const ExType &  x,
const ExType &  y 
)
friend

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

Definition at line 102 of file generic_expression.hpp.

102  {
103  return ExType::times(x, y);
104  }

◆ trace

template<typename MatType >
MatType trace ( const MatType &  x)
friend

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

Definition at line 522 of file generic_matrix.hpp.

522 { return MatType::trace(x);}

◆ transform [1/4]

template<typename MatType >
MatType transform ( const MatType &  x,
const Dict opts = Dict() 
)
friend

Apply transformation passes to an expression

Definition at line 1137 of file generic_matrix.hpp.

1137  {
1138  return MatType::transform(x, opts);
1139  }

◆ transform [2/4]

template<typename MatType >
MatType transform ( const MatType &  x,
const std::vector< std::vector< GenericType > > &  passes,
const Dict opts = Dict() 
)
friend

Apply transformation passes to an expression

Definition at line 1140 of file generic_matrix.hpp.

1141  {
1142  return MatType::transform(x, passes, opts);
1143  }

◆ transform [3/4]

template<typename MatType >
std::vector<MatType> transform ( const std::vector< MatType > &  x,
const Dict opts = Dict() 
)
friend

Apply transformation passes to an expression

Definition at line 1144 of file generic_matrix.hpp.

1145  {
1146  return MatType::transform(x, opts);
1147  }

◆ transform [4/4]

template<typename MatType >
std::vector<MatType> transform ( const std::vector< MatType > &  x,
const std::vector< std::vector< GenericType > > &  passes,
const Dict opts = Dict() 
)
friend

Apply transformation passes to an expression

Definition at line 1148 of file generic_matrix.hpp.

1149  {
1150  return MatType::transform(x, passes, opts);
1151  }

◆ transpose

template<typename MatType >
MatType transpose ( const MatType &  X)
friend

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

Definition at line 389 of file sparsity_interface.hpp.

389  {
390  return X.T();
391  }

◆ triangle

template<typename Scalar >
Matrix<Scalar> triangle ( const Matrix< Scalar > &  x)
friend

\[ \begin {cases} \Lambda(x) = 0 & |x| >= 1 \\ \Lambda(x) = 1-|x| & |x| < 1 \end {cases} \]

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

Definition at line 752 of file matrix_decl.hpp.

752  {
753  return Matrix<Scalar>::triangle(x);
754  }
static Matrix< Scalar > triangle(const Matrix< Scalar > &x)

◆ tril

template<typename MatType >
MatType tril ( const MatType &  x,
bool  includeDiagonal = true 
)
friend

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

Definition at line 466 of file sparsity_interface.hpp.

466  {
467  return MatType::tril(x, includeDiagonal);
468  }

◆ tril2symm

template<typename MatType >
MatType tril2symm ( const MatType &  a)
friend

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

Definition at line 527 of file generic_matrix.hpp.

527 { return MatType::tril2symm(a);}

◆ triu

template<typename MatType >
MatType triu ( const MatType &  x,
bool  includeDiagonal = true 
)
friend

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

Definition at line 459 of file sparsity_interface.hpp.

459  {
460  return MatType::triu(x, includeDiagonal);
461  }

◆ triu2symm

template<typename MatType >
MatType triu2symm ( const MatType &  a)
friend

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

Definition at line 532 of file generic_matrix.hpp.

532 { return MatType::triu2symm(a);}

◆ unite

template<typename MatType >
MatType unite ( const MatType &  A,
const MatType &  B 
)
friend

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

Definition at line 611 of file generic_matrix.hpp.

611  {
612  return MatType::unite(A, B);
613  }

◆ vec

template<typename MatType >
MatType vec ( const MatType &  x)
friend

Reshapes/vectorizes the matrix such that the shape becomes (expr.numel(), 1). Columns are stacked on top of each other. Same as reshape(expr, expr.numel(), 1)

a c
b d
turns into

a
b
c
d
Extra doc: https://github.com/casadi/casadi/wiki/L_3z

Definition at line 410 of file sparsity_interface.hpp.

410  {
411  return MatType::vec(x);
412  }

◆ veccat

template<typename MatType >
MatType veccat ( const std::vector< MatType > &  x)
friend

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

Definition at line 332 of file sparsity_interface.hpp.

332  {
333  return MatType::veccat(x);
334  }

◆ vertcat [1/6]

template<typename MatType >
MatType vertcat ( const MatType &  x,
const MatType &  y 
)
friend

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

Definition at line 534 of file sparsity_interface.hpp.

534  {
535  return vertcat(std::vector<MatType>{x, y});
536  }

◆ vertcat [2/6]

template<typename MatType >
MatType vertcat ( const MatType &  x,
const MatType &  y,
const MatType &  z 
)
friend

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

Definition at line 541 of file sparsity_interface.hpp.

541  {
542  return vertcat(std::vector<MatType>{x, y, z});
543  }

◆ vertcat [3/6]

template<typename MatType >
MatType vertcat ( const MatType &  x,
const MatType &  y,
const MatType &  z,
const MatType &  w 
)
friend

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

Definition at line 548 of file sparsity_interface.hpp.

549  {
550  return vertcat(std::vector<MatType>{x, y, z, w});
551  }

◆ vertcat [4/6]

template<typename MatType >
MatType vertcat ( const MatType &  x,
const MatType &  y,
const MatType &  z,
const MatType &  w,
const MatType &  v 
)
friend

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

Definition at line 556 of file sparsity_interface.hpp.

557  {
558  return vertcat(std::vector<MatType>{x, y, z, w, v});
559  }

◆ vertcat [5/6]

template<typename MatType >
MatType vertcat ( const MatType &  x,
const MatType &  y,
const MatType &  z,
const MatType &  w,
const MatType &  v,
const MatType &  u 
)
friend

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

Definition at line 564 of file sparsity_interface.hpp.

565  {
566  return vertcat(std::vector<MatType>{x, y, z, w, v, u});
567  }

◆ vertcat [6/6]

template<typename MatType >
MatType vertcat ( const std::vector< MatType > &  v)
friend

Alternative terminology: vertical stack, vstack, vertical append, [a;b]

vertcat(vertsplit(x, ...)) = x

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

Definition at line 109 of file sparsity_interface.hpp.

109  {
110  return MatType::vertcat(v);
111  }

◆ vertsplit [1/2]

template<typename MatType >
std::vector<MatType > vertsplit ( const MatType &  x,
casadi_int  incr = 1 
)
friend
Parameters
incrSize of each group of rows

vertcat(vertsplit(x, ...)) = x

print vertsplit(SX.sym("a",4))

[SX(a_0), SX(a_1), SX(a_2), SX(a_3)]

print vertsplit(SX.sym("a",4),2)

[SX([a_0, a_1]), SX([a_2, a_3])]

If the number of rows is not a multiple of incr, the last entry returned will have a size smaller than incr.

print vertsplit(DM([0,1,2,3,4]),2)

[DM([0, 1]), DM([2, 3]), DM(4)]

\seealso vertsplit_n

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

Definition at line 205 of file sparsity_interface.hpp.

205  {
206  return MatType::vertsplit(x, incr);
207  }

◆ vertsplit [2/2]

template<typename MatType >
std::vector<MatType > vertsplit ( const MatType &  x,
const std::vector< casadi_int > &  offset 
)
friend
Parameters
output_offsetList of all start rows for each group the last row group will run to the end.

vertcat(vertsplit(x, ...)) = x

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

Definition at line 163 of file sparsity_interface.hpp.

163  {
164  return MatType::vertsplit(x, offset);
165  }

◆ vertsplit_n

template<typename MatType >
std::vector<MatType > vertsplit_n ( const MatType &  x,
casadi_int  n 
)
friend
Parameters
nNumber of groups of rows

Will error when the number of rows is not a multiple of n

vertcat(vertsplit(x, ...)) = x

\seealso vertsplit

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

Definition at line 220 of file sparsity_interface.hpp.

220  {
221  return MatType::vertsplit_n(x, n);
222  }

◆ which_depends

template<typename MatType >
std::vector<bool> which_depends ( const MatType &  expr,
const MatType &  var,
casadi_int  order,
bool  tr 
)
friend

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

Definition at line 938 of file generic_matrix.hpp.

939  {
940  return MatType::which_depends(expr, var, order, tr);
941  }