GammaLib
2.1.0.dev
|
Sparse matrix symbolic analysis class. More...
#include <GSparseSymbolic.hpp>
Public Member Functions | |
GSparseSymbolic (void) | |
Void constructor. More... | |
virtual | ~GSparseSymbolic (void) |
Destructor. More... | |
GSparseSymbolic & | operator= (const GSparseSymbolic &s) |
void | cholesky_symbolic_analysis (int order, const GMatrixSparse &m) |
Private Member Functions | |
int * | cs_amd (int order, const GMatrixSparse *A) |
int * | cs_counts (const GMatrixSparse *A, const int *parent, const int *post, int ata) |
int * | cs_etree (const GMatrixSparse *A, int ata) |
int | cs_fkeep (GMatrixSparse *A, int(*fkeep)(int, int, double, void *), void *other) |
cs_fkeep More... | |
int | cs_leaf (int i, int j, const int *first, int *maxfirst, int *prevleaf, int *ancestor, int *jleaf) |
int * | cs_pinv (int const *p, int n) |
int * | cs_post (const int *parent, int n) |
int | cs_tdfs (int j, int k, int *head, const int *next, int *post, int *stack) |
Static Private Member Functions | |
static void | init_ata (const GMatrixSparse *AT, const int *post, int *wrk_int, int **head, int **next) |
static int | cs_diag (int i, int j, double aij, void *other) |
static int | cs_wclear (int mark, int lemax, int *w, int n) |
Private Attributes | |
int * | m_pinv |
Inverse row permutation for QR, fill reduce permutation for Cholesky. More... | |
int * | m_q |
Fill-reducing column permutation for LU and QR. More... | |
int * | m_parent |
elimination tree for Cholesky and QR More... | |
int * | m_cp |
column pointers for Cholesky, row counts for QR More... | |
int * | m_leftmost |
leftmost[i] = min(find(A(i,:))), for QR More... | |
int | m_m2 |
of rows for QR, after adding fictitious rowsMore... | |
double | m_lnz |
entries in L for LU or Cholesky; in V for QRMore... | |
double | m_unz |
entries in U for LU; in R for QRMore... | |
int | m_n_pinv |
Number of elements in m_pinv. More... | |
int | m_n_q |
Number of elements in m_q. More... | |
int | m_n_parent |
Number of elements in m_parent. More... | |
int | m_n_cp |
Number of elements in m_cp. More... | |
int | m_n_leftmost |
Number of elements in m_leftmost. More... | |
Friends | |
class | GMatrixSparse |
class | GSparseNumeric |
std::ostream & | operator<< (std::ostream &os, const GSparseSymbolic &s) |
Sparse matrix symbolic analysis class.
This class implements the symbolic analysis of a sparse matrix.
Definition at line 51 of file GSparseSymbolic.hpp.
GSparseSymbolic::GSparseSymbolic | ( | void | ) |
Void constructor.
Definition at line 62 of file GSparseSymbolic.cpp.
References m_cp, m_leftmost, m_lnz, m_m2, m_n_cp, m_n_leftmost, m_n_parent, m_n_pinv, m_n_q, m_parent, m_pinv, m_q, and m_unz.
|
virtual |
Destructor.
Definition at line 87 of file GSparseSymbolic.cpp.
References m_cp, m_leftmost, m_parent, m_pinv, and m_q.
void GSparseSymbolic::cholesky_symbolic_analysis | ( | int | order, |
const GMatrixSparse & | m | ||
) |
Definition at line 209 of file GSparseSymbolic.cpp.
References cs_amd(), cs_counts(), cs_cumsum(), cs_etree(), cs_pinv(), cs_post(), cs_symperm(), G_CHOLESKY, GMatrixBase::m_cols, m_cp, GMatrixBase::m_elements, m_leftmost, m_lnz, m_m2, m_n_cp, m_n_leftmost, m_n_parent, m_n_pinv, m_n_q, m_parent, m_pinv, m_q, GMatrixBase::m_rows, m_unz, and gammalib::str().
Referenced by GMatrixSparse::cholesky_decompose().
|
private |
Definition at line 416 of file GSparseSymbolic.cpp.
References GMatrixSparse::alloc_elements(), cs_diag(), cs_fkeep(), CS_FLIP, CS_MAX, CS_MIN, cs_tdfs(), cs_transpose(), cs_wclear(), G_CS_AMD, GMatrixBase::m_cols, GMatrixBase::m_colstart, GMatrixBase::m_elements, GMatrixSparse::m_rowinx, GMatrixBase::m_rows, sqrt(), and gammalib::str().
Referenced by cholesky_symbolic_analysis().
|
private |
Definition at line 1030 of file GSparseSymbolic.cpp.
References cs_leaf(), cs_transpose(), HEAD, init_ata(), GMatrixBase::m_cols, GMatrixBase::m_colstart, GMatrixSparse::m_rowinx, GMatrixBase::m_rows, and NEXT.
Referenced by cholesky_symbolic_analysis().
|
staticprivate |
Definition at line 1566 of file GSparseSymbolic.cpp.
Referenced by cs_amd().
|
private |
Definition at line 1146 of file GSparseSymbolic.cpp.
References GMatrixBase::m_cols, GMatrixBase::m_colstart, GMatrixSparse::m_rowinx, and GMatrixBase::m_rows.
Referenced by cholesky_symbolic_analysis().
|
private |
cs_fkeep
[in] | A | Sparse matrix. |
[in] | fkeep | Screening function. |
[in] | other | Other function. |
Drop entries for which fkeep(A(i,j)) is false. Return the number of non-zero elements if ok, otherwise return -1.
Definition at line 1222 of file GSparseSymbolic.cpp.
References GMatrixSparse::free_elements(), GMatrixBase::m_cols, GMatrixBase::m_colstart, GMatrixBase::m_data, GMatrixBase::m_elements, and GMatrixSparse::m_rowinx.
Referenced by cs_amd().
|
private |
Definition at line 1286 of file GSparseSymbolic.cpp.
Referenced by cs_counts().
|
private |
Definition at line 1348 of file GSparseSymbolic.cpp.
Referenced by cholesky_symbolic_analysis().
|
private |
Definition at line 1378 of file GSparseSymbolic.cpp.
References cs_tdfs().
Referenced by cholesky_symbolic_analysis().
|
private |
Definition at line 1454 of file GSparseSymbolic.cpp.
|
staticprivate |
Definition at line 1583 of file GSparseSymbolic.cpp.
Referenced by cs_amd().
|
staticprivate |
Definition at line 1512 of file GSparseSymbolic.cpp.
References CS_MIN, GMatrixBase::m_cols, GMatrixBase::m_colstart, GMatrixSparse::m_rowinx, and GMatrixBase::m_rows.
Referenced by cs_counts().
GSparseSymbolic & GSparseSymbolic::operator= | ( | const GSparseSymbolic & | s | ) |
Definition at line 110 of file GSparseSymbolic.cpp.
References m_cp, m_leftmost, m_lnz, m_m2, m_n_cp, m_n_leftmost, m_n_parent, m_n_pinv, m_n_q, m_parent, m_pinv, m_q, and m_unz.
|
friend |
Definition at line 57 of file GSparseSymbolic.hpp.
|
friend |
Definition at line 58 of file GSparseSymbolic.hpp.
|
friend |
Definition at line 1609 of file GSparseSymbolic.cpp.
|
private |
column pointers for Cholesky, row counts for QR
Definition at line 89 of file GSparseSymbolic.hpp.
Referenced by GSparseNumeric::cholesky_numeric_analysis(), cholesky_symbolic_analysis(), GSparseSymbolic(), operator<<(), operator=(), and ~GSparseSymbolic().
|
private |
leftmost[i] = min(find(A(i,:))), for QR
Definition at line 90 of file GSparseSymbolic.hpp.
Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), operator<<(), operator=(), and ~GSparseSymbolic().
|
private |
Definition at line 92 of file GSparseSymbolic.hpp.
Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), and operator=().
|
private |
Definition at line 91 of file GSparseSymbolic.hpp.
Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), and operator=().
|
private |
Number of elements in m_cp.
Definition at line 97 of file GSparseSymbolic.hpp.
Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), operator<<(), and operator=().
|
private |
Number of elements in m_leftmost.
Definition at line 98 of file GSparseSymbolic.hpp.
Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), operator<<(), and operator=().
|
private |
Number of elements in m_parent.
Definition at line 96 of file GSparseSymbolic.hpp.
Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), operator<<(), and operator=().
|
private |
Number of elements in m_pinv.
Definition at line 94 of file GSparseSymbolic.hpp.
Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), operator<<(), and operator=().
|
private |
Number of elements in m_q.
Definition at line 95 of file GSparseSymbolic.hpp.
Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), and operator=().
|
private |
elimination tree for Cholesky and QR
Definition at line 88 of file GSparseSymbolic.hpp.
Referenced by GSparseNumeric::cholesky_numeric_analysis(), cholesky_symbolic_analysis(), GSparseSymbolic(), operator<<(), operator=(), and ~GSparseSymbolic().
|
private |
Inverse row permutation for QR, fill reduce permutation for Cholesky.
Definition at line 86 of file GSparseSymbolic.hpp.
Referenced by GSparseNumeric::cholesky_numeric_analysis(), GMatrixSparse::cholesky_solver(), cholesky_symbolic_analysis(), GSparseSymbolic(), operator<<(), operator=(), and ~GSparseSymbolic().
|
private |
Fill-reducing column permutation for LU and QR.
Definition at line 87 of file GSparseSymbolic.hpp.
Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), operator<<(), operator=(), and ~GSparseSymbolic().
|
private |
Definition at line 93 of file GSparseSymbolic.hpp.
Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), and operator=().