35 #define G_COPY_MEMBERS "GMatrixBase::copy_members(GMatrixBase)"
36 #define G_SELECT_NON_ZERO "GMatrixBase::select_non_zero()"
111 if (
this != &matrix) {
233 for (
int i = 0; i <=
m_cols; ++i) {
265 #if defined(G_DEBUG_COPY_MEMBERS)
266 std::cout <<
"GMatrixBase::copy_members:"
328 for (col = 0; col <
m_cols; ++col) {
329 if ((*
this)(row,col) != 0.0) {
340 for (col = 0; col <
m_cols; ++col) {
342 if ((*
this)(row,col) != 0.0)
384 else if (scalar == -1.0) {
508 const int& num)
const
521 row_start =
m_rows - row_stop;
525 col_start =
m_cols - col_stop;
530 for (
int row = 0;
row < row_stop; ++
row) {
532 for (
int col = 0; col < col_stop; ++col) {
538 if (col_start > col_stop) {
541 for (
int col = col_start; col <
m_cols; ++col) {
543 if (col != m_cols-1) {
548 if (row_start > row_stop) {
550 for (
int col = 0; col < col_stop; ++col) {
553 if (col_start > col_stop) {
556 for (
int col = col_start; col <
m_cols; ++col) {
562 for (
int col = 0; col < col_stop; ++col) {
568 if (col_start > col_stop) {
571 for (
int col = col_start; col <
m_cols; ++col) {
573 if (col != m_cols-1) {
double get_min_element(void) const
Return minimum matrix element.
void scale_elements(const double &scalar)
Scale all matrix elements with a scalar.
Abstract matrix base class interface definition.
std::string print_row_compression(const GChatter &chatter=NORMAL) const
Print row compression scheme if it exists.
void init_members(void)
Initialise class members.
GVector abs(const GVector &vector)
Computes absolute of vector elements.
double get_element_sum(void) const
Returns sum over all matrix elements.
virtual GVector row(const int &row) const =0
int m_rows
Number of rows.
int m_num_colsel
Number of selected columns (for compressed decomposition)
void set_all_elements(const double &value)
Set all elements to a specific value.
std::string print_elements(const GChatter &chatter=NORMAL, const int &num=15) const
Print all matrix elements.
double * m_data
Matrix data.
Abstract matrix base class definition.
void copy_members(const GMatrixBase &matrix)
Copy class members.
int m_cols
Number of columns.
double get_max_element(void) const
Returns maximum matrix element.
int m_alloc
Size of allocated matrix memory.
virtual bool operator==(const GMatrixBase &matrix) const
Equalty operator.
std::string print_col_compression(const GChatter &chatter=NORMAL) const
Print column compression scheme if it exists.
Vector class interface definition.
virtual ~GMatrixBase(void)
Destructor.
int m_elements
Number of elements stored in matrix.
GMatrixBase(void)
Void constructor.
virtual bool operator!=(const GMatrixBase &matrix) const
Non-equality operator.
Exception handler interface definition.
virtual GMatrixBase & operator=(const GMatrixBase &matrix)
Assignment operator.
void free_members(void)
Delete class members.
int m_num_rowsel
Number of selected rows (for compressed decomposition)
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
int * m_colstart
Column start indices (m_cols+1)
int * m_rowsel
Row selection (for compressed decomposition)
void select_non_zero(void)
Setup compressed matrix factorisation.
int * m_colsel
Column selection (for compressed decomposition)
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.