ampsci
High-precision calculations for one- and two-valence atomic systems
LinAlg::View< T >

ok

template<typename T>
class LinAlg::View< T >

Non-owning strided view onto a 1D segment of an array.

Provides indexed read/write access into an existing array without ownership. The stride allows views over non-contiguous memory (e.g., a column of a row-major matrix).

Used by Matrix::row_view() and Matrix::column_view().

#include <Matrix.hpp>

Public Member Functions

 View (T *data, std::size_t start, std::size_t size, std::size_t stride)
 Construct view over size elements starting at offset start, with stride.
 
std::size_t size () const
 Number of elements in the view.
 
T & operator[] (std::size_t i)
 [] index access (no range checking), mutable
 
operator[] (std::size_t i) const
 [] index access (no range checking), const
 
T & at (std::size_t i)
 at(i): element access with range checking, mutable
 
at (std::size_t i) const
 at(i): element access with range checking, const
 
T & operator() (std::size_t i)
 () index access with range checking, mutable
 
operator() (std::size_t i) const
 () index access with range checking, const
 
T * data ()
 Raw pointer to first viewed element.
 

Constructor & Destructor Documentation

◆ View()

template<typename T >
LinAlg::View< T >::View ( T *  data,
std::size_t  start,
std::size_t  size,
std::size_t  stride 
)
inline

Construct view over size elements starting at offset start, with stride.

Member Function Documentation

◆ size()

template<typename T >
std::size_t LinAlg::View< T >::size ( ) const
inline

Number of elements in the view.

◆ operator[]() [1/2]

template<typename T >
T & LinAlg::View< T >::operator[] ( std::size_t  i)
inline

[] index access (no range checking), mutable

◆ operator[]() [2/2]

template<typename T >
T LinAlg::View< T >::operator[] ( std::size_t  i) const
inline

[] index access (no range checking), const

◆ at() [1/2]

template<typename T >
T & LinAlg::View< T >::at ( std::size_t  i)
inline

at(i): element access with range checking, mutable

◆ at() [2/2]

template<typename T >
T LinAlg::View< T >::at ( std::size_t  i) const
inline

at(i): element access with range checking, const

◆ operator()() [1/2]

template<typename T >
T & LinAlg::View< T >::operator() ( std::size_t  i)
inline

() index access with range checking, mutable

◆ operator()() [2/2]

template<typename T >
T LinAlg::View< T >::operator() ( std::size_t  i) const
inline

() index access with range checking, const

◆ data()

template<typename T >
T * LinAlg::View< T >::data ( )
inline

Raw pointer to first viewed element.


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