GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GSparseSymbolic Class Reference

Sparse matrix symbolic analysis class. More...

#include <GSparseSymbolic.hpp>

Public Member Functions

 GSparseSymbolic (void)
 Void constructor. More...
 
virtual ~GSparseSymbolic (void)
 Destructor. More...
 
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 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 rows

More...
 
double m_lnz
 

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

More...
 
double m_unz
 

entries in U for LU; in R for QR

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

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

Void constructor.

Definition at line 53 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 ( void  )
virtual

Destructor.

Definition at line 78 of file GSparseSymbolic.cpp.

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

Member Function Documentation

int * GSparseSymbolic::cs_counts ( const GMatrixSparse A,
const int *  parent,
const int *  post,
int  ata 
)
private
int GSparseSymbolic::cs_diag ( int  i,
int  j,
double  aij,
void *  other 
)
staticprivate

Definition at line 1419 of file GSparseSymbolic.cpp.

Referenced by cs_amd().

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

cs_fkeep

Parameters
[in]ASparse matrix.
[in]fkeepScreening function.
[in]otherOther 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 1118 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().

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

Definition at line 1178 of file GSparseSymbolic.cpp.

Referenced by cs_counts().

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

Definition at line 1228 of file GSparseSymbolic.cpp.

Referenced by cholesky_symbolic_analysis().

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

Definition at line 1253 of file GSparseSymbolic.cpp.

References cs_tdfs().

Referenced by cholesky_symbolic_analysis().

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

Definition at line 1319 of file GSparseSymbolic.cpp.

Referenced by cs_amd(), and cs_post().

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

Definition at line 1437 of file GSparseSymbolic.cpp.

Referenced by cs_amd().

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

Definition at line 101 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 Function Documentation

friend class GMatrixSparse
friend

Definition at line 57 of file GSparseSymbolic.hpp.

friend class GSparseNumeric
friend

Definition at line 58 of file GSparseSymbolic.hpp.

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

Definition at line 1459 of file GSparseSymbolic.cpp.

Member Data Documentation

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<<(), operator=(), and ~GSparseSymbolic().

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<<(), operator=(), and ~GSparseSymbolic().

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

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

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(), operator<<(), and operator=().

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(), operator<<(), and operator=().

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(), operator<<(), and operator=().

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(), operator<<(), and operator=().

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

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

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<<(), operator=(), and ~GSparseSymbolic().

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: