27 template<
typename... CONDITIONS>
28 struct and_ : std::true_type {};
30 template<
typename CONDITION,
typename... CONDITIONS>
31 struct and_<CONDITION, CONDITIONS...>
32 : std::conditional<CONDITION::value, and_<CONDITIONS...>, std::false_type>::
35 template<
typename TARGET,
typename... TARGETS>
42 enum class axis : size_t { x = 0, y = 1, z = 2 };
57 template<
typename TYPE,
size_t DIMENSION,
size_t NAMESPACE>
72 assert(list.size() == DIMENSION &&
"dimension size mismatch");
73 auto p = list.begin();
82 template<
typename... ARGS,
83 typename =
typename std::enable_if<
sizeof...(ARGS) == DIMENSION &&
101 static constexpr
size_t size() {
110 template<
typename ENUM_TYPE>
112 return data_[
static_cast<size_t>(e)];
120 template<
typename ENUM_TYPE>
122 return data_[
static_cast<size_t>(e)];
142 for(
size_t i = 0; i < DIMENSION; i++) {
153 #define define_operator(op) \ 154 constexpr dimensioned_array & operator op(dimensioned_array const & rhs) { \ 156 for(size_t i{0}; i < DIMENSION; i++) { \ 157 data_[i] op rhs[i]; \ 168 #define define_operator_type(op) \ 169 constexpr dimensioned_array & operator op(TYPE val) { \ 170 for(size_t i{0}; i < DIMENSION; i++) { \ 187 define_operator_type(+=);
199 define_operator_type(-=);
211 define_operator_type(*=);
223 define_operator_type(/=);
230 return this->data_ == da.data_;
244 std::array<TYPE, DIMENSION> data_;
259 template<
typename TYPE,
size_t DIMENSION,
size_t NAMESPACE>
279 template<
typename TYPE,
size_t DIMENSION,
size_t NAMESPACE>
302 template<
typename TYPE,
size_t DIMENSION,
size_t NAMESPACE>
308 for(
size_t i = 0; i < DIMENSION; i++) {
309 stream <<
" " << a[i];
constexpr dimensioned_array(ARGS... args)
Variadic constructor.
Definition: dimensioned_array.hh:85
constexpr dimensioned_array & operator=(const TYPE &val)
Assignment operator.
Definition: dimensioned_array.hh:141
constexpr TYPE & operator[](ENUM_TYPE e)
Definition: dimensioned_array.hh:111
constexpr dimensioned_array< TYPE, DIMENSION, NAMESPACE > operator+(const dimensioned_array< TYPE, DIMENSION, NAMESPACE > &lhs, const dimensioned_array< TYPE, DIMENSION, NAMESPACE > &rhs)
Definition: dimensioned_array.hh:261
std::ostream & operator<<(std::ostream &ostr, const filling_curve< D, T, DER > &k)
output for filling_curve using output_ function defined in the class
Definition: filling_curve.hh:206
constexpr dimensioned_array operator/(TYPE val)
Division operator involving a constant.
Definition: dimensioned_array.hh:236
std::string type()
Definition: demangle.hh:44
axis
Enumeration for axes.
Definition: dimensioned_array.hh:42
constexpr dimensioned_array(std::initializer_list< TYPE > list)
Initializer list constructor.
Definition: dimensioned_array.hh:71
constexpr bool operator==(const dimensioned_array &da)
Equality operator.
Definition: dimensioned_array.hh:229
constexpr dimensioned_array(TYPE const &val)
Constructor (fill with given value).
Definition: dimensioned_array.hh:92
Definition: dimensioned_array.hh:58
constexpr dimensioned_array & operator=(dimensioned_array const &rhs)
Assignment operator.
Definition: dimensioned_array.hh:129
constexpr dimensioned_array< TYPE, DIMENSION, NAMESPACE > operator-(const dimensioned_array< TYPE, DIMENSION, NAMESPACE > &lhs, const dimensioned_array< TYPE, DIMENSION, NAMESPACE > &rhs)
Definition: dimensioned_array.hh:281
constexpr TYPE const & operator[](ENUM_TYPE e) const
Definition: dimensioned_array.hh:121
static constexpr size_t size()
Return the size of the array.
Definition: dimensioned_array.hh:101
Definition: dimensioned_array.hh:28
Definition: control.hh:31