27#ifndef GMATRIXSYMMETRIC_HPP
28#define GMATRIXSYMMETRIC_HPP
104 virtual void clear(
void);
106 virtual std::string
classname(
void)
const;
107 virtual double&
at(
const int&
row,
const int&
column);
108 virtual const double&
at(
const int&
row,
const int&
column)
const;
115 virtual double fill(
void)
const;
116 virtual double min(
void)
const;
117 virtual double max(
void)
const;
118 virtual double sum(
void)
const;
154 return (
"GMatrixSymmetric");
Abstract matrix base class definition.
GMatrixSymmetric operator*(const GMatrixSymmetric &matrix, const double &scalar)
Multiply matrix by scalar.
GMatrixSymmetric operator/(const GMatrixSymmetric &matrix, const double &scalar)
Divide matrix by scalar.
Abstract matrix base class interface definition.
void scale_elements(const double &scalar)
Scale all matrix elements with a scalar.
const int & rows(void) const
Return number of matrix rows.
double get_max_element(void) const
Returns maximum matrix element.
const int & columns(void) const
Return number of matrix columns.
double get_min_element(void) const
Return minimum matrix element.
Sparse matrix class interface definition.
Symmetric matrix class interface definition.
virtual void add_to_row(const int &row, const GVector &vector)
Add row to matrix elements.
void copy_members(const GMatrixSymmetric &matrix)
Copy class members.
GVector cholesky_solver(const GVector &vector, const bool &compress=true) const
Cholesky solver.
virtual GMatrixSymmetric operator-(void) const
Negate matrix elements.
virtual GMatrixSymmetric & operator-=(const GMatrixSymmetric &matrix)
Unary matrix subtraction operator.
GMatrixSymmetric transpose(void) const
Return transposed matrix.
GMatrix extract_lower_triangle(void) const
Extract lower triangle of matrix.
GMatrixSymmetric cholesky_decompose(const bool &compress=true) const
Return Cholesky decomposition.
virtual void clear(void)
Clear matrix.
GMatrixSymmetric cholesky_invert(const bool &compress=true) const
Invert matrix using a Cholesky decomposition.
virtual GMatrixSymmetric & operator/=(const double &scalar)
Divide matrix elements.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print matrix.
virtual GVector operator*(const GVector &v) const
Vector multiplication.
GMatrixSymmetric(void)
Void constructor.
virtual GMatrixSymmetric operator+(const GMatrixSymmetric &matrix) const
Binary matrix addition.
virtual void add_to_column(const int &column, const GVector &vector)
Add vector column into matrix.
GMatrixSymmetric invert(void) const
Return inverted matrix.
virtual std::string classname(void) const
Return class name.
virtual double sum(void) const
Sum matrix elements.
virtual GVector row(const int &row) const
Extract row as vector from matrix.
GVector solve(const GVector &vector) const
Solves linear matrix equation.
virtual GVector column(const int &column) const
Extract column as vector from matrix.
void init_members(void)
Initialise class mambers.
virtual ~GMatrixSymmetric(void)
Destructor.
virtual double & at(const int &row, const int &column)
Return reference to matrix element.
virtual GMatrixSymmetric & operator=(const GMatrixSymmetric &matrix)
Matrix assignment operator.
virtual double fill(void) const
Determine fill of matrix.
virtual GMatrixSymmetric & operator+=(const GMatrixSymmetric &matrix)
Unary matrix addition operator.
void alloc_members(const int &rows, const int &columns)
Allocates matrix memory.
void free_members(void)
Delete class members.
virtual double min(void) const
Return minimum matrix element.
int * m_inx
Index array of non-zero rows/columns.
GMatrix extract_upper_triangle(void) const
Extract upper triangle of matrix.
int m_num_inx
Number of indices in array.
GMatrixSymmetric abs(void) const
Return absolute of matrix.
virtual GMatrixSymmetric & operator*=(const double &scaler)
Scale matrix elements.
void set_inx(void)
Set index selection.
virtual double & operator()(const int &row, const int &column)
Return reference to matrix element.
virtual double max(void) const
Return maximum matrix element.
virtual GMatrixSymmetric * clone(void) const
Clone matrix.
Generic matrix class definition.