yat  0.20.3pre
Public Types | Public Member Functions | Protected Member Functions | Related Functions | List of all members
theplu::yat::utility::MatrixBase Class Referenceabstract

#include <yat/utility/MatrixBase.h>

Inheritance diagram for theplu::yat::utility::MatrixBase:
theplu::yat::utility::BasicMatrix< MatrixBase > theplu::yat::utility::MatrixConstView theplu::yat::utility::MatrixMutable theplu::yat::utility::Matrix theplu::yat::utility::MatrixView

Public Types

typedef double value_type
 
typedef double & reference
 
typedef const double & const_reference
 
typedef Container2DIterator< const MatrixBase, const double, const double & > const_iterator
 
typedef StrideIterator< const double * > const_column_iterator
 
typedef StrideIterator< const double * > const_row_iterator
 
typedef MatrixBase derived_type
 

Public Member Functions

 MatrixBase (void)=default
 The default constructor. More...
 
virtual ~MatrixBase (void)
 The destructor.
 
const_iterator begin (void) const
 
const_column_iterator begin_column (size_t i) const
 
const_row_iterator begin_row (size_t i) const
 
const VectorConstView column_const_view (size_t) const
 
size_t columns (void) const
 
const_iterator end (void) const
 
const_column_iterator end_column (size_t i) const
 
const_row_iterator end_row (size_t i) const
 
bool equal (const MatrixBase &, const double precision=0) const
 Check whether matrices are equal within a user defined precision, set by precision. More...
 
virtual const gsl_matrix * gsl_matrix_p (void) const =0
 
size_t rows (void) const
 
const VectorConstView row_const_view (size_t) const
 
const double & operator() (size_t row, size_t column) const
 Element access operator. More...
 
bool operator== (const MatrixBase &other) const
 Comparison operator. Takes squared time. More...
 
bool operator!= (const MatrixBase &other) const
 Comparison operator. Takes squared time. More...
 

Protected Member Functions

gsl_matrix * create_gsl_matrix_copy (void) const
 Create a new copy of the internal GSL matrix. More...
 

Related Functions

(Note that these are not member functions.)

void minmax_index (const MatrixBase &M, std::pair< size_t, size_t > &min, std::pair< size_t, size_t > &max)
 Locate the maximum and minimum element in the matrix, M. More...
 
std::ostream & operator<< (std::ostream &s, const MatrixBase &)
 The output operator for the MatrixBase class.
 

Detailed Description

Since
New in yat 0.20

Member Typedef Documentation

◆ const_column_iterator

Read-only iterator that iterates over one column

◆ const_iterator

Read-only iterator that iterates over all elements

◆ const_reference

const_reference type is const double&

Since
New in yat 0.5

◆ const_row_iterator

Read-only iterator that iterates over one row

◆ derived_type

Class that inherits from BasicMatrix

◆ reference

reference type is double&

Since
New in yat 0.5

◆ value_type

value_type is double

Since
New in yat 0.5

Constructor & Destructor Documentation

◆ MatrixBase()

theplu::yat::utility::MatrixBase::MatrixBase ( void  )
default

The default constructor.

This constructor does not initialize underlying (essential) structures.

Member Function Documentation

◆ begin()

const_iterator theplu::yat::utility::MatrixBase::begin ( void  ) const

Iterator iterates along a row. When end of row is reached it jumps to beginning of next row.

Returns
const_iterator pointing to upper-left element.

◆ begin_column()

const_column_iterator theplu::yat::utility::MatrixBase::begin_column ( size_t  i) const

Iterator iterates along a column.

Returns
const_iterator pointing to first element of column i.

◆ begin_row()

const_row_iterator theplu::yat::utility::MatrixBase::begin_row ( size_t  i) const

Iterator iterates along a row.

Returns
const_iterator pointing to first element of row i.

◆ column_const_view()

const VectorConstView theplu::yat::utility::MatrixBase::column_const_view ( size_t  ) const
Returns
const vector view of column i

◆ columns()

size_t theplu::yat::utility::MatrixBase::columns ( void  ) const
Returns
The number of columns in the matrix.

◆ create_gsl_matrix_copy()

gsl_matrix* theplu::yat::utility::MatrixBase::create_gsl_matrix_copy ( void  ) const
protected

Create a new copy of the internal GSL matrix.

Necessary memory for the new GSL matrix is allocated and the caller is responsible for freeing the allocated memory.

Returns
A pointer to a copy of the internal GSL matrix.
Exceptions
GSL_errorif memory cannot be allocated for the new copy, or if dimensions mismatch.

◆ end()

const_iterator theplu::yat::utility::MatrixBase::end ( void  ) const
Returns
const_iterator pointing to end of matrix

◆ end_column()

const_column_iterator theplu::yat::utility::MatrixBase::end_column ( size_t  i) const
Returns
const_iterator pointing to end of column i

◆ end_row()

const_row_iterator theplu::yat::utility::MatrixBase::end_row ( size_t  i) const
Returns
const_iterator pointing to end of row i

◆ equal()

bool theplu::yat::utility::MatrixBase::equal ( const MatrixBase ,
const double  precision = 0 
) const

Check whether matrices are equal within a user defined precision, set by precision.

Returns
True if each element deviates less or equal than d. If any matrix contain a NaN, false is always returned.
See also
operator== and operator!=

◆ gsl_matrix_p()

virtual const gsl_matrix* theplu::yat::utility::MatrixBase::gsl_matrix_p ( void  ) const
pure virtual

◆ operator!=()

bool theplu::yat::utility::MatrixBase::operator!= ( const MatrixBase other) const

Comparison operator. Takes squared time.

Checks are performed with exact matching, i.e., rounding off effects may destroy comparison. Use the equal function for comparing elements within a user defined precision.

Returns
False if all elements are equal otherwise true.
See also
equal

◆ operator()()

const double& theplu::yat::utility::MatrixBase::operator() ( size_t  row,
size_t  column 
) const

Element access operator.

Returns
Const reference to the element position (row, column).
Exceptions
IfGSL range checks are enabled in the underlying GSL library a GSL_error exception is thrown if either index is out of range.

◆ operator==()

bool theplu::yat::utility::MatrixBase::operator== ( const MatrixBase other) const

Comparison operator. Takes squared time.

Checks are performed with exact matching, i.e., rounding off effects may destroy comparison. Use the equal function for comparing elements within a user defined precision.

Returns
True if all elements are equal otherwise false.
See also
equal

◆ row_const_view()

const VectorConstView theplu::yat::utility::MatrixBase::row_const_view ( size_t  ) const
Returns
const vector view of i

◆ rows()

size_t theplu::yat::utility::MatrixBase::rows ( void  ) const
Returns
The number of rows in the matrix.

Friends And Related Function Documentation

◆ minmax_index()

void minmax_index ( const MatrixBase M,
std::pair< size_t, size_t > &  min,
std::pair< size_t, size_t > &  max 
)
related

Locate the maximum and minimum element in the matrix, M.

The indices to the element with the minimum and maximum values of the matrix are returned through parameters min and max, respectively.

Note
Lower index has precedence (searching in row-major order).

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

Generated on Sat Feb 18 2023 03:31:45 for yat by  doxygen 1.8.14