30 #if !defined(_SPARSE_MATRIX_H_) 31 #define _SPARSE_MATRIX_H_ 1 48 #if !defined(BEGIN_NAMESPACE) 49 #define BEGIN_NAMESPACE(x) namespace x { 50 #define END_NAMESPACE(x) } 61 virtual const char *
what()
const throw() {
return msg; }
78 std::vector<int>
const & permutationHML);
81 for(
int i=0; i<n; i++) {
82 delete [](columns[i]);
83 delete [](offsets[i]);
92 void print(
const char *title)
const;
97 std::vector<int>
const & permutationHML)
const;
104 const int *hi = his[col];
106 for(idx = 0; idx < cnt[col] && row >hi[idx]; ++idx);
109 throw Exception(
"SparseMatrix::add called with incorrect args");
110 int offset = offsets[col][idx];
114 columnData[row-offset] += val;
122 const ergo_real *columnData = columns[col];
123 const int *hi = his[col];
124 int idx;
for(idx = 0; idx < cnt[col] && row >hi[idx]; ++idx);
126 throw Exception(
"SparseMatrix::at called with incorrect args");
128 int offset = offsets[col][idx];
132 return columnData[row-offset];
142 const int* nblocks,
const int (*iblocks)[2],
147 const int* nblocks,
const int (*iblocks)[2],
double ergo_real
Definition: realtype.h:69
int n
Definition: sparse_matrix.h:69
#define END_NAMESPACE(x)
Definition: sparse_pattern.h:42
#define BEGIN_NAMESPACE(x)
Definition: sparse_pattern.h:41
A way to store sparse matrix patterns.
Definition: sparse_pattern.h:53
MatrixSymmetric< real, matri > symmMatrix
Definition: test_LanczosSeveralLargestEig.cc:69
Definition: sparse_matrix.h:57
Class that can be used to store sparse matrix patterns.
Code for setting up basis functions starting from shells.
const SparsePattern & pattern
Definition: sparse_matrix.h:64
Definition of the main floating-point datatype used; the ergo_real type.
int ** offsets
for accelerated at() and add() methods.
Definition: sparse_matrix.h:66
ergo_real ** columns
Definition: sparse_matrix.h:65
Sparse matrix structure optimized for XC data access pattern.
Definition: sparse_matrix.h:56
void getrho_blocked_lda(int nbast, const Dft::SparseMatrix &dmat, const ergo_real *gao, const int *nblocks, const int(*iblocks)[2], int ldaib, ergo_real *tmp, int nvclen, ergo_real *rho)
Definition: sparse_matrix.cc:290
Header file with typedefs for matrix and vector types.
ergo_real at(int row, int col) const
Definition: sparse_matrix.h:121
const char * msg
Definition: sparse_matrix.h:58
~SparseMatrix()
Definition: sparse_matrix.h:80
void add(int row, int col, ergo_real val)
Adds given value to an element in given row and column.
Definition: sparse_matrix.h:102
Exception(const char *msg_)
Definition: sparse_matrix.h:60
int * cnt
for accelerated at() and add() methods.
Definition: sparse_matrix.h:68
void getrho_blocked_gga(int nbast, const Dft::SparseMatrix &dmat, const ergo_real *gao, const int *nblocks, const int(*iblocks)[2], int ldaib, ergo_real *tmp, int nvclen, ergo_real *rho, ergo_real(*grad)[3])
Definition: sparse_matrix.cc:336
int ** his
for accelerated at() and add() methods.
Definition: sparse_matrix.h:67
Definition: grid_matrix.h:42
virtual const char * what() const
Definition: sparse_matrix.h:61