yat  0.21pre
Public Types | Public Member Functions | Protected Member Functions | Related Functions | List of all members
theplu::yat::utility::MatrixConstView Class Reference

#include <yat/utility/MatrixConstView.h>

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

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

 MatrixConstView (void)
 
 MatrixConstView (const MatrixConstView &other)
 
 MatrixConstView (const MatrixBase &other)
 
 MatrixConstView (const MatrixBase &other, size_t row_offset, size_t col_offset, size_t rows, size_t columns)
 
 MatrixConstView (const gsl_matrix *m)
 
 MatrixConstView (const double *p, size_t rows, size_t cols)
 
 MatrixConstView (const double *p, size_t rows, size_t cols, size_t tda)
 
 ~MatrixConstView (void)
 Destructor.
 
const gsl_matrix * gsl_matrix_p (void) const
 
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...
 
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

typedef Container2DIterator<const MatrixBase, const double, const double&> theplu::yat::utility::MatrixBase::const_iterator
inherited

Read-only iterator that iterates over all elements

◆ const_reference

typedef const double& theplu::yat::utility::MatrixBase::const_reference
inherited

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

◆ MatrixConstView() [1/7]

theplu::yat::utility::MatrixConstView::MatrixConstView ( void  )

Default constructor. Constructed view behaves like viewing into an empty Matrix.

◆ MatrixConstView() [2/7]

theplu::yat::utility::MatrixConstView::MatrixConstView ( const MatrixConstView other)

Copy constructor

◆ MatrixConstView() [3/7]

theplu::yat::utility::MatrixConstView::MatrixConstView ( const MatrixBase other)
explicit

Create a view into a matrix other.

◆ MatrixConstView() [4/7]

theplu::yat::utility::MatrixConstView::MatrixConstView ( const MatrixBase other,
size_t  row_offset,
size_t  col_offset,
size_t  rows,
size_t  columns 
)

for (size_t i=0; i<matrix.rows(); ++i)

Create view into sub-matrix into other.

view(0,) will view into other(row_offset, col_offset) and have dimension row x column.

◆ MatrixConstView() [5/7]

theplu::yat::utility::MatrixConstView::MatrixConstView ( const gsl_matrix *  m)
explicit

Create a view into m.

◆ MatrixConstView() [6/7]

theplu::yat::utility::MatrixConstView::MatrixConstView ( const double *  p,
size_t  rows,
size_t  cols 
)

Create a view with rows rows and cols columns. Data are stored in row-major order such that p[1] correspond to view(0,1).

◆ MatrixConstView() [7/7]

theplu::yat::utility::MatrixConstView::MatrixConstView ( const double *  p,
size_t  rows,
size_t  cols,
size_t  tda 
)

Create a view with rows rows and cols columns. The physical row dimension is tda, i.e., the first element on the second row is p[tda].

Member Function Documentation

◆ begin()

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

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
inherited

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
inherited

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
inherited
Returns
const vector view of column i

◆ columns()

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

◆ create_gsl_matrix_copy()

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

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
inherited
Returns
const_iterator pointing to end of matrix

◆ end_column()

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

◆ end_row()

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

◆ equal()

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

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()

const gsl_matrix* theplu::yat::utility::MatrixConstView::gsl_matrix_p ( void  ) const
virtual
Returns
A const pointer to the internal GSL matrix.

Implements theplu::yat::utility::MatrixBase.

◆ operator!=()

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

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
inherited

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
inherited

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
inherited
Returns
const vector view of i

◆ rows()

size_t theplu::yat::utility::MatrixBase::rows ( void  ) const
inherited
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 Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14