CNum 0.2.1
CPU-optimized ML library for C++
Loading...
Searching...
No Matches
CNum::DataStructs::Views::StrideView< T > Class Template Reference

#include <StrideView.h>

Public Member Functions

 StrideView (T *ptr=nullptr, size_t stride=1, size_t range=0)
 Overloaded default constructor.
StrideIterator< T > begin () const
 Get an iterator to the beginning of a view.
StrideIterator< T > end () const
 Get an iterator to the end of the view.
BinaryMask operator<= (T val)
 Create a binary mask of values less than or equal to another.
size_t size () const
 Get the number of elements in the stride view (n_strides in the view).

Constructor & Destructor Documentation

◆ StrideView()

template<typename T>
CNum::DataStructs::Views::StrideView< T >::StrideView ( T * ptr = nullptr,
size_t stride = 1,
size_t range = 0 )

Overloaded default constructor.

Parameters
ptrRaw pointer to the beginning of the view
strideThe amount of elements in the pointer between each element in the view
rangeThe range of the view (in strides)

Member Function Documentation

◆ begin()

template<typename T>
StrideIterator< T > CNum::DataStructs::Views::StrideView< T >::begin ( ) const

Get an iterator to the beginning of a view.

Returns
The iterator

◆ end()

template<typename T>
StrideIterator< T > CNum::DataStructs::Views::StrideView< T >::end ( ) const

Get an iterator to the end of the view.

Returns
The iterator

◆ operator<=()

template<typename T>
BinaryMask CNum::DataStructs::Views::StrideView< T >::operator<= ( T val)

Create a binary mask of values less than or equal to another.

Returns
Binary mask

◆ size()

template<typename T>
size_t CNum::DataStructs::Views::StrideView< T >::size ( ) const

Get the number of elements in the stride view (n_strides in the view).

Returns
The number of elements

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