#include <array>
#include <cmath>
#include <ostream>
#include "flecsi/util/common.hh"
Go to the source code of this file.
|
#define | define_operator(op) |
|
#define | define_operator_type(op) |
|
|
template<typename TARGET , typename... TARGETS> |
using | flecsi::util::are_type = and_< std::is_same< TARGETS, TARGET >... > |
|
|
template<typename TYPE , size_t DIMENSION, size_t NAMESPACE> |
constexpr dimensioned_array< TYPE, DIMENSION, NAMESPACE > | flecsi::util::operator+ (const dimensioned_array< TYPE, DIMENSION, NAMESPACE > &lhs, const dimensioned_array< TYPE, DIMENSION, NAMESPACE > &rhs) |
|
template<typename TYPE , size_t DIMENSION, size_t NAMESPACE> |
constexpr dimensioned_array< TYPE, DIMENSION, NAMESPACE > | flecsi::util::operator- (const dimensioned_array< TYPE, DIMENSION, NAMESPACE > &lhs, const dimensioned_array< TYPE, DIMENSION, NAMESPACE > &rhs) |
|
template<typename TYPE , size_t DIMENSION, size_t NAMESPACE> |
std::ostream & | flecsi::util::operator<< (std::ostream &stream, dimensioned_array< TYPE, DIMENSION, NAMESPACE > const &a) |
|
◆ define_operator
#define define_operator |
( |
|
op | ) |
|
Value:constexpr dimensioned_array & operator op(dimensioned_array const & rhs) { \
if(this != &rhs) { \
for(size_t i{0}; i < DIMENSION; i++) { \
data_[i] op rhs[i]; \
} \
} \
\
return *this; \
}
◆ define_operator_type
#define define_operator_type |
( |
|
op | ) |
|
Value:constexpr dimensioned_array & operator op(TYPE val) { \
for(size_t i{0}; i < DIMENSION; i++) { \
data_[i] op val; \
} \
\
return *this; \
}
◆ operator+()
template<typename TYPE , size_t DIMENSION, size_t NAMESPACE>
constexpr dimensioned_array<TYPE, DIMENSION, NAMESPACE> flecsi::util::operator+ |
( |
const dimensioned_array< TYPE, DIMENSION, NAMESPACE > & |
lhs, |
|
|
const dimensioned_array< TYPE, DIMENSION, NAMESPACE > & |
rhs |
|
) |
| |
Addition operator.
- Template Parameters
-
TYPE | The type of the array, e.g., P.O.D. type. |
DIMENSION | The dimension of the array, i.e., the number of elements to be stored in the array. |
NAMESPACE | The namespace of the array. This is a dummy parameter that is useful for creating distinct types that alias dimensioned_array. |
◆ operator-()
template<typename TYPE , size_t DIMENSION, size_t NAMESPACE>
constexpr dimensioned_array<TYPE, DIMENSION, NAMESPACE> flecsi::util::operator- |
( |
const dimensioned_array< TYPE, DIMENSION, NAMESPACE > & |
lhs, |
|
|
const dimensioned_array< TYPE, DIMENSION, NAMESPACE > & |
rhs |
|
) |
| |
Addition operator.
- Template Parameters
-
TYPE | The type of the array, e.g., P.O.D. type. |
DIMENSION | The dimension of the array, i.e., the number of elements to be stored in the array. |
NAMESPACE | The namespace of the array. This is a dummy parameter that is useful for creating distinct types that alias dimensioned_array. |
◆ operator<<()
template<typename TYPE , size_t DIMENSION, size_t NAMESPACE>
std::ostream& flecsi::util::operator<< |
( |
std::ostream & |
stream, |
|
|
dimensioned_array< TYPE, DIMENSION, NAMESPACE > const & |
a |
|
) |
| |
Addition operator.
- Template Parameters
-
TYPE | The type of the array, e.g., P.O.D. type. |
DIMENSION | The dimension of the array, i.e., the number of elements to be stored in the array. |
NAMESPACE | The namespace of the array. This is a dummy parameter that is useful for creating distinct types that alias dimensioned_array. |
- Parameters
-
stream | The output stream. |
a | The dimensioned array. |