#include <sparsity_internal.hpp>
Definition at line 44 of file sparsity_internal.hpp.
Public Types | |
using | weak_ref_type = WeakRefInternal |
Public Member Functions | |
SparsityInternal (casadi_int nrow, casadi_int ncol, const casadi_int *colind, const casadi_int *row) | |
Construct a sparsity pattern from arrays. More... | |
~SparsityInternal () override | |
Destructor. More... | |
const std::vector< casadi_int > & | sp () const |
Get number of rows (see public class) More... | |
casadi_int | size1 () const |
Get number of rows (see public class) More... | |
casadi_int | size2 () const |
Get number of columns (see public class) More... | |
const casadi_int * | colind () const |
Get column offsets (see public class) More... | |
const casadi_int * | row () const |
Get row indices (see public class) More... | |
casadi_int | nnz () const |
Number of structural non-zeros. More... | |
Sparsity | get_diag (std::vector< casadi_int > &mapping) const |
Get the diagonal of the matrix/create a diagonal matrix. More... | |
bool | has_diag () const |
has diagonal entries? More... | |
Sparsity | drop_diag () const |
Drop diagonal entries. More... | |
casadi_int | dfs (casadi_int j, casadi_int top, std::vector< casadi_int > &xi, std::vector< casadi_int > &pstack, const std::vector< casadi_int > &pinv, std::vector< bool > &marked) const |
Depth-first search. More... | |
casadi_int | scc (std::vector< casadi_int > &p, std::vector< casadi_int > &r) const |
Find the strongly connected components of a square matrix. More... | |
std::vector< casadi_int > | amd () const |
Approximate minimal degree preordering. More... | |
Sparsity | T () const |
Transpose the matrix. More... | |
Sparsity | transpose (std::vector< casadi_int > &mapping, bool invert_mapping=false) const |
Transpose the matrix and get the reordering of the non-zero entries,. More... | |
bool | is_transpose (const SparsityInternal &y) const |
Check if the sparsity is the transpose of another. More... | |
bool | is_reshape (const SparsityInternal &y) const |
Check if the sparsity is a reshape of another. More... | |
void | bfs (casadi_int n, std::vector< casadi_int > &wi, std::vector< casadi_int > &wj, std::vector< casadi_int > &queue, const std::vector< casadi_int > &imatch, const std::vector< casadi_int > &jmatch, casadi_int mark) const |
Breadth-first search for coarse decomposition. More... | |
casadi_int | btf (std::vector< casadi_int > &rowperm, std::vector< casadi_int > &colperm, std::vector< casadi_int > &rowblock, std::vector< casadi_int > &colblock, std::vector< casadi_int > &coarse_rowblock, std::vector< casadi_int > &coarse_colblock) const |
Compute the Dulmage-Mendelsohn decomposition. More... | |
const Btf & | btf () const |
Get cached block triangular form. More... | |
void | dmperm (std::vector< casadi_int > &rowperm, std::vector< casadi_int > &colperm, std::vector< casadi_int > &rowblock, std::vector< casadi_int > &colblock, std::vector< casadi_int > &coarse_rowblock, std::vector< casadi_int > &coarse_colblock) const |
Compute the Dulmage-Mendelsohn decomposition. More... | |
void | maxtrans (std::vector< casadi_int > &imatch, std::vector< casadi_int > &jmatch, Sparsity &trans, casadi_int seed) const |
Compute the maximum transversal (maximum matching) More... | |
void | augment (casadi_int k, std::vector< casadi_int > &jmatch, casadi_int *cheap, std::vector< casadi_int > &w, casadi_int *js, casadi_int *is, casadi_int *ps) const |
Find an augmenting path. More... | |
Sparsity | permute (const std::vector< casadi_int > &pinv, const std::vector< casadi_int > &q, casadi_int values) const |
C = A(p, q) where p and q are permutations of 0..m-1 and 0..n-1. More... | |
void | permute (const std::vector< casadi_int > &pinv, const std::vector< casadi_int > &q, casadi_int values, std::vector< casadi_int > &colind_C, std::vector< casadi_int > &row_C) const |
C = A(p, q) where p and q are permutations of 0..m-1 and 0..n-1. More... | |
Sparsity | multiply (const Sparsity &B) const |
C = A*B. More... | |
casadi_int | scatter (casadi_int j, std::vector< casadi_int > &w, casadi_int mark, casadi_int *Ci, casadi_int nz) const |
x = x + beta * A(:, j), where x is a dense vector and A(:, j) is sparse More... | |
std::vector< casadi_int > | get_row () const |
Get row() as a vector. More... | |
std::vector< casadi_int > | get_colind () const |
Get colind() as a vector. More... | |
std::vector< casadi_int > | get_col () const |
Get the column for each nonzero. More... | |
Sparsity | _resize (casadi_int nrow, casadi_int ncol) const |
Resize. More... | |
Sparsity | _reshape (casadi_int nrow, casadi_int ncol) const |
Reshape a sparsity, order of nonzeros remains the same. More... | |
casadi_int | numel () const |
Number of elements. More... | |
casadi_int | nnz_lower (bool strictly=false) const |
Number of non-zeros in the lower triangular half. More... | |
casadi_int | nnz_upper (bool strictly=false) const |
Number of non-zeros in the upper triangular half. More... | |
casadi_int | nnz_diag () const |
Number of non-zeros on the diagonal. More... | |
casadi_int | bw_upper () const |
Upper half-bandwidth. More... | |
casadi_int | bw_lower () const |
Lower half-bandwidth. More... | |
std::pair< casadi_int, casadi_int > | size () const |
Shape. More... | |
bool | is_scalar (bool scalar_and_dense) const |
Is scalar? More... | |
bool | is_empty (bool both=false) const |
Check if the sparsity is empty. More... | |
bool | is_dense () const |
Is dense? More... | |
bool | is_row () const |
Check if the pattern is a row vector (i.e. size1()==1) More... | |
bool | is_column () const |
Check if the pattern is a column vector (i.e. size2()==1) More... | |
bool | is_vector () const |
Check if the pattern is a row or column vector. More... | |
bool | is_diag () const |
Is diagonal? More... | |
bool | is_square () const |
Is square? More... | |
bool | is_permutation () const |
Is this a permutation matrix? More... | |
bool | is_selection (bool allow_empty=false) const |
Is this a selection matrix. More... | |
bool | is_orthonormal (bool allow_empty=false) const |
Are the rows and columns of the pattern orthonormal ? More... | |
bool | is_orthonormal_rows (bool allow_empty=false) const |
Are the rows of the pattern orthonormal ? More... | |
bool | is_orthonormal_columns (bool allow_empty=false) const |
Are the columns of the pattern orthonormal ? More... | |
bool | is_symmetric () const |
Is symmetric? More... | |
bool | is_tril (bool strictly) const |
Is lower triangular? More... | |
bool | is_triu (bool strictly) const |
is upper triangular? More... | |
Sparsity | _triu (bool includeDiagonal) const |
Get upper triangular part. More... | |
Sparsity | _tril (bool includeDiagonal) const |
Get lower triangular part. More... | |
std::vector< casadi_int > | get_lower () const |
Get nonzeros in lower triangular part. More... | |
std::vector< casadi_int > | get_upper () const |
Get nonzeros in upper triangular part. More... | |
std::string | dim (bool with_nz=false) const |
Get the dimension as a string. More... | |
std::string | repr_el (casadi_int k) const |
Describe the nonzero location k as a string. More... | |
Sparsity | _mtimes (const Sparsity &y) const |
Sparsity pattern for a matrix-matrix product (details in public class) More... | |
bool | is_subset (const Sparsity &rhs) const |
Is subset? More... | |
Sparsity | pattern_inverse () const |
Take the inverse of a sparsity pattern; flip zeros and non-zeros. More... | |
bool | is_equal (const Sparsity &y) const |
Check if two sparsity patterns are the same. More... | |
bool | is_equal (casadi_int y_nrow, casadi_int y_ncol, const std::vector< casadi_int > &y_colind, const std::vector< casadi_int > &y_row) const |
Check if two sparsity patterns are the same. More... | |
bool | is_equal (casadi_int y_nrow, casadi_int y_ncol, const casadi_int *y_colind, const casadi_int *y_row) const |
Check if two sparsity patterns are the same. More... | |
bool | is_stacked (const Sparsity &y, casadi_int n) const |
Check if pattern is repeated. More... | |
Sparsity | _enlargeRows (casadi_int nrow, const std::vector< casadi_int > &rr, bool ind1) const |
Enlarge the matrix along the first dimension (i.e. insert rows) More... | |
Sparsity | _enlargeColumns (casadi_int ncol, const std::vector< casadi_int > &cc, bool ind1) const |
Enlarge the matrix along the second dimension (i.e. insert columns) More... | |
Sparsity | makeDense (std::vector< casadi_int > &mapping) const |
Make a patten dense. More... | |
Sparsity | _erase (const std::vector< casadi_int > &rr, const std::vector< casadi_int > &cc, bool ind1, std::vector< casadi_int > &mapping) const |
Erase rows and/or columns - does bounds checking. More... | |
Sparsity | _erase (const std::vector< casadi_int > &rr, bool ind1, std::vector< casadi_int > &mapping) const |
Erase elements. More... | |
Sparsity | _appendVector (const SparsityInternal &sp) const |
Append another sparsity patten vertically (vectors only) More... | |
Sparsity | _appendColumns (const SparsityInternal &sp) const |
Append another sparsity patten horizontally. More... | |
Sparsity | sub (const std::vector< casadi_int > &rr, const std::vector< casadi_int > &cc, std::vector< casadi_int > &mapping, bool ind1) const |
Get a submatrix. More... | |
Sparsity | sub (const std::vector< casadi_int > &rr, const SparsityInternal &sp, std::vector< casadi_int > &mapping, bool ind1) const |
Get a set of elements. More... | |
casadi_int | get_nz (casadi_int rr, casadi_int cc) const |
Get the index of an existing non-zero element. More... | |
std::vector< casadi_int > | get_nz (const std::vector< casadi_int > &rr, const std::vector< casadi_int > &cc) const |
Get a set of non-zero element - does bounds checking. More... | |
void | get_nz (std::vector< casadi_int > &indices) const |
Get the nonzero index for a set of elements (see description in public class) More... | |
bool | rowsSequential (bool strictly) const |
Does the rows appear sequentially on each col. More... | |
Sparsity | _removeDuplicates (std::vector< casadi_int > &mapping) const |
Remove duplicate entries. More... | |
void | find (std::vector< casadi_int > &loc, bool ind1) const |
Get element index for each nonzero. More... | |
std::size_t | hash () const |
Hash the sparsity pattern. More... | |
std::string | class_name () const override |
Readable name of the internal class. More... | |
void | disp (std::ostream &stream, bool more) const override |
Print description. More... | |
Sparsity | uni_coloring (const Sparsity &AT, casadi_int cutoff) const |
Perform a unidirectional coloring. More... | |
Sparsity | star_coloring (casadi_int ordering, casadi_int cutoff) const |
A greedy distance-2 coloring algorithm. More... | |
Sparsity | star_coloring2 (casadi_int ordering, casadi_int cutoff) const |
An improved distance-2 coloring algorithm. More... | |
std::vector< casadi_int > | largest_first () const |
Order the columns by decreasing degree. More... | |
Sparsity | pmult (const std::vector< casadi_int > &p, bool permute_rows=true, bool permute_cols=true, bool invert_permutation=false) const |
Permute rows and/or columns. More... | |
void | spy (std::ostream &stream) const |
Print a textual representation of sparsity. More... | |
void | spy_matlab (const std::string &mfile) const |
Generate a script for Matlab or Octave which visualizes the sparsity using the spy command. More... | |
void | export_code (const std::string &lang, std::ostream &stream, const Dict &options) const |
Export sparsity in Matlab format. More... | |
void | spsolve (bvec_t *X, bvec_t *B, bool tr) const |
Propagate sparsity through a linear solve. More... | |
casadi_int | getCount () const |
Get the reference count. More... | |
std::string | debug_repr (const SharedObjectInternal *) const |
GenericWeakRef< SharedObject, SharedObjectInternal > * | weak () |
Get a weak reference to the object. More... | |
Sparsity | combine (const Sparsity &y, bool f0x_is_zero, bool function0_is_zero, std::vector< unsigned char > &mapping) const |
Sparsity | combine (const Sparsity &y, bool f0x_is_zero, bool function0_is_zero) const |
template<bool with_mapping> | |
Sparsity | combineGen1 (const Sparsity &y, bool f0x_is_zero, bool function0_is_zero, std::vector< unsigned char > &mapping) const |
template<bool with_mapping, bool f0x_is_zero, bool function0_is_zero> | |
Sparsity | combineGen (const Sparsity &y, std::vector< unsigned char > &mapping) const |
Static Public Member Functions | |
static void | etree (const casadi_int *sp, casadi_int *parent, casadi_int *w, casadi_int ata) |
Calculate the elimination tree for a matrix. More... | |
static casadi_int | postorder_dfs (casadi_int j, casadi_int k, casadi_int *head, const casadi_int *next, casadi_int *post, casadi_int *stack) |
Traverse an elimination tree using depth first search. More... | |
static void | postorder (const casadi_int *parent, casadi_int n, casadi_int *post, casadi_int *w) |
Calculate the postorder permuation. More... | |
static casadi_int | leaf (casadi_int i, casadi_int j, const casadi_int *first, casadi_int *maxfirst, casadi_int *prevleaf, casadi_int *ancestor, casadi_int *jleaf) |
Needed by casadi_qr_colind. More... | |
static casadi_int | qr_counts (const casadi_int *tr_sp, const casadi_int *parent, const casadi_int *post, casadi_int *counts, casadi_int *w) |
Calculate the column offsets for the QR R matrix. More... | |
static casadi_int | qr_nnz (const casadi_int *sp, casadi_int *pinv, casadi_int *leftmost, const casadi_int *parent, casadi_int *nrow_ext, casadi_int *w) |
Calculate the number of nonzeros in the QR V matrix. More... | |
static void | qr_init (const casadi_int *sp, const casadi_int *sp_tr, casadi_int *leftmost, casadi_int *parent, casadi_int *pinv, casadi_int *nrow_ext, casadi_int *v_nnz, casadi_int *r_nnz, casadi_int *w) |
Setup QP solver. More... | |
static void | qr_sparsities (const casadi_int *sp_a, casadi_int nrow_ext, casadi_int *sp_v, casadi_int *sp_r, const casadi_int *leftmost, const casadi_int *parent, const casadi_int *pinv, casadi_int *iw) |
Get the row indices for V and R in QR factorization. More... | |
static void | ldl_colind (const casadi_int *sp, casadi_int *parent, casadi_int *l_colind, casadi_int *w) |
Calculate the column offsets for the L factor of an LDL^T factorization. More... | |
static void | ldl_row (const casadi_int *sp, const casadi_int *parent, casadi_int *l_colind, casadi_int *l_row, casadi_int *w) |
Calculate the row indices for the L factor of an LDL^T factorization. More... | |
static void | matched (casadi_int n, const std::vector< casadi_int > &wj, const std::vector< casadi_int > &imatch, std::vector< casadi_int > &p, std::vector< casadi_int > &q, std::vector< casadi_int > &cc, std::vector< casadi_int > &rr, casadi_int set, casadi_int mark) |
Collect matched columns and rows into p and q. More... | |
static void | unmatched (casadi_int m, const std::vector< casadi_int > &wi, std::vector< casadi_int > &p, std::vector< casadi_int > &rr, casadi_int set) |
Collect unmatched columns into the permutation vector p. More... | |
static casadi_int | rprune (casadi_int i, casadi_int j, double aij, void *other) |
return 1 if column i is in R2 More... | |
static casadi_int | drop (casadi_int(*fkeep)(casadi_int, casadi_int, double, void *), void *other, casadi_int nrow, casadi_int ncol, std::vector< casadi_int > &colind, std::vector< casadi_int > &row) |
drop entries for which fkeep(A(i, j)) is false; return nz if OK, else -1 More... | |
static std::vector< casadi_int > | randperm (casadi_int n, casadi_int seed) |
return a random permutation vector More... | |
static std::vector< casadi_int > | invertPermutation (const std::vector< casadi_int > &p) |
Invert a permutation vector. More... | |
static casadi_int | wclear (casadi_int mark, casadi_int lemax, casadi_int *w, casadi_int n) |
clear w More... | |
static casadi_int | diag (casadi_int i, casadi_int j, double aij, void *other) |
keep off-diagonal entries; drop diagonal entries More... | |
Protected Member Functions | |
void | initSingleton () |
void | destroySingleton () |
B | shared_from_this () |
Get a shared object from the current internal object. More... | |
const B | shared_from_this () const |
Get a shared object from the current internal object. More... | |
|
inherited |
Definition at line 152 of file shared_object.hpp.
casadi::SparsityInternal::SparsityInternal | ( | casadi_int | nrow, |
casadi_int | ncol, | ||
const casadi_int * | colind, | ||
const casadi_int * | row | ||
) |
Definition at line 449 of file sparsity_internal.cpp.
|
override |
Definition at line 459 of file sparsity_internal.cpp.
Sparsity casadi::SparsityInternal::_appendColumns | ( | const SparsityInternal & | sp | ) | const |
Definition at line 2577 of file sparsity_internal.cpp.
References get_colind(), get_row(), nnz(), size1(), size2(), sp(), and casadi::str().
Referenced by casadi::Sparsity::appendColumns().
Sparsity casadi::SparsityInternal::_appendVector | ( | const SparsityInternal & | sp | ) | const |
Definition at line 2556 of file sparsity_internal.cpp.
References get_row(), nnz(), size1(), size2(), sp(), and casadi::str().
Referenced by casadi::Sparsity::append().
Sparsity casadi::SparsityInternal::_enlargeColumns | ( | casadi_int | ncol, |
const std::vector< casadi_int > & | cc, | ||
bool | ind1 | ||
) | const |
Definition at line 2597 of file sparsity_internal.cpp.
References get_colind(), get_row(), casadi::has_negative(), nnz(), and size1().
Sparsity casadi::SparsityInternal::_enlargeRows | ( | casadi_int | nrow, |
const std::vector< casadi_int > & | rr, | ||
bool | ind1 | ||
) | const |
Definition at line 2637 of file sparsity_internal.cpp.
References get_colind(), get_row(), casadi::has_negative(), nnz(), size1(), and size2().
Sparsity casadi::SparsityInternal::_erase | ( | const std::vector< casadi_int > & | rr, |
bool | ind1, | ||
std::vector< casadi_int > & | mapping | ||
) | const |
Definition at line 1923 of file sparsity_internal.cpp.
References _erase(), get_colind(), get_row(), casadi::has_negative(), casadi::is_nondecreasing(), nnz(), numel(), casadi::range(), size1(), and size2().
Sparsity casadi::SparsityInternal::_erase | ( | const std::vector< casadi_int > & | rr, |
const std::vector< casadi_int > & | cc, | ||
bool | ind1, | ||
std::vector< casadi_int > & | mapping | ||
) | const |
Definition at line 2010 of file sparsity_internal.cpp.
References get_colind(), get_row(), casadi::has_negative(), casadi::is_nondecreasing(), nnz(), numel(), size1(), and size2().
Referenced by _erase().
Definition at line 1722 of file sparsity_internal.cpp.
References casadi::Sparsity::colind(), colind(), casadi::Sparsity::dense(), casadi::Sparsity::is_dense(), is_dense(), casadi::Sparsity::is_diag(), is_diag(), casadi::Sparsity::is_empty(), is_empty(), is_scalar(), casadi::Sparsity::is_scalar(), casadi::Sparsity::row(), row(), casadi::Sparsity::size(), size(), size1(), casadi::Sparsity::size2(), and casadi::Sparsity::triplet().
Referenced by casadi::Sparsity::mtimes().
Sparsity casadi::SparsityInternal::_removeDuplicates | ( | std::vector< casadi_int > & | mapping | ) | const |
The same indices will be removed from the mapping vector, which must have the same length as the number of nonzeros
Extra doc: https://github.com/casadi/casadi/wiki/L_fm
Definition at line 2789 of file sparsity_internal.cpp.
References get_colind(), get_row(), nnz(), size1(), and size2().
Sparsity casadi::SparsityInternal::_reshape | ( | casadi_int | nrow, |
casadi_int | ncol | ||
) | const |
Definition at line 2706 of file sparsity_internal.cpp.
References colind(), dim(), nnz(), numel(), row(), size1(), size2(), casadi::str(), and casadi::Sparsity::triplet().
Referenced by casadi::Sparsity::reshape().
Sparsity casadi::SparsityInternal::_resize | ( | casadi_int | nrow, |
casadi_int | ncol | ||
) | const |
Definition at line 2739 of file sparsity_internal.cpp.
Sparsity casadi::SparsityInternal::_tril | ( | bool | includeDiagonal | ) | const |
Definition at line 3747 of file sparsity_internal.cpp.
References colind(), row(), size1(), and size2().
Referenced by casadi::Sparsity::tril().
Sparsity casadi::SparsityInternal::_triu | ( | bool | includeDiagonal | ) | const |
Definition at line 3765 of file sparsity_internal.cpp.
References colind(), row(), size1(), and size2().
Referenced by casadi::Sparsity::triu().
std::vector< casadi_int > casadi::SparsityInternal::amd | ( | ) | const |
The implementation is a modified version of cs_amd in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_en
Definition at line 660 of file sparsity_internal.cpp.
References colind(), get_colind(), casadi::get_ptr(), get_row(), is_symmetric(), nnz(), casadi::P, postorder_dfs(), row(), size2(), and wclear().
void casadi::SparsityInternal::augment | ( | casadi_int | k, |
std::vector< casadi_int > & | jmatch, | ||
casadi_int * | cheap, | ||
std::vector< casadi_int > & | w, | ||
casadi_int * | js, | ||
casadi_int * | is, | ||
casadi_int * | ps | ||
) | const |
The implementation is a modified version of cs_augment in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_f6
Definition at line 1080 of file sparsity_internal.cpp.
void casadi::SparsityInternal::bfs | ( | casadi_int | n, |
std::vector< casadi_int > & | wi, | ||
std::vector< casadi_int > & | wj, | ||
std::vector< casadi_int > & | queue, | ||
const std::vector< casadi_int > & | imatch, | ||
const std::vector< casadi_int > & | jmatch, | ||
casadi_int | mark | ||
) | const |
The implementation is a modified version of cs_bfs in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_ez
Definition at line 967 of file sparsity_internal.cpp.
References casadi::Sparsity::colind(), colind(), casadi::Sparsity::row(), row(), and T().
Referenced by dmperm().
const SparsityInternal::Btf & casadi::SparsityInternal::btf | ( | ) | const |
Definition at line 463 of file sparsity_internal.cpp.
Referenced by spsolve().
|
inline |
Definition at line 362 of file sparsity_internal.hpp.
References casadi::T.
casadi_int casadi::SparsityInternal::bw_lower | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_ff
Definition at line 3822 of file sparsity_internal.cpp.
casadi_int casadi::SparsityInternal::bw_upper | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_fe
Definition at line 3809 of file sparsity_internal.cpp.
|
inlineoverridevirtual |
Implements casadi::SharedObjectInternal.
Definition at line 709 of file sparsity_internal.hpp.
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_ei
Definition at line 105 of file sparsity_internal.hpp.
Referenced by _mtimes(), _reshape(), _resize(), _tril(), _triu(), amd(), augment(), bfs(), bw_lower(), bw_upper(), combineGen(), dfs(), drop(), drop_diag(), etree(), export_code(), find(), get_col(), get_colind(), get_diag(), get_lower(), get_nz(), get_upper(), has_diag(), hash(), is_diag(), is_equal(), is_reshape(), is_stacked(), is_transpose(), is_tril(), is_triu(), ldl_colind(), ldl_row(), makeDense(), maxtrans(), nnz_diag(), nnz_lower(), nnz_upper(), pattern_inverse(), permute(), qr_nnz(), qr_sparsities(), rowsSequential(), scatter(), SparsityInternal(), spsolve(), spy(), star_coloring(), star_coloring2(), sub(), and uni_coloring().
Sparsity casadi::SparsityInternal::combine | ( | const Sparsity & | y, |
bool | f0x_is_zero, | ||
bool | function0_is_zero | ||
) | const |
Union of two sparsity patterns
Definition at line 2320 of file sparsity_internal.cpp.
Sparsity casadi::SparsityInternal::combine | ( | const Sparsity & | y, |
bool | f0x_is_zero, | ||
bool | function0_is_zero, | ||
std::vector< unsigned char > & | mapping | ||
) | const |
Union of two sparsity patterns
Definition at line 2326 of file sparsity_internal.cpp.
Referenced by casadi::Sparsity::combine(), casadi::Sparsity::intersect(), and casadi::Sparsity::unite().
Sparsity casadi::SparsityInternal::combineGen | ( | const Sparsity & | y, |
std::vector< unsigned char > & | mapping | ||
) | const |
Union of two sparsity patterns
Definition at line 2370 of file sparsity_internal.cpp.
References casadi::Sparsity::colind(), colind(), casadi::Sparsity::row(), row(), casadi::Sparsity::size(), size(), casadi::Sparsity::size1(), size1(), casadi::Sparsity::size2(), size2(), and casadi::str().
Sparsity casadi::SparsityInternal::combineGen1 | ( | const Sparsity & | y, |
bool | f0x_is_zero, | ||
bool | function0_is_zero, | ||
std::vector< unsigned char > & | mapping | ||
) | const |
Union of two sparsity patterns
Definition at line 2343 of file sparsity_internal.cpp.
References is_equal(), casadi::Sparsity::nnz(), and casadi::Sparsity::resize().
|
inherited |
Definition at line 62 of file generic_shared_internal.hpp.
|
inlineprotectedinherited |
Called in the destructor of singletons
Definition at line 77 of file generic_shared_internal.hpp.
casadi_int casadi::SparsityInternal::dfs | ( | casadi_int | j, |
casadi_int | top, | ||
std::vector< casadi_int > & | xi, | ||
std::vector< casadi_int > & | pstack, | ||
const std::vector< casadi_int > & | pinv, | ||
std::vector< bool > & | marked | ||
) | const |
The implementation is a modified version of cs_dfs in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_el
Definition at line 518 of file sparsity_internal.cpp.
References colind(), and row().
Referenced by scc().
|
static |
The implementation is a modified version of cs_diag in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_fb
Definition at line 1540 of file sparsity_internal.cpp.
std::string casadi::SparsityInternal::dim | ( | bool | with_nz = false | ) | const |
Definition at line 1703 of file sparsity_internal.cpp.
References nnz(), size1(), size2(), and casadi::str().
Referenced by _reshape(), disp(), star_coloring(), and star_coloring2().
|
overridevirtual |
Implements casadi::SharedObjectInternal.
Definition at line 481 of file sparsity_internal.cpp.
References dim(), get_colind(), get_row(), and is_dense().
void casadi::SparsityInternal::dmperm | ( | std::vector< casadi_int > & | rowperm, |
std::vector< casadi_int > & | colperm, | ||
std::vector< casadi_int > & | rowblock, | ||
std::vector< casadi_int > & | colblock, | ||
std::vector< casadi_int > & | coarse_rowblock, | ||
std::vector< casadi_int > & | coarse_colblock | ||
) | const |
The implementation is a modified version of cs_dmperm in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_f4
Definition at line 1244 of file sparsity_internal.cpp.
References bfs(), casadi::C, drop(), invertPermutation(), matched(), maxtrans(), permute(), casadi::Sparsity::resize(), rprune(), size1(), size2(), and unmatched().
|
static |
The implementation is a modified version of cs_fkeep in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_f3
Definition at line 1496 of file sparsity_internal.cpp.
References colind(), and row().
Referenced by dmperm().
Sparsity casadi::SparsityInternal::drop_diag | ( | ) | const |
Definition at line 1683 of file sparsity_internal.cpp.
|
static |
len[w] >= ata ? ncol + nrow : ncol len[parent] == ncol Ref: Chapter 4, Direct Methods for Sparse Linear Systems by Tim Davis Modified version of cs_etree in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_eo
Definition at line 35 of file sparsity_internal.cpp.
References colind(), row(), and sp().
Referenced by casadi::Sparsity::etree(), and qr_init().
void casadi::SparsityInternal::export_code | ( | const std::string & | lang, |
std::ostream & | stream, | ||
const Dict & | options | ||
) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_fr
Definition at line 3607 of file sparsity_internal.cpp.
References colind(), nnz(), row(), size1(), and size2().
Referenced by spy_matlab().
void casadi::SparsityInternal::find | ( | std::vector< casadi_int > & | loc, |
bool | ind1 | ||
) | const |
Definition at line 2840 of file sparsity_internal.cpp.
References colind(), is_dense(), std::mul_overflows(), nnz(), numel(), casadi::range(), row(), size1(), and size2().
std::vector< casadi_int > casadi::SparsityInternal::get_col | ( | ) | const |
Definition at line 490 of file sparsity_internal.cpp.
References colind(), nnz(), and size2().
Referenced by pmult(), repr_el(), and transpose().
std::vector< casadi_int > casadi::SparsityInternal::get_colind | ( | ) | const |
Definition at line 3835 of file sparsity_internal.cpp.
References colind(), and size2().
Referenced by _appendColumns(), _enlargeColumns(), _enlargeRows(), _erase(), _removeDuplicates(), amd(), disp(), largest_first(), pattern_inverse(), and spy().
Sparsity casadi::SparsityInternal::get_diag | ( | std::vector< casadi_int > & | mapping | ) | const |
[out] | mapping | will contain the nonzero mapping |
Extra doc: https://github.com/casadi/casadi/wiki/L_ek
Definition at line 1619 of file sparsity_internal.cpp.
References colind(), is_vector(), row(), size1(), and size2().
Referenced by casadi::Sparsity::get_diag().
std::vector< casadi_int > casadi::SparsityInternal::get_lower | ( | ) | const |
Definition at line 3783 of file sparsity_internal.cpp.
casadi_int casadi::SparsityInternal::get_nz | ( | casadi_int | rr, |
casadi_int | cc | ||
) | const |
Definition at line 2676 of file sparsity_internal.cpp.
References colind(), is_dense(), nnz(), row(), size1(), size2(), and casadi::str().
std::vector< casadi_int > casadi::SparsityInternal::get_nz | ( | const std::vector< casadi_int > & | rr, |
const std::vector< casadi_int > & | cc | ||
) | const |
Definition at line 2118 of file sparsity_internal.cpp.
References colind(), row(), size1(), size2(), and casadi::sort().
void casadi::SparsityInternal::get_nz | ( | std::vector< casadi_int > & | indices | ) | const |
Definition at line 2867 of file sparsity_internal.cpp.
References colind(), get_nz(), is_dense(), row(), size1(), size2(), and casadi::sort().
std::vector< casadi_int > casadi::SparsityInternal::get_row | ( | ) | const |
Definition at line 3840 of file sparsity_internal.cpp.
Referenced by _appendColumns(), _appendVector(), _enlargeColumns(), _enlargeRows(), _erase(), _removeDuplicates(), amd(), disp(), and transpose().
std::vector< casadi_int > casadi::SparsityInternal::get_upper | ( | ) | const |
Definition at line 3797 of file sparsity_internal.cpp.
|
inherited |
Definition at line 60 of file generic_shared_internal.hpp.
bool casadi::SparsityInternal::has_diag | ( | ) | const |
Definition at line 1670 of file sparsity_internal.cpp.
std::size_t casadi::SparsityInternal::hash | ( | ) | const |
Definition at line 3711 of file sparsity_internal.cpp.
References colind(), casadi::hash_sparsity(), row(), size1(), and size2().
|
inlineprotectedinherited |
Called in the constructor of singletons to avoid that the counter reaches zero
Definition at line 71 of file generic_shared_internal.hpp.
|
static |
Extra doc: https://github.com/casadi/casadi/wiki/L_f8
Definition at line 1450 of file sparsity_internal.cpp.
Referenced by dmperm().
bool casadi::SparsityInternal::is_column | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_fi
Definition at line 1793 of file sparsity_internal.cpp.
References size2().
Referenced by is_vector().
bool casadi::SparsityInternal::is_dense | ( | ) | const |
Definition at line 1785 of file sparsity_internal.cpp.
References nnz(), and numel().
Referenced by _mtimes(), disp(), find(), get_nz(), is_reshape(), is_transpose(), and pattern_inverse().
bool casadi::SparsityInternal::is_diag | ( | ) | const |
bool casadi::SparsityInternal::is_empty | ( | bool | both = false | ) | const |
A sparsity is considered empty if one of the dimensions is zero (or optionally both dimensions)
Extra doc: https://github.com/casadi/casadi/wiki/L_fg
Definition at line 1801 of file sparsity_internal.cpp.
References size1(), and size2().
Referenced by _mtimes(), and pattern_inverse().
bool casadi::SparsityInternal::is_equal | ( | casadi_int | y_nrow, |
casadi_int | y_ncol, | ||
const casadi_int * | y_colind, | ||
const casadi_int * | y_row | ||
) | const |
bool casadi::SparsityInternal::is_equal | ( | casadi_int | y_nrow, |
casadi_int | y_ncol, | ||
const std::vector< casadi_int > & | y_colind, | ||
const std::vector< casadi_int > & | y_row | ||
) | const |
Definition at line 2524 of file sparsity_internal.cpp.
References casadi::get_ptr(), and is_equal().
bool casadi::SparsityInternal::is_equal | ( | const Sparsity & | y | ) | const |
Definition at line 2474 of file sparsity_internal.cpp.
References casadi::Sparsity::colind(), casadi::Sparsity::get(), casadi::Sparsity::row(), casadi::Sparsity::size1(), and casadi::Sparsity::size2().
Referenced by combineGen1(), is_equal(), is_reshape(), is_stacked(), and is_subset().
bool casadi::SparsityInternal::is_orthonormal | ( | bool | allow_empty = false | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_25x
Definition at line 1843 of file sparsity_internal.cpp.
References is_square(), nnz(), size1(), and sp().
Referenced by is_permutation().
bool casadi::SparsityInternal::is_orthonormal_columns | ( | bool | allow_empty = false | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_25z
Definition at line 1867 of file sparsity_internal.cpp.
bool casadi::SparsityInternal::is_orthonormal_rows | ( | bool | allow_empty = false | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_25y
Definition at line 1855 of file sparsity_internal.cpp.
References nnz(), size1(), size2(), and sp().
Referenced by is_selection().
bool casadi::SparsityInternal::is_permutation | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_25v
Definition at line 1839 of file sparsity_internal.cpp.
References is_orthonormal().
bool casadi::SparsityInternal::is_reshape | ( | const SparsityInternal & | y | ) | const |
Definition at line 3542 of file sparsity_internal.cpp.
References colind(), is_dense(), is_equal(), nnz(), numel(), row(), size1(), and size2().
bool casadi::SparsityInternal::is_row | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_fh
Definition at line 1789 of file sparsity_internal.cpp.
References size1().
Referenced by is_vector().
bool casadi::SparsityInternal::is_scalar | ( | bool | scalar_and_dense | ) | const |
bool casadi::SparsityInternal::is_selection | ( | bool | allow_empty = false | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_25w
Definition at line 1879 of file sparsity_internal.cpp.
References is_orthonormal_rows().
bool casadi::SparsityInternal::is_square | ( | ) | const |
Definition at line 1831 of file sparsity_internal.cpp.
References size1(), and size2().
Referenced by is_orthonormal(), star_coloring(), and star_coloring2().
bool casadi::SparsityInternal::is_stacked | ( | const Sparsity & | y, |
casadi_int | n | ||
) | const |
Definition at line 2438 of file sparsity_internal.cpp.
References casadi::Sparsity::colind(), colind(), is_equal(), nnz(), casadi::Sparsity::row(), row(), casadi::Sparsity::size1(), size1(), casadi::Sparsity::size2(), and size2().
bool casadi::SparsityInternal::is_subset | ( | const Sparsity & | rhs | ) | const |
bool casadi::SparsityInternal::is_symmetric | ( | ) | const |
Definition at line 1835 of file sparsity_internal.cpp.
References is_transpose().
Referenced by amd().
bool casadi::SparsityInternal::is_transpose | ( | const SparsityInternal & | y | ) | const |
Definition at line 3496 of file sparsity_internal.cpp.
References colind(), is_dense(), is_transpose(), nnz(), row(), size1(), and size2().
Referenced by is_symmetric(), and is_transpose().
bool casadi::SparsityInternal::is_tril | ( | bool | strictly | ) | const |
Definition at line 3715 of file sparsity_internal.cpp.
bool casadi::SparsityInternal::is_triu | ( | bool | strictly | ) | const |
Definition at line 3731 of file sparsity_internal.cpp.
bool casadi::SparsityInternal::is_vector | ( | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_fj
Definition at line 1797 of file sparsity_internal.cpp.
References is_column(), and is_row().
Referenced by get_diag().
std::vector< casadi_int > casadi::SparsityInternal::largest_first | ( | ) | const |
Definition at line 3406 of file sparsity_internal.cpp.
References get_colind(), and size2().
Referenced by star_coloring(), and star_coloring2().
|
static |
Strictly lower entries only. Ref: User Guide for LDL by Tim Davis len[colind] = ncol+1 len[parent] = ncol len[w] >= ncol Modified version of LDL Copyright(c) Timothy A. Davis, 2005-2013 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_ew
Definition at line 377 of file sparsity_internal.cpp.
References colind(), row(), and sp().
Referenced by casadi::Sparsity::ldl().
|
static |
Strictly lower entries only. Ref: User Guide for LDL by Tim Davis len[w] >= n Modified version of LDL Copyright(c) Timothy A. Davis, 2005-2013 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_ex
Definition at line 412 of file sparsity_internal.cpp.
References colind(), row(), and sp().
Referenced by casadi::Sparsity::ldl().
|
static |
Ref: Chapter 4, Direct Methods for Sparse Linear Systems by Tim Davis Modified version of cs_leaf in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_er
Definition at line 127 of file sparsity_internal.cpp.
Referenced by qr_counts().
Sparsity casadi::SparsityInternal::makeDense | ( | std::vector< casadi_int > & | mapping | ) | const |
Definition at line 2662 of file sparsity_internal.cpp.
References colind(), casadi::Sparsity::dense(), nnz(), row(), size1(), and size2().
Referenced by casadi::Sparsity::makeDense().
|
static |
The implementation is a modified version of cs_matched in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_f0
Definition at line 1032 of file sparsity_internal.cpp.
Referenced by dmperm().
void casadi::SparsityInternal::maxtrans | ( | std::vector< casadi_int > & | imatch, |
std::vector< casadi_int > & | jmatch, | ||
Sparsity & | trans, | ||
casadi_int | seed | ||
) | const |
The implementation is a modified version of cs_maxtrans in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_f5
Definition at line 1154 of file sparsity_internal.cpp.
References casadi::C, colind(), casadi::Sparsity::get(), casadi::GenericShared< Shared, Internal >::is_null(), randperm(), row(), size1(), size2(), and T().
Referenced by dmperm().
The implementation is a modified version of cs_multiply in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_fc
Definition at line 1575 of file sparsity_internal.cpp.
References casadi::Sparsity::colind(), nnz(), casadi::Sparsity::row(), scatter(), casadi::Sparsity::size1(), size1(), casadi::Sparsity::size2(), and size2().
|
inline |
Definition at line 113 of file sparsity_internal.hpp.
Referenced by _appendColumns(), _appendVector(), _enlargeColumns(), _enlargeRows(), _erase(), _removeDuplicates(), _reshape(), amd(), dim(), drop_diag(), export_code(), find(), get_col(), get_nz(), get_row(), is_dense(), is_diag(), is_equal(), is_orthonormal(), is_orthonormal_columns(), is_orthonormal_rows(), is_reshape(), is_scalar(), is_stacked(), is_transpose(), makeDense(), multiply(), nnz_diag(), nnz_lower(), nnz_upper(), permute(), pmult(), repr_el(), star_coloring2(), and sub().
casadi_int casadi::SparsityInternal::nnz_diag | ( | ) | const |
Definition at line 1895 of file sparsity_internal.cpp.
casadi_int casadi::SparsityInternal::nnz_lower | ( | bool | strictly = false | ) | const |
Definition at line 1883 of file sparsity_internal.cpp.
casadi_int casadi::SparsityInternal::nnz_upper | ( | bool | strictly = false | ) | const |
Definition at line 1907 of file sparsity_internal.cpp.
References colind(), nnz(), row(), and size2().
Referenced by star_coloring2().
casadi_int casadi::SparsityInternal::numel | ( | ) | const |
Definition at line 477 of file sparsity_internal.cpp.
References size1(), and size2().
Referenced by _erase(), _reshape(), find(), is_dense(), is_equal(), is_reshape(), repr_el(), and sub().
Sparsity casadi::SparsityInternal::pattern_inverse | ( | ) | const |
Definition at line 2482 of file sparsity_internal.cpp.
References colind(), casadi::Sparsity::dense(), get_colind(), is_dense(), is_empty(), row(), size1(), and size2().
Referenced by casadi::Sparsity::pattern_inverse().
Sparsity casadi::SparsityInternal::permute | ( | const std::vector< casadi_int > & | pinv, |
const std::vector< casadi_int > & | q, | ||
casadi_int | values | ||
) | const |
void casadi::SparsityInternal::permute | ( | const std::vector< casadi_int > & | pinv, |
const std::vector< casadi_int > & | q, | ||
casadi_int | values, | ||
std::vector< casadi_int > & | colind_C, | ||
std::vector< casadi_int > & | row_C | ||
) | const |
The implementation is a modified version of cs_permute in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_f9
Definition at line 1463 of file sparsity_internal.cpp.
Sparsity casadi::SparsityInternal::pmult | ( | const std::vector< casadi_int > & | p, |
bool | permute_rows = true , |
||
bool | permute_cols = true , |
||
bool | invert_permutation = false |
||
) | const |
Definition at line 3441 of file sparsity_internal.cpp.
References get_col(), casadi::invert_permutation(), nnz(), casadi::Sparsity::resize(), row(), size1(), size2(), and casadi::Sparsity::triplet().
Referenced by casadi::Sparsity::pmult(), star_coloring(), and star_coloring2().
|
static |
Ref: Chapter 4, Direct Methods for Sparse Linear Systems by Tim Davis len[w] >= 3*n len[post] == n Modified version of cs_post in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_eq
Definition at line 99 of file sparsity_internal.cpp.
References postorder_dfs().
Referenced by qr_init().
|
static |
Ref: Chapter 4, Direct Methods for Sparse Linear Systems by Tim Davis Modified version of cs_tdfs in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_ep
Definition at line 74 of file sparsity_internal.cpp.
Referenced by amd(), and postorder().
|
static |
Ref: Chapter 4, Direct Methods for Sparse Linear Systems by Tim Davis len[counts] = ncol len[w] >= 5*ncol + nrow + 1 Modified version of cs_counts in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_es
Definition at line 157 of file sparsity_internal.cpp.
References leaf().
Referenced by qr_init().
|
static |
Ref: Chapter 5, Direct Methods for Sparse Linear Systems by Tim Davis len[w] >= nrow + 7*ncol + 1 len[pinv] == nrow + ncol len[leftmost] == nrow
Extra doc: https://github.com/casadi/casadi/wiki/L_eu
Definition at line 288 of file sparsity_internal.cpp.
References etree(), postorder(), qr_counts(), qr_nnz(), and sp().
Referenced by casadi::Sparsity::qr_sparse().
|
static |
Ref: Chapter 5, Direct Methods for Sparse Linear Systems by Tim Davis len[w] >= nrow + 3*ncol len[pinv] == nrow + ncol len[leftmost] == nrow Modified version of cs_sqr in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_et
Definition at line 227 of file sparsity_internal.cpp.
References colind(), row(), and sp().
Referenced by qr_init().
|
static |
Ref: Chapter 5, Direct Methods for Sparse Linear Systems by Tim Davis Note: nrow <= nrow_ext <= nrow+ncol len[iw] = nrow_ext + ncol len[x] = nrow_ext sp_v = [nrow_ext, ncol, 0, 0, ...] len[3 + ncol + nnz_v] len[v] nnz_v sp_r = [nrow_ext, ncol, 0, 0, ...] len[3 + ncol + nnz_r] len[r] nnz_r len[beta] ncol Modified version of cs_qr in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_ev
Definition at line 305 of file sparsity_internal.cpp.
References colind(), and row().
Referenced by casadi::Sparsity::qr_sparse().
|
static |
return a random permutation vector, the identity perm, or p = n-1:-1:0. seed = -1 means p = n-1:-1:0. seed = 0 means p = identity. The implementation is a modified version of cs_randperm in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_f7
Definition at line 1408 of file sparsity_internal.cpp.
Referenced by maxtrans().
std::string casadi::SparsityInternal::repr_el | ( | casadi_int | k | ) | const |
Definition at line 1709 of file sparsity_internal.cpp.
References get_col(), nnz(), numel(), row(), and casadi::GlobalOptions::start_index.
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_ej
Definition at line 110 of file sparsity_internal.hpp.
Referenced by _mtimes(), _reshape(), _resize(), _tril(), _triu(), amd(), augment(), bfs(), bw_lower(), bw_upper(), combineGen(), dfs(), drop(), drop_diag(), etree(), export_code(), find(), get_diag(), get_lower(), get_nz(), get_row(), get_upper(), has_diag(), hash(), is_diag(), is_equal(), is_reshape(), is_stacked(), is_transpose(), is_tril(), is_triu(), ldl_colind(), ldl_row(), makeDense(), maxtrans(), nnz_diag(), nnz_lower(), nnz_upper(), pattern_inverse(), permute(), pmult(), qr_nnz(), qr_sparsities(), repr_el(), rowsSequential(), scatter(), SparsityInternal(), spsolve(), spy(), star_coloring(), star_coloring2(), sub(), and uni_coloring().
bool casadi::SparsityInternal::rowsSequential | ( | bool | strictly | ) | const |
Definition at line 2765 of file sparsity_internal.cpp.
|
static |
The implementation is a modified version of cs_rprune in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_f2
Definition at line 1070 of file sparsity_internal.cpp.
Referenced by dmperm().
casadi_int casadi::SparsityInternal::scatter | ( | casadi_int | j, |
std::vector< casadi_int > & | w, | ||
casadi_int | mark, | ||
casadi_int * | Ci, | ||
casadi_int | nz | ||
) | const |
The implementation is a modified version of cs_scatter in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_fd
Definition at line 1549 of file sparsity_internal.cpp.
References colind(), and row().
Referenced by multiply().
casadi_int casadi::SparsityInternal::scc | ( | std::vector< casadi_int > & | p, |
std::vector< casadi_int > & | r | ||
) | const |
The implementation is a modified version of cs_scc in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_em
Definition at line 583 of file sparsity_internal.cpp.
References casadi::Sparsity::dfs(), dfs(), size2(), and T().
|
inlineprotectedinherited |
Definition at line 83 of file generic_shared_internal.hpp.
|
inlineprotectedinherited |
Definition at line 92 of file generic_shared_internal.hpp.
std::pair< casadi_int, casadi_int > casadi::SparsityInternal::size | ( | ) | const |
Definition at line 1919 of file sparsity_internal.cpp.
References size1(), and size2().
Referenced by _mtimes(), and combineGen().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_eg
Definition at line 95 of file sparsity_internal.hpp.
Referenced by _appendColumns(), _appendVector(), _enlargeColumns(), _enlargeRows(), _erase(), _mtimes(), _removeDuplicates(), _reshape(), _tril(), _triu(), combineGen(), dim(), dmperm(), drop_diag(), export_code(), find(), get_diag(), get_nz(), has_diag(), hash(), is_diag(), is_empty(), is_equal(), is_orthonormal(), is_orthonormal_columns(), is_orthonormal_rows(), is_reshape(), is_row(), is_scalar(), is_square(), is_stacked(), is_transpose(), makeDense(), maxtrans(), multiply(), numel(), pattern_inverse(), permute(), pmult(), size(), spy(), sub(), and transpose().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_eh
Definition at line 100 of file sparsity_internal.hpp.
Referenced by _appendColumns(), _appendVector(), _enlargeRows(), _erase(), _removeDuplicates(), _reshape(), _resize(), _tril(), _triu(), amd(), bw_lower(), bw_upper(), combineGen(), dim(), dmperm(), drop_diag(), export_code(), find(), get_col(), get_colind(), get_diag(), get_lower(), get_nz(), get_upper(), has_diag(), hash(), is_column(), is_diag(), is_empty(), is_equal(), is_orthonormal_columns(), is_orthonormal_rows(), is_reshape(), is_scalar(), is_square(), is_stacked(), is_transpose(), is_tril(), is_triu(), largest_first(), makeDense(), maxtrans(), multiply(), nnz_diag(), nnz_lower(), nnz_upper(), numel(), pattern_inverse(), permute(), pmult(), rowsSequential(), scc(), size(), spy(), star_coloring(), star_coloring2(), sub(), transpose(), and uni_coloring().
|
inline |
Extra doc: https://github.com/casadi/casadi/wiki/L_ef
Definition at line 90 of file sparsity_internal.hpp.
Referenced by _appendColumns(), _appendVector(), etree(), is_orthonormal(), is_orthonormal_columns(), is_orthonormal_rows(), ldl_colind(), ldl_row(), qr_init(), qr_nnz(), and sub().
Definition at line 3845 of file sparsity_internal.cpp.
void casadi::SparsityInternal::spy | ( | std::ostream & | stream | ) | const |
Extra doc: https://github.com/casadi/casadi/wiki/L_fq
Definition at line 3581 of file sparsity_internal.cpp.
References colind(), get_colind(), row(), size1(), and size2().
void casadi::SparsityInternal::spy_matlab | ( | const std::string & | mfile | ) | const |
Definition at line 3693 of file sparsity_internal.cpp.
References export_code().
Sparsity casadi::SparsityInternal::star_coloring | ( | casadi_int | ordering, |
casadi_int | cutoff | ||
) | const |
See description in public class.
Extra doc: https://github.com/casadi/casadi/wiki/L_fo
Definition at line 3293 of file sparsity_internal.cpp.
References colind(), dim(), is_square(), largest_first(), pmult(), casadi::Sparsity::pmult(), casadi::range(), row(), size2(), casadi::Sparsity::star_coloring(), and casadi::Sparsity::triplet().
Referenced by casadi::Sparsity::star_coloring().
Sparsity casadi::SparsityInternal::star_coloring2 | ( | casadi_int | ordering, |
casadi_int | cutoff | ||
) | const |
See description in public class.
Extra doc: https://github.com/casadi/casadi/wiki/L_fp
Definition at line 3040 of file sparsity_internal.cpp.
References colind(), dim(), is_square(), largest_first(), nnz(), nnz_upper(), pmult(), casadi::Sparsity::pmult(), row(), size2(), casadi::Sparsity::star_coloring2(), and transpose().
Referenced by casadi::Sparsity::star_coloring2().
Sparsity casadi::SparsityInternal::sub | ( | const std::vector< casadi_int > & | rr, |
const SparsityInternal & | sp, | ||
std::vector< casadi_int > & | mapping, | ||
bool | ind1 | ||
) | const |
Does bounds checking rr is not required to be monotonous
Extra doc: https://github.com/casadi/casadi/wiki/L_fl
Definition at line 2152 of file sparsity_internal.cpp.
References get_nz(), casadi::has_negative(), numel(), sp(), casadi::str(), and sub().
Sparsity casadi::SparsityInternal::sub | ( | const std::vector< casadi_int > & | rr, |
const std::vector< casadi_int > & | cc, | ||
std::vector< casadi_int > & | mapping, | ||
bool | ind1 | ||
) | const |
Does bounds checking rr and rr are not required to be monotonous
Extra doc: https://github.com/casadi/casadi/wiki/L_fk
Definition at line 2196 of file sparsity_internal.cpp.
References colind(), casadi::lookupvector(), nnz(), row(), size1(), size2(), casadi::sort(), and casadi::Sparsity::triplet().
Referenced by casadi::Sparsity::sub(), and sub().
Sparsity casadi::SparsityInternal::T | ( | ) | const |
Definition at line 501 of file sparsity_internal.cpp.
References transpose().
Referenced by bfs(), maxtrans(), scc(), and casadi::Sparsity::T().
Sparsity casadi::SparsityInternal::transpose | ( | std::vector< casadi_int > & | mapping, |
bool | invert_mapping = false |
||
) | const |
[out] | mapping | the non-zeros of the original matrix for each non-zero of the new matrix |
Extra doc: https://github.com/casadi/casadi/wiki/L_ey
Definition at line 508 of file sparsity_internal.cpp.
References get_col(), get_row(), size1(), size2(), and casadi::Sparsity::triplet().
Referenced by star_coloring2(), T(), and casadi::Sparsity::transpose().
A greedy distance-2 coloring algorithm (Algorithm 3.1 in A. H. GEBREMEDHIN, F. MANNE, A. POTHEN)
Extra doc: https://github.com/casadi/casadi/wiki/L_fn
Definition at line 2951 of file sparsity_internal.cpp.
References casadi::Sparsity::colind(), colind(), casadi::Sparsity::row(), row(), and size2().
Referenced by casadi::Sparsity::uni_coloring().
|
static |
The implementation is a modified version of cs_unmatched in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_f1
Definition at line 1055 of file sparsity_internal.cpp.
Referenced by dmperm().
|
static |
The implementation is a modified version of cs_wclear in CSparse Copyright(c) Timothy A. Davis, 2006-2009 Licensed as a derivative work under the GNU LGPL
Extra doc: https://github.com/casadi/casadi/wiki/L_fa
Definition at line 1525 of file sparsity_internal.cpp.
Referenced by amd().
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_1ai
Definition at line 67 of file generic_shared_internal.hpp.