EllAlgo 1.6.13
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Matrix0 Class Reference

A simple matrix class for conjugate gradient calculations. More...

#include <conjugate_gradient.hpp>

Public Member Functions

 Matrix0 (size_t rows, size_t cols)
 Construct a new Matrix0 object.
 
std::vector< double > & operator[] (size_t i)
 Access row i of the matrix.
 
const std::vector< double > & operator[] (size_t i) const
 Access row i of the matrix (const version)
 
size_t rows () const
 Get the number of rows.
 
size_t cols () const
 Get the number of columns.
 
Vector0 dot (const Vector0 &v) const
 Multiply the matrix by a vector.
 

Detailed Description

A simple matrix class for conjugate gradient calculations.

This class provides basic matrix operations needed for the conjugate gradient method, including matrix-vector multiplication.

Constructor & Destructor Documentation

◆ Matrix0()

Matrix0::Matrix0 ( size_t  rows,
size_t  cols 
)
inline

Construct a new Matrix0 object.

Parameters
[in]rowsNumber of rows
[in]colsNumber of columns

Member Function Documentation

◆ cols()

size_t Matrix0::cols ( ) const
inline

Get the number of columns.

Returns
Number of columns

◆ dot()

Vector0 Matrix0::dot ( const Vector0 v) const
inline

Multiply the matrix by a vector.

Parameters
[in]vThe vector to multiply
Returns
The resulting vector

◆ operator[]() [1/2]

std::vector< double > & Matrix0::operator[] ( size_t  i)
inline

Access row i of the matrix.

Parameters
[in]iRow index
Returns
Reference to the row vector

◆ operator[]() [2/2]

const std::vector< double > & Matrix0::operator[] ( size_t  i) const
inline

Access row i of the matrix (const version)

Parameters
[in]iRow index
Returns
Const reference to the row vector

◆ rows()

size_t Matrix0::rows ( ) const
inline

Get the number of rows.

Returns
Number of rows

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