lin
Public Types | Public Member Functions | Private Attributes | List of all members
lin::internal::StreamConstants< T, R, C, MR, MC > Class Template Reference

Tensor stream where all element accesses return the same constant value. More...

#include <lin/generators/stream_constants.hpp>

Inheritance diagram for lin::internal::StreamConstants< T, R, C, MR, MC >:
lin::internal::Stream< StreamConstants< T, R, C, MR, MC > > lin::internal::Dimensions< StreamConstants< T, R, C, MR, MC > >

Public Types

typedef traits< StreamConstants< T, R, C, MR, MC > > Traits
 Traits information for this type. More...
 
- Public Types inherited from lin::internal::Stream< StreamConstants< T, R, C, MR, MC > >
typedef traits< StreamConstants< T, R, C, MR, MC > > Traits
 Traits information for this type. More...
 

Public Member Functions

constexpr StreamConstants (StreamConstants< T, R, C, MR, MC > const &)=default
 
constexpr StreamConstants (StreamConstants< T, R, C, MR, MC > &&)=default
 
constexpr StreamConstants< T, R, C, MR, MC > & operator= (StreamConstants< T, R, C, MR, MC > const &)=default
 
constexpr StreamConstants< T, R, C, MR, MC > & operator= (StreamConstants< T, R, C, MR, MC > &&)=default
 
constexpr StreamConstants (T t, size_t r, size_t c)
 Constructs a tensor constants stream of the requested size and value. More...
 
constexpr Traits::elem_t operator() (size_t i, size_t j) const
 Retrieves the requested tensor elements value, which, in this case is a specified constant. More...
 
constexpr Traits::elem_t operator() (size_t i) const
 Retrieves the requested tensor elements value, which, in this case is a specified constant. More...
 
- Public Member Functions inherited from lin::internal::Stream< StreamConstants< T, R, C, MR, MC > >
constexpr Stream (Stream< StreamConstants< T, R, C, MR, MC > > const &)=default
 
constexpr Stream (Stream< StreamConstants< T, R, C, MR, MC > > &&)=default
 
constexpr Stream< StreamConstants< T, R, C, MR, MC > > & operator= (Stream< StreamConstants< T, R, C, MR, MC > > const &)=default
 
constexpr Stream< StreamConstants< T, R, C, MR, MC > > & operator= (Stream< StreamConstants< T, R, C, MR, MC > > &&)=default
 
constexpr size_t rows () const
 
constexpr size_t cols () const
 
constexpr size_t size () const
 
constexpr Traits::elem_t operator() (size_t i, size_t j) const
 Provides read only access to tensor elements. More...
 
constexpr Traits::elem_t operator() (size_t i) const
 Provides read only access to tensor elements. More...
 
constexpr Traits::elem_t operator[] (size_t i) const
 Provides read only access to tensor elements. More...
 
constexpr Traits::eval_t eval () const
 Forces evaluation of this stream to a value backed type. More...
 
- Public Member Functions inherited from lin::internal::Dimensions< StreamConstants< T, R, C, MR, MC > >
constexpr Dimensions (Dimensions< StreamConstants< T, R, C, MR, MC > > const &)=default
 
constexpr Dimensions (Dimensions< StreamConstants< T, R, C, MR, MC > > &&)=default
 
constexpr Dimensions< StreamConstants< T, R, C, MR, MC > > & operator= (Dimensions< StreamConstants< T, R, C, MR, MC > > const &)=default
 
constexpr Dimensions< StreamConstants< T, R, C, MR, MC > > & operator= (Dimensions< StreamConstants< T, R, C, MR, MC > > &&)=default
 
constexpr size_t rows () const
 
constexpr size_t cols () const
 
constexpr void resize (size_t r, size_t c)
 Resizes a tensor's dimensions. More...
 

Private Attributes

Traits::elem_t const t
 Constant value returned by element accesses.
 

Additional Inherited Members

- Protected Member Functions inherited from lin::internal::Stream< StreamConstants< T, R, C, MR, MC > >
constexpr StreamConstants< T, R, C, MR, MC > & derived ()
 
constexpr StreamConstants< T, R, C, MR, MC >const & derived () const
 

Detailed Description

template<typename T, size_t R, size_t C, size_t MR, size_t MC>
class lin::internal::StreamConstants< T, R, C, MR, MC >

Tensor stream where all element accesses return the same constant value.

Template Parameters
TStream element type.
RRows at compile time.
CColumns at compile time.
MRMaximum rows at compile time.
MCMaximum columns at compile time.

This is most commonly use to implement generators that produce tensor whose elements are filled by a single constant value.

See also
consts
nans
ones
zeros

Member Typedef Documentation

template<typename T, size_t R, size_t C, size_t MR, size_t MC>
typedef traits<StreamConstants<T, R, C, MR, MC> > lin::internal::StreamConstants< T, R, C, MR, MC >::Traits

Traits information for this type.

See also
internal::traits

Constructor & Destructor Documentation

template<typename T, size_t R, size_t C, size_t MR, size_t MC>
constexpr lin::internal::StreamConstants< T, R, C, MR, MC >::StreamConstants ( t,
size_t  r,
size_t  c 
)
inline

Constructs a tensor constants stream of the requested size and value.

Parameters
[in]tValue of the stream's elements.
[in]rRow count.
[in]cColumn count.

Member Function Documentation

template<typename T, size_t R, size_t C, size_t MR, size_t MC>
constexpr Traits::elem_t lin::internal::StreamConstants< T, R, C, MR, MC >::operator() ( size_t  i,
size_t  j 
) const
inline

Retrieves the requested tensor elements value, which, in this case is a specified constant.

Parameters
iRow index.
jColumn index.
Returns
Value of the tensor element.
template<typename T, size_t R, size_t C, size_t MR, size_t MC>
constexpr Traits::elem_t lin::internal::StreamConstants< T, R, C, MR, MC >::operator() ( size_t  i) const
inline

Retrieves the requested tensor elements value, which, in this case is a specified constant.

Parameters
iIndex.
Returns
Value of the tensor element.

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