Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.6dev
      Class Index
      File List
   Version 1.0.6
   Version 1.0.5new_solver
   Version 1.0.5dev
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads
Matrix Class Referenceabstract

Base matrix class. More...

#include <matrix.hpp>

Inheritance diagram for Matrix:
CColMatrix CRowMatrix CoordMatrix

Public Member Functions

virtual ~Matrix ()
 Virtual destructor. More...
 
virtual int columns (void) const =0
 Returns the number of columns of the matrix. More...
 
virtual int rows (void) const =0
 Returns the number of rows of the matrix. More...
 
virtual void size (int &n, int &m) const =0
 Returns the number of rows n and the number of columns m of the matrix. More...
 
virtual void resize (int n, int m)=0
 Resizes the matrix to nn x mm. More...
 
virtual void clear (void)=0
 Clears the matrix (sets all element to zero). More...
 
double get (int i, int j) const
 Function to get a matrix element value at (i,j). More...
 
double & set (int i, int j)
 Function to get a reference to matrix element value at (i,j). More...
 
MatrixMulVec operator* (const class Vector &vec) const
 Operator for matrix-vector multiplication. More...
 
virtual void multiply_by_vector (Vector &res, const Vector &rhs) const =0
 
virtual void lower_unit_solve (Vector &y, const Vector &b) const =0
 Solves A*x = b for lower unit diagonal matrix. More...
 
virtual void upper_diag_solve (Vector &x, const Vector &y) const =0
 Solves A*x = b for upper diagonal matrix. More...
 

Friends

class Vector
 

Detailed Description

Base matrix class.

The matrix class is an abstract class designed to be used as a base class for different matrix implementations.

Constructor & Destructor Documentation

◆ ~Matrix()

virtual Matrix::~Matrix ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ clear()

virtual void Matrix::clear ( void  )
pure virtual

Clears the matrix (sets all element to zero).

Implemented in CRowMatrix, CoordMatrix, and CColMatrix.

◆ columns()

virtual int Matrix::columns ( void  ) const
pure virtual

Returns the number of columns of the matrix.

Implemented in CRowMatrix, CoordMatrix, and CColMatrix.

◆ get()

double Matrix::get ( int  i,
int  j 
) const
inline

Function to get a matrix element value at (i,j).

◆ lower_unit_solve()

virtual void Matrix::lower_unit_solve ( Vector y,
const Vector b 
) const
pure virtual

Solves A*x = b for lower unit diagonal matrix.

Matrix has to have elements only in the lower triangle. Unit diagonal is implied, it is not to be saved to matrix.

Implemented in CoordMatrix, CRowMatrix, and CColMatrix.

◆ operator*()

MatrixMulVec Matrix::operator* ( const class Vector vec) const

Operator for matrix-vector multiplication.

◆ resize()

virtual void Matrix::resize ( int  n,
int  m 
)
pure virtual

Resizes the matrix to nn x mm.

Implemented in CRowMatrix, CoordMatrix, and CColMatrix.

◆ rows()

virtual int Matrix::rows ( void  ) const
pure virtual

Returns the number of rows of the matrix.

Implemented in CRowMatrix, CoordMatrix, and CColMatrix.

◆ set()

double & Matrix::set ( int  i,
int  j 
)
inline

Function to get a reference to matrix element value at (i,j).

◆ size()

virtual void Matrix::size ( int &  n,
int &  m 
) const
pure virtual

Returns the number of rows n and the number of columns m of the matrix.

Implemented in CRowMatrix, CoordMatrix, and CColMatrix.

◆ upper_diag_solve()

virtual void Matrix::upper_diag_solve ( Vector x,
const Vector y 
) const
pure virtual

Solves A*x = b for upper diagonal matrix.

Matrix has to have only upper diagonal elements. The diagonal element has to be the first entry on each column (sorted ascending order).

Implemented in CoordMatrix, CRowMatrix, and CColMatrix.


The documentation for this class was generated from the following files:


Reference manual for Ion Beam Simulator 1.0.6dev
Generated by Doxygen 1.9.1 on Thu Sep 11 2025 09:37:24.