GammaLib 2.0.0
Loading...
Searching...
No Matches
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   "GMatrixSparse::row(int&)"
 
#define G_SET_ROW   "GMatrixSparse::row(int&, GVector&)"
 
#define G_EXTRACT_COLUMN   "GMatrixSparse::column(int&)"
 
#define G_SET_COLUMN   "GMatrixSparse::column(int&, GVector&)"
 
#define G_SET_COLUMN2   "GMatrixSparse::column(int&, double*, int*, int)"
 
#define G_ADD_TO_COLUMN   "GMatrixSparse::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_PUSH1   "GMatrixSparse::stack_push_column(GVector&, int&)"
 
#define G_STACK_PUSH2
 
#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_GET_INDEX   "GMatrixSparse::get_index(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_INSERT_ROW   "GMatrixSparse::insert_row(int&, GVector&, bool&)"
 
#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
 
GMatrixSparse cs_transpose (const GMatrixSparse &matrix, int values)
 
double cs_cumsum (int *p, int *c, int n)
 cs_cumsum
 

Detailed Description

Sparse matrix class implementation.

Author
Juergen Knoedlseder

Definition in file GMatrixSparse.cpp.

Macro Definition Documentation

◆ G_ADD_TO_COLUMN

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

Definition at line 53 of file GMatrixSparse.cpp.

◆ G_ADD_TO_COLUMN2

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

Definition at line 54 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::add_to_column().

◆ G_ALLOC

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

◆ G_ALLOC_MEMBERS

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

Definition at line 64 of file GMatrixSparse.cpp.

Referenced by GMatrixSymmetric::alloc_members().

◆ G_AT

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

Definition at line 47 of file GMatrixSparse.cpp.

◆ G_CHOL_DECOMP

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

Definition at line 56 of file GMatrixSparse.cpp.

Referenced by GMatrixSymmetric::cholesky_decompose().

◆ G_CHOL_SOLVE

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

◆ G_CONSTRUCTOR

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

Definition at line 42 of file GMatrixSparse.cpp.

◆ G_COPY_MEMBERS

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

Definition at line 63 of file GMatrixSparse.cpp.

◆ G_EXTRACT_COLUMN

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

Definition at line 50 of file GMatrixSparse.cpp.

◆ G_EXTRACT_ROW

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

Definition at line 48 of file GMatrixSparse.cpp.

◆ G_FREE

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

Definition at line 67 of file GMatrixSparse.cpp.

◆ G_GET_INDEX

#define G_GET_INDEX   "GMatrixSparse::get_index(int&, int&)"

Definition at line 65 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::get_index().

◆ G_INSERT_ROW

#define G_INSERT_ROW   "GMatrixSparse::insert_row(int&, GVector&, bool&)"

Definition at line 69 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::insert_row().

◆ G_MAX

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

Definition at line 75 of file GMatrixSparse.cpp.

Referenced by GOptimizerPar::max().

◆ G_MIN

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

Definition at line 74 of file GMatrixSparse.cpp.

Referenced by GOptimizerPar::min().

◆ G_OP_ADD

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

Definition at line 44 of file GMatrixSparse.cpp.

◆ G_OP_MAT_MUL

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

Definition at line 46 of file GMatrixSparse.cpp.

◆ G_OP_MUL_VEC

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

Definition at line 43 of file GMatrixSparse.cpp.

◆ G_OP_SUB

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

Definition at line 45 of file GMatrixSparse.cpp.

◆ G_REMOVE_ZERO

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

Definition at line 68 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::remove_zero_row_col().

◆ G_SET_COLUMN

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

Definition at line 51 of file GMatrixSparse.cpp.

◆ G_SET_COLUMN2

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

Definition at line 52 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::column().

◆ G_SET_ROW

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

Definition at line 49 of file GMatrixSparse.cpp.

◆ G_STACK_FLUSH

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

Definition at line 62 of file GMatrixSparse.cpp.

◆ G_STACK_INIT

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

Definition at line 58 of file GMatrixSparse.cpp.

◆ G_STACK_PUSH1

#define G_STACK_PUSH1   "GMatrixSparse::stack_push_column(GVector&, int&)"

Definition at line 59 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::stack_push_column().

◆ G_STACK_PUSH2

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

Definition at line 60 of file GMatrixSparse.cpp.

Referenced by GMatrixSparse::stack_push_column().

◆ G_SYMPERM

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

Definition at line 70 of file GMatrixSparse.cpp.

◆ G_TRANSPOSE

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

Definition at line 71 of file GMatrixSparse.cpp.

Function Documentation

◆ cs_cumsum()

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 3988 of file GMatrixSparse.cpp.

References GMatrixSymmetric::column(), GMatrixBase::columns(), and GMatrixBase::rows().

Referenced by GSparseSymbolic::cholesky_symbolic_analysis().

◆ cs_symperm()

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 3835 of file GMatrixSparse.cpp.

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

◆ cs_transpose()

GMatrixSparse cs_transpose ( const GMatrixSparse & matrix,
int values )

Definition at line 3921 of file GMatrixSparse.cpp.

Referenced by GSparseSymbolic::cs_amd(), and GSparseSymbolic::cs_counts().