lin
Public Member Functions | List of all members
lin::internal::Dimensions< D, typename > Class Template Reference

Tracks the runtime dimensions of a tensor object. More...

#include <lin/core/types/dimensions.hpp>

Public Member Functions

constexpr Dimensions (Dimensions< D > const &)=default
 
constexpr Dimensions (Dimensions< D > &&)=default
 
constexpr Dimensions< D > & operator= (Dimensions< D > const &)=default
 
constexpr Dimensions< D > & operator= (Dimensions< D > &&)=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...
 

Detailed Description

template<class D, typename = void>
class lin::internal::Dimensions< D, typename >

Tracks the runtime dimensions of a tensor object.

Template Parameters
DDerived type.

This functionality is broken out as a separate object so we only include member variables for tensor dimensions that aren't of a fixed size. There is a template specialization of this class for each of the following cases:

The specialization for fixed rows and columns, for example, has no additional member variables while the the specialization for fixed rows and stricly bounded columns requires one additional member variables to track the number of columns at runtime.

See also
internal::Base
internal::has_fixed_rows
internal::has_fixed_cols
internal::has_strictly_bounded_rows
internal::has_strictly_bounded_cols

Member Function Documentation

template<class D, typename = void>
constexpr size_t lin::internal::Dimensions< D, typename >::rows ( ) const
inline
Returns
Number of rows.
template<class D, typename = void>
constexpr size_t lin::internal::Dimensions< D, typename >::cols ( ) const
inline
Returns
Number of columns.
template<class D, typename = void>
constexpr void lin::internal::Dimensions< D, typename >::resize ( size_t  r,
size_t  c 
)
inline

Resizes a tensor's dimensions.

Parameters
rNumber of rows.
cNumber of columns.

Lin assertions errors will be triggered if the requested dimensions aren't possible given the tensor's traits.

See also
internal::has_fixed_rows
internal::has_fixed_cols
internal::has_strictly_bounded_rows
internal::has_strictly_bounded_cols

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