GammaLib 2.0.0
Loading...
Searching...
No Matches
GSparseSymbolic Class Reference

Sparse matrix symbolic analysis class. More...

#include <GSparseSymbolic.hpp>

Public Member Functions

 GSparseSymbolic (void)
 Void constructor.
 
virtual ~GSparseSymbolic (void)
 Destructor.
 
GSparseSymbolicoperator= (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
 
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.
 
int * m_q
 Fill-reducing column permutation for LU and QR.
 
int * m_parent
 elimination tree for Cholesky and QR
 
int * m_cp
 column pointers for Cholesky, row counts for QR
 
int * m_leftmost
 leftmost[i] = min(find(A(i,:))), for QR
 
int m_m2
 
double m_lnz
 
double m_unz
 
int m_n_pinv
 Number of elements in m_pinv.
 
int m_n_q
 Number of elements in m_q.
 
int m_n_parent
 Number of elements in m_parent.
 
int m_n_cp
 Number of elements in m_cp.
 
int m_n_leftmost
 Number of elements in m_leftmost.
 

Friends

class GMatrixSparse
 
class GSparseNumeric
 
std::ostream & operator<< (std::ostream &os, const GSparseSymbolic &s)
 

Detailed Description

Sparse matrix symbolic analysis class.

This class implements the symbolic analysis of a sparse matrix.

Definition at line 51 of file GSparseSymbolic.hpp.

Constructor & Destructor Documentation

◆ GSparseSymbolic()

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.

◆ ~GSparseSymbolic()

GSparseSymbolic::~GSparseSymbolic ( void )
virtual

Destructor.

Definition at line 87 of file GSparseSymbolic.cpp.

References m_cp, m_leftmost, m_parent, m_pinv, and m_q.

Member Function Documentation

◆ cholesky_symbolic_analysis()

◆ cs_amd()

◆ cs_counts()

int * GSparseSymbolic::cs_counts ( const GMatrixSparse * A,
const int * parent,
const int * post,
int ata )
private

◆ cs_diag()

int GSparseSymbolic::cs_diag ( int i,
int j,
double aij,
void * other )
staticprivate

Definition at line 1566 of file GSparseSymbolic.cpp.

Referenced by cs_amd().

◆ cs_etree()

int * GSparseSymbolic::cs_etree ( const GMatrixSparse * A,
int ata )
private

◆ cs_fkeep()

int GSparseSymbolic::cs_fkeep ( GMatrixSparse * A,
int(* fkeep )(int, int, double, void *),
void * other )
private

cs_fkeep

Parameters
[in]ASparse matrix.
[in]fkeepScreening function.
[in]otherOther function.
Returns
Number of non-zero elements (-1 if not okay)

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().

◆ cs_leaf()

int GSparseSymbolic::cs_leaf ( int i,
int j,
const int * first,
int * maxfirst,
int * prevleaf,
int * ancestor,
int * jleaf )
private

Definition at line 1286 of file GSparseSymbolic.cpp.

Referenced by cs_counts().

◆ cs_pinv()

int * GSparseSymbolic::cs_pinv ( int const * p,
int n )
private

Definition at line 1348 of file GSparseSymbolic.cpp.

Referenced by cholesky_symbolic_analysis().

◆ cs_post()

int * GSparseSymbolic::cs_post ( const int * parent,
int n )
private

Definition at line 1378 of file GSparseSymbolic.cpp.

References cs_tdfs().

Referenced by cholesky_symbolic_analysis().

◆ cs_tdfs()

int GSparseSymbolic::cs_tdfs ( int j,
int k,
int * head,
const int * next,
int * post,
int * stack )
private

Definition at line 1454 of file GSparseSymbolic.cpp.

Referenced by cs_amd(), and cs_post().

◆ cs_wclear()

int GSparseSymbolic::cs_wclear ( int mark,
int lemax,
int * w,
int n )
staticprivate

Definition at line 1583 of file GSparseSymbolic.cpp.

Referenced by cs_amd().

◆ init_ata()

void GSparseSymbolic::init_ata ( const GMatrixSparse * AT,
const int * post,
int * wrk_int,
int ** head,
int ** next )
staticprivate

◆ operator=()

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.

Friends And Related Symbol Documentation

◆ GMatrixSparse

friend class GMatrixSparse
friend

Definition at line 57 of file GSparseSymbolic.hpp.

◆ GSparseNumeric

friend class GSparseNumeric
friend

Definition at line 58 of file GSparseSymbolic.hpp.

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const GSparseSymbolic & s )
friend

Definition at line 1609 of file GSparseSymbolic.cpp.

Member Data Documentation

◆ m_cp

int* GSparseSymbolic::m_cp
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=(), and ~GSparseSymbolic().

◆ m_leftmost

int* GSparseSymbolic::m_leftmost
private

leftmost[i] = min(find(A(i,:))), for QR

Definition at line 90 of file GSparseSymbolic.hpp.

Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), operator=(), and ~GSparseSymbolic().

◆ m_lnz

double GSparseSymbolic::m_lnz
private

entries in L for LU or Cholesky; in V for QR

Definition at line 92 of file GSparseSymbolic.hpp.

Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), and operator=().

◆ m_m2

int GSparseSymbolic::m_m2
private

of rows for QR, after adding fictitious rows

Definition at line 91 of file GSparseSymbolic.hpp.

Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), and operator=().

◆ m_n_cp

int GSparseSymbolic::m_n_cp
private

Number of elements in m_cp.

Definition at line 97 of file GSparseSymbolic.hpp.

Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), and operator=().

◆ m_n_leftmost

int GSparseSymbolic::m_n_leftmost
private

Number of elements in m_leftmost.

Definition at line 98 of file GSparseSymbolic.hpp.

Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), and operator=().

◆ m_n_parent

int GSparseSymbolic::m_n_parent
private

Number of elements in m_parent.

Definition at line 96 of file GSparseSymbolic.hpp.

Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), and operator=().

◆ m_n_pinv

int GSparseSymbolic::m_n_pinv
private

Number of elements in m_pinv.

Definition at line 94 of file GSparseSymbolic.hpp.

Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), and operator=().

◆ m_n_q

int GSparseSymbolic::m_n_q
private

Number of elements in m_q.

Definition at line 95 of file GSparseSymbolic.hpp.

Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), and operator=().

◆ m_parent

int* GSparseSymbolic::m_parent
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=(), and ~GSparseSymbolic().

◆ m_pinv

int* GSparseSymbolic::m_pinv
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=(), and ~GSparseSymbolic().

◆ m_q

int* GSparseSymbolic::m_q
private

Fill-reducing column permutation for LU and QR.

Definition at line 87 of file GSparseSymbolic.hpp.

Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), operator=(), and ~GSparseSymbolic().

◆ m_unz

double GSparseSymbolic::m_unz
private

entries in U for LU; in R for QR

Definition at line 93 of file GSparseSymbolic.hpp.

Referenced by cholesky_symbolic_analysis(), GSparseSymbolic(), and operator=().


The documentation for this class was generated from the following files: