GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GMatrixSparse.cpp File Reference

Sparse matrix class implementation. More...

#include <cmath>
#include "GException.hpp"
#include "GTools.hpp"
#include "GVector.hpp"
#include "GMatrix.hpp"
#include "GMatrixSparse.hpp"
#include "GMatrixSymmetric.hpp"
#include "GSparseSymbolic.hpp"
#include "GSparseNumeric.hpp"

Go to the source code of this file.

Macros

#define G_CONSTRUCTOR   "GMatrixSparse::GMatrixSparse(int&, int&, int&)"
 
#define G_OP_MUL_VEC   "GMatrixSparse::operator*(GVector&)"
 
#define G_OP_ADD   "GMatrixSparse::operator+=(GMatrixSparse&)"
 
#define G_OP_SUB   "GMatrixSparse::operator-=(GMatrixSparse&)"
 
#define G_OP_MAT_MUL   "GMatrixSparse::operator*=(GMatrixSparse&)"
 
#define G_AT   "GMatrixSparse::at(int&, int&)"
 
#define G_EXTRACT_ROW   "GMatrixSymmetric::row(int&)"
 
#define G_SET_ROW   "GMatrixSymmetric::row(int&, GVector&)"
 
#define G_EXTRACT_COLUMN   "GMatrixSymmetric::column(int&)"
 
#define G_SET_COLUMN   "GMatrixSymmetric::column(int&, GVector&)"
 
#define G_SET_COLUMN2   "GMatrixSymmetric::column(int&, double*, int*, int)"
 
#define G_ADD_TO_ROW   "GMatrixSymmetric::add_to_row(int&, GVector&)"
 
#define G_ADD_TO_COLUMN   "GMatrixSymmetric::add_to_column(int&, GVector&)"
 
#define G_ADD_TO_COLUMN2
 
#define G_CHOL_DECOMP   "GMatrixSparse::cholesky_decompose(bool)"
 
#define G_CHOL_SOLVE   "GMatrixSparse::cholesky_solver(GVector&, bool)"
 
#define G_STACK_INIT   "GMatrixSparse::stack_init(int&, int&)"
 
#define G_STACK_PUSH
 
#define G_STACK_FLUSH   "GMatrixSparse::stack_flush(void)"
 
#define G_COPY_MEMBERS   "GMatrixSparse::copy_members(GMatrixSparse&)"
 
#define G_ALLOC_MEMBERS   "GMatrixSparse::alloc_members(int&, int&, int&)"
 
#define G_ALLOC   "GMatrixSparse::alloc_elements(int&, int&)"
 
#define G_FREE   "GMatrixSparse::free_elements(int&, int&)"
 
#define G_REMOVE_ZERO   "GMatrixSparse::remove_zero_row_col(void)"
 
#define G_SYMPERM   "cs_symperm(GMatrixSparse*, int*, int&)"
 
#define G_TRANSPOSE   "cs_transpose(GMatrixSparse*, int)"
 
#define G_MIN(a, b)   (((a) < (b)) ? (a) : (b))
 
#define G_MAX(a, b)   (((a) > (b)) ? (a) : (b))
 

Functions

GMatrixSparse cs_symperm (const GMatrixSparse &matrix, const int *pinv)
 cs_symperm More...
 
GMatrixSparse cs_transpose (const GMatrixSparse &matrix, int values)
 
double cs_cumsum (int *p, int *c, int n)
 cs_cumsum More...
 

Detailed Description

Sparse matrix class implementation.

Author
Juergen Knoedlseder

Definition in file GMatrixSparse.cpp.

Macro Definition Documentation

#define G_ADD_TO_COLUMN   "GMatrixSymmetric::add_to_column(int&, GVector&)"

Definition at line 54 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::add_to_column().

#define G_ADD_TO_COLUMN2
Value:
"GMatrixSymmetric::add_to_column(int&, double*,"\
" int*, int)"

Definition at line 55 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::add_to_column().

#define G_ADD_TO_ROW   "GMatrixSymmetric::add_to_row(int&, GVector&)"

Definition at line 53 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::add_to_row().

#define G_ALLOC   "GMatrixSparse::alloc_elements(int&, int&)"

Definition at line 65 of file GMatrixSparse.cpp.

#define G_ALLOC_MEMBERS   "GMatrixSparse::alloc_members(int&, int&, int&)"

Definition at line 64 of file GMatrixSparse.cpp.

#define G_AT   "GMatrixSparse::at(int&, int&)"

Definition at line 47 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::at().

