chsvlib
chsv helper source code
matrix_column< MatrixType > Class Template Reference

Implements a column of a matrix with direct access to the elements of the matrix. More...

#include <chsvmath.h>

Public Types

typedef MatrixType::value_type value_type
 A type of a matrix element.
 
typedef value_typepointer
 A type of a pointer to a matrix element.
 
typedef value_typereference
 A type of a reference to a matrix element.
 
typedef const value_typeconst_pointer
 A type of a pointer to an immutable matrix element.
 
typedef const value_typeconst_reference
 A type of a reference to an immutable matrix element.
 
typedef std::size_t size_type
 A type for holding sizes within a matrix column.
 
typedef std::ptrdiff_t difference_type
 A type for holding position differences within a matrix column.
 
typedef MatrixType matrix_type
 The type of the host matrix which a column appertains to.
 
typedef pointer iterator
 A type of a RandomAccessIterator and a ContiguousIterator used to enumerate modifiable elements of the column.
 
typedef const_pointer const_iterator
 A type of a RandomAccessIterator and a ContiguousIterator used to enumerate immutable elements of the column.
 
typedef std::reverse_iterator< iteratorreverse_iterator
 Reverse iterator used to enumerate modifiable elements of the column backwards. Same as std::reverse_iterator<iterator>.
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 Reverse iterator used to enumerate immutable elements of the column backwards. Same as std::reverse_iterator<const_iterator>.
 

Public Member Functions

matrix_columnoperator= (const matrix_column &right)
 Copy-assignment of elements of a matrix column. More...
 
matrix_columnoperator= (matrix_column &&right)
 Move-assignment of elements of a matrix column. More...
 
std::size_t Rows () const noexcept
 Returns a number of rows in the column. Same as matrix_column::size(). More...
 
const_pointer data () const noexcept
 Returns a raw pointer to an immutable array of the column elements. More...
 
pointer data () noexcept
 Returns a raw pointer to an array of the column elements. More...
 
std::size_t size () const noexcept
 Returns a number of elements which appertain to the column. Same as matrix_column::Rows(). More...
 
std::size_t max_size () const noexcept
 Returns the maximal number of elements within the column that is supported by the type size_type. More...
 
const_reference operator[] (std::size_t off) const noexcept
 Provides the caller with an immutable arbitrary access to an element of a matrix column. More...
 
reference operator[] (std::size_t off) noexcept
 Provides the caller with an arbitrary access to an element of a matrix column. More...
 
const_reference at (std::size_t off) const
 Provides the caller with a functional access to an immutable column element by its index which is validated. More...
 
reference at (std::size_t off)
 Provides the caller with a functional access to a column element by its index which is validated. More...
 
const_reference front () const noexcept
 Returns a reference to an immutable first (top) element of the column. More...
 
reference front () noexcept
 Returns a reference to the first (top) element of the column. More...
 
const_reference back () const noexcept
 Returns a reference to an immutable last (bottom) element of the column. More...
 
reference back () noexcept
 Returns a reference to the last (bottom) element of the column. More...
 
iterator begin () noexcept
 Returns an iterator associated with the first, top, element of the column.
 
const_iterator begin () const noexcept
 Returns an iterator associated with the first, top, immutable element of the column.
 
const_iterator cbegin () const noexcept
 Returns an iterator associated with the first, top, immutable element of the column.
 
iterator end () noexcept
 Returns an iterator associated with the first pseudo element beyond the last (bottom) element of the matrix column.
 
const_iterator end () const noexcept
 Returns a read-only iterator associated with the first pseudo element beyond the last (bottom) element of the matrix column.
 
const_iterator cend () const noexcept
 Returns a read-only iterator associated with the first pseudo element beyond the last (bottom) element of the matrix column.
 
reverse_iterator rbegin () noexcept
 Returns a reverse iterator associated with the last, bottom, element of the matrix column.
 
const_reverse_iterator rbegin () const noexcept
 Returns a reverse iterator associated with the immutable last, bottom, element of the matrix column.
 
const_reverse_iterator crbegin () const noexcept
 Returns a reverse iterator associated with the immutable last, bottom, element of the matrix column.
 
reverse_iterator rend () noexcept
 Returns an iterator associated with the first pseudo element before the first (top) element of the matrix column.
 
const_reverse_iterator rend () const noexcept
 Returns a read-only iterator associated with the first pseudo element before the first (top) element of the matrix column.
 
const_reverse_iterator crend () const noexcept
 Returns a read-only iterator associated with the first pseudo element before the first (top) element of the matrix column.
 
bool empty () const noexcept
 Tests emptiness of the matrix column.
 
void swap (matrix_column< MatrixType > &other)
 Swaps the contents of two matrix columns. More...
 
template<class T = typename MatrixType::value_type>
auto operator== (const matrix_column< MatrixType > &right) const noexcept -> decltype(std::declval< T >()==std::declval< T >())
 Compares two matrix columns for equality of their respective elements. More...
 
template<class T = typename MatrixType::value_type>
auto operator!= (const matrix_column< MatrixType > &right) const noexcept -> decltype(std::declval< T >()==std::declval< T >())
 Compares two matrix columns for inequality of their respective elements. More...
 

Detailed Description

template<class MatrixType>
class Chusov::Math::matrix_column< MatrixType >

Implements a column of a matrix with direct access to the elements of the matrix.

Template Parameters
MatrixTypeThe type of the host matrix which a column appertains to.

The class implements a logic of a vector-like ContiguousContainer and SequenceContainer except for operation that changes the amount of elements within the column. That is, modifications of the container itself, but not its elements, are prohibited.

A matrix column can only exist in the context and during the lifetime of its matrix. Therefore, copying of a column is prohibited. In order to create a matrix representation of the column independently of the original matrix, one should matrix_from_column_ctor [create the matrix] filled with copies of the column elements.


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