units
Use physical dimensions at compile-time or run-time.
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
vnix::mv::mref< T, S, N > Class Template Reference

Reference to column or row in matrix. More...

Public Member Functions

constexpr mref (T *b)
 Initialize aggregate. More...
 
constexpr T * begin ()
 First element. More...
 
constexpr T * end ()
 Pointer to element that is S elements past last element identified by mref. More...
 
constexpr mrefoperator= (std::initializer_list< T > list)
 Assign from list. More...
 
constexpr T & operator() (size_t off) const
 Access element at offset off. More...
 

Static Public Member Functions

static constexpr size_t size ()
 Number of elements. More...
 
static constexpr size_t stride ()
 Distance in memory between successive elements. More...
 

Private Attributes

T * beg_
 Pointer to first element. More...
 

Detailed Description

template<typename T, size_t S, size_t N>
class vnix::mv::mref< T, S, N >

Reference to column or row in matrix.

Definition at line 43 of file example1.cpp.

Constructor & Destructor Documentation

template<typename T , size_t S, size_t N>
constexpr vnix::mv::mref< T, S, N >::mref ( T *  b)
inline

Initialize aggregate.

Definition at line 47 of file example1.cpp.

Member Function Documentation

template<typename T , size_t S, size_t N>
constexpr T* vnix::mv::mref< T, S, N >::begin ( )
inline

First element.

Definition at line 49 of file example1.cpp.

Here is the caller graph for this function:

template<typename T , size_t S, size_t N>
constexpr T* vnix::mv::mref< T, S, N >::end ( )
inline

Pointer to element that is S elements past last element identified by mref.

Definition at line 53 of file example1.cpp.

53 { return beg_ + S * N; }
constexpr auto N
Constant-expression symbol for N.
Definition: units.hpp:2008
T * beg_
Pointer to first element.
Definition: example1.cpp:44

Here is the caller graph for this function:

template<typename T , size_t S, size_t N>
constexpr T& vnix::mv::mref< T, S, N >::operator() ( size_t  off) const
inline

Access element at offset off.

Definition at line 72 of file example1.cpp.

72 { return beg_[S * off]; }
T * beg_
Pointer to first element.
Definition: example1.cpp:44
template<typename T , size_t S, size_t N>
constexpr mref& vnix::mv::mref< T, S, N >::operator= ( std::initializer_list< T >  list)
inline

Assign from list.

Definition at line 56 of file example1.cpp.

56  {
57  auto i = list.begin();
58  auto j = begin();
59  auto ie = list.end();
60  auto je = end();
61  while (i != ie && j != je) {
62  *j++ = *i;
63  i += S;
64  }
65  return *this;
66  }
constexpr T * end()
Pointer to element that is S elements past last element identified by mref.
Definition: example1.cpp:53
constexpr T * begin()
First element.
Definition: example1.cpp:49

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T , size_t S, size_t N>
static constexpr size_t vnix::mv::mref< T, S, N >::size ( )
inlinestatic

Number of elements.

Definition at line 48 of file example1.cpp.

template<typename T , size_t S, size_t N>
static constexpr size_t vnix::mv::mref< T, S, N >::stride ( )
inlinestatic

Distance in memory between successive elements.

Definition at line 69 of file example1.cpp.

69 { return S; }

Member Data Documentation

template<typename T , size_t S, size_t N>
T* vnix::mv::mref< T, S, N >::beg_
private

Pointer to first element.

Definition at line 44 of file example1.cpp.


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