#define G_CHOL_DECOMP   "GMatrixSparse::cholesky_decompose(bool)"

Definition at line 57 of file GMatrixSparse.cpp.

#define G_CHOL_SOLVE   "GMatrixSparse::cholesky_solver(GVector&, bool)"

Definition at line 58 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::cholesky_solver().

#define G_CONSTRUCTOR   "GMatrixSparse::GMatrixSparse(int&, int&, int&)"

Definition at line 42 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::GMatrixSparse().

#define G_COPY_MEMBERS   "GMatrixSparse::copy_members(GMatrixSparse&)"

Definition at line 63 of file GMatrixSparse.cpp.

#define G_EXTRACT_COLUMN   "GMatrixSymmetric::column(int&)"

Definition at line 50 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::column().

#define G_EXTRACT_ROW   "GMatrixSymmetric::row(int&)"

Definition at line 48 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::row().

#define G_FREE   "GMatrixSparse::free_elements(int&, int&)"

Definition at line 66 of file GMatrixSparse.cpp.

#define G_MAX (   a,
 
)    (((a) > (b)) ? (a) : (b))

Definition at line 73 of file GMatrixSparse.cpp.

Referenced by cs_symperm().

#define G_MIN (   a,
 
)    (((a) < (b)) ? (a) : (b))

Definition at line 72 of file GMatrixSparse.cpp.

Referenced by cs_symperm().

#define G_OP_ADD   "GMatrixSparse::operator+=(GMatrixSparse&)"

Definition at line 44 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::operator+=().

#define G_OP_MAT_MUL   "GMatrixSparse::operator*=(GMatrixSparse&)"

Definition at line 46 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::operator*=().

#define G_OP_MUL_VEC   "GMatrixSparse::operator*(GVector&)"

Definition at line 43 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::operator*().

#define G_OP_SUB   "GMatrixSparse::operator-=(GMatrixSparse&)"

Definition at line 45 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::operator-=().

#define G_REMOVE_ZERO   "GMatrixSparse::remove_zero_row_col(void)"

Definition at line 67 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::remove_zero_row_col().

#define G_SET_COLUMN   "GMatrixSymmetric::column(int&, GVector&)"

Definition at line 51 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::column().

#define G_SET_COLUMN2   "GMatrixSymmetric::column(int&, double*, int*, int)"

Definition at line 52 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::column().

#define G_SET_ROW   "GMatrixSymmetric::row(int&, GVector&)"

Definition at line 49 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::row().

#define G_STACK_FLUSH   "GMatrixSparse::stack_flush(void)"

Definition at line 62 of file GMatrixSparse.cpp.

#define G_STACK_INIT   "GMatrixSparse::stack_init(int&, int&)"

Definition at line 59 of file GMatrixSparse.cpp.

#define G_STACK_PUSH
Value:
"GMatrixSparse::stack_push_column(double*, int*, int&,"\
" int&)"

Definition at line 60 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::stack_push_column().

#define G_SYMPERM   "cs_symperm(GMatrixSparse*, int*, int&)"

Definition at line 68 of file GMatrixSparse.cpp.

#define G_TRANSPOSE   "cs_transpose(GMatrixSparse*, int)"

Definition at line 69 of file GMatrixSparse.cpp.

Function Documentation

double cs_cumsum ( int *  p,
int *  c,
int  n 
)

cs_cumsum

Parameters
[out]pInteger array (n+1 elements).
[in]cInteger array (n elements).
[in]nNumber of elements.

Evaluate p[0..n] = cumulative sum of c[0..n-1]

Definition at line 3635 of file GMatrixSparse.cpp.

Referenced by GSparseSymbolic::cholesky_symbolic_analysis(), cs_symperm(), and cs_transpose().

GMatrixSparse cs_symperm ( const GMatrixSparse matrix,
const int *  pinv 
)

cs_symperm

Parameters
[in]matrixMatrix.
[in]pinvTBD.

Returns matrix(p,p) where matrix and matrix(p,p) are symmetric the upper part stored.

Definition at line 3489 of file GMatrixSparse.cpp.

References cs_cumsum(), GMatrixSparse::free_elements(), G_MAX, G_MIN, GMatrixBase::m_cols, GMatrixBase::m_colstart, GMatrixBase::m_data, GMatrixBase::m_elements, and GMatrixSparse::m_rowinx.

Referenced by GSparseNumeric::cholesky_numeric_analysis(), and GSparseSymbolic::cholesky_symbolic_analysis().