Lightweight wrapper around a c-array.
More...
#include <Tensor.hpp>
|
using | value_type = T |
| Alias for type template parameter.
|
|
|
T const & | operator[] (std::ptrdiff_t const i) const |
| Const element access. More...
|
|
T & | operator[] (std::ptrdiff_t const i) |
| Non-const element access. More...
|
|
template<typename U = T> |
std::enable_if_t< std::is_floating_point< U >::value, bool > | operator== (Tensor< U, SIZE > const &rhs) const |
| Equality comparison operator. More...
|
|
template<typename U = T> |
std::enable_if_t< !std::is_floating_point< U >::value, bool > | operator== (Tensor< U, SIZE > const &rhs) const |
| Equality comparison operator. More...
|
|
constexpr int | size (int junk) const |
| Returns the size of the tensor. More...
|
|
|
static constexpr int | SIZE = SIZE_TPARAM |
| Alias for size template parameter.
|
|
template<typename T, int SIZE_TPARAM>
class geosx::Tensor< T, SIZE_TPARAM >
Lightweight wrapper around a c-array.
- Template Parameters
-
T | data type |
SIZE_TPARAM | number of values |
Definition at line 29 of file Tensor.hpp.
◆ operator==() [1/2]
template<typename T, int SIZE_TPARAM>
template<typename U = T>
std::enable_if_t< std::is_floating_point< U >::value, bool > geosx::Tensor< T, SIZE_TPARAM >::operator== |
( |
Tensor< U, SIZE > const & |
rhs | ) |
const |
|
inline |
Equality comparison operator.
- Template Parameters
-
U | dummy parameter to enable SFINAE, do not provide explicitly |
- Parameters
-
rhs | the right-hand side value to compare to |
- Returns
- true iff
- Note
- Version for floating point types that avoids direct equality comparison.
Definition at line 76 of file Tensor.hpp.
◆ operator==() [2/2]
template<typename T, int SIZE_TPARAM>
template<typename U = T>
std::enable_if_t< !std::is_floating_point< U >::value, bool > geosx::Tensor< T, SIZE_TPARAM >::operator== |
( |
Tensor< U, SIZE > const & |
rhs | ) |
const |
|
inline |
Equality comparison operator.
- Template Parameters
-
U | dummy parameter to enable SFINAE, do not provide explicitly |
- Parameters
-
rhs | the right-hand side value to compare to |
- Returns
- true iff
- Note
- Version for all types except floating point.
Definition at line 99 of file Tensor.hpp.
◆ operator[]() [1/2]
template<typename T, int SIZE_TPARAM>
T const& geosx::Tensor< T, SIZE_TPARAM >::operator[] |
( |
std::ptrdiff_t const |
i | ) |
const |
|
inline |
Const element access.
- Parameters
-
- Returns
- const reference to the i-th element
Definition at line 48 of file Tensor.hpp.
◆ operator[]() [2/2]
template<typename T, int SIZE_TPARAM>
T& geosx::Tensor< T, SIZE_TPARAM >::operator[] |
( |
std::ptrdiff_t const |
i | ) |
|
|
inline |
Non-const element access.
- Parameters
-
- Returns
- reference to the i-th element
Definition at line 60 of file Tensor.hpp.
◆ size()
template<typename T, int SIZE_TPARAM>
constexpr int geosx::Tensor< T, SIZE_TPARAM >::size |
( |
int |
junk | ) |
const |
|
inline |
Returns the size of the tensor.
- Parameters
-
- Returns
- The value of the template parameter SIZE.
Definition at line 118 of file Tensor.hpp.
◆ operator<<
template<typename T, int SIZE_TPARAM>
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
Tensor< T, SIZE > const & |
t |
|
) |
| |
|
friend |
Stream insertion operator for Tensor.
- Parameters
-
os | the output stream |
t | the tensor value |
- Returns
- reference to
os
Definition at line 135 of file Tensor.hpp.
The documentation for this class was generated from the following file: