MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::vec::strided_vector_ref< Value > Class Template Reference

Non-owning reference to strided data: pointer + length + stride. More...

#include <strided_vector_ref.hpp>

Classes

class  strided_iterator

Public Types

using value_type = Value
using size_type = std::size_t
using reference = Value&
using const_reference = const Value&
using pointer = Value*
using const_pointer = const Value*
using iterator = strided_iterator<pointer>
using const_iterator = strided_iterator<const_pointer>

Public Member Functions

 strided_vector_ref (pointer data, size_type length, size_type stride)
 Construct from raw pointer, length, and stride.
reference operator() (size_type i)
const_reference operator() (size_type i) const
reference operator[] (size_type i)
const_reference operator[] (size_type i) const
size_type size () const
size_type stride () const
pointer data () const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const

Detailed Description

template<typename Value>
class mtl::vec::strided_vector_ref< Value >

Non-owning reference to strided data: pointer + length + stride.

Element i lives at data_[i * stride_]. Stride 0 is allowed: every element is data_[0], as for a broadcast scalar.

Member Typedef Documentation

◆ const_iterator

template<typename Value>
using mtl::vec::strided_vector_ref< Value >::const_iterator = strided_iterator<const_pointer>

◆ const_pointer

template<typename Value>
using mtl::vec::strided_vector_ref< Value >::const_pointer = const Value*

◆ const_reference

template<typename Value>
using mtl::vec::strided_vector_ref< Value >::const_reference = const Value&

◆ iterator

template<typename Value>
using mtl::vec::strided_vector_ref< Value >::iterator = strided_iterator<pointer>

◆ pointer

template<typename Value>
using mtl::vec::strided_vector_ref< Value >::pointer = Value*

◆ reference

template<typename Value>
using mtl::vec::strided_vector_ref< Value >::reference = Value&

◆ size_type

template<typename Value>
using mtl::vec::strided_vector_ref< Value >::size_type = std::size_t

◆ value_type

template<typename Value>
using mtl::vec::strided_vector_ref< Value >::value_type = Value

Constructor & Destructor Documentation

◆ strided_vector_ref()

template<typename Value>
mtl::vec::strided_vector_ref< Value >::strided_vector_ref ( pointer data,
size_type length,
size_type stride )
inline

Construct from raw pointer, length, and stride.

Member Function Documentation

◆ begin() [1/2]

template<typename Value>
iterator mtl::vec::strided_vector_ref< Value >::begin ( )
inline

◆ begin() [2/2]

template<typename Value>
const_iterator mtl::vec::strided_vector_ref< Value >::begin ( ) const
inline

◆ data()

template<typename Value>
pointer mtl::vec::strided_vector_ref< Value >::data ( ) const
inline

◆ end() [1/2]

template<typename Value>
iterator mtl::vec::strided_vector_ref< Value >::end ( )
inline

◆ end() [2/2]

template<typename Value>
const_iterator mtl::vec::strided_vector_ref< Value >::end ( ) const
inline

◆ operator()() [1/2]

template<typename Value>
reference mtl::vec::strided_vector_ref< Value >::operator() ( size_type i)
inline

◆ operator()() [2/2]

template<typename Value>
const_reference mtl::vec::strided_vector_ref< Value >::operator() ( size_type i) const
inline

◆ operator[]() [1/2]

template<typename Value>
reference mtl::vec::strided_vector_ref< Value >::operator[] ( size_type i)
inline

◆ operator[]() [2/2]

template<typename Value>
const_reference mtl::vec::strided_vector_ref< Value >::operator[] ( size_type i) const
inline

◆ size()

template<typename Value>
size_type mtl::vec::strided_vector_ref< Value >::size ( ) const
inline

◆ stride()

template<typename Value>
size_type mtl::vec::strided_vector_ref< Value >::stride ( ) const
inline

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