SuperDex Physics C++ API
Loading...
Searching...
No Matches
nd_array.h File Reference
#include <mochi_core/mochi_config.h>
#include <mochi_core/utils/concepts.h>
#include <mochi_core/utils/debug.h>
#include <mochi_core/utils/reflection.h>
#include <algorithm>
#include <array>
#include <type_traits>

Go to the source code of this file.

Classes

struct  superdex::Int2Hash
struct  superdex::Int2Less
struct  superdex::Int3SortAndCompare
struct  superdex::Int3SortAndHash
struct  superdex::IsNdArray< T >
struct  superdex::IsNdArray< NdArray< T, D0, DIMS... > >
class  superdex::NdArray< T, D0, DIMS >

Namespaces

namespace  superdex

Macros

#define MOCHI_DETAILS_NDARRAY_MEMBERWISE_OP(OP_EQ, OP)
#define MOCHI_DETAILS_UNROLL_D0(BODY)

Typedefs

using superdex::Double2 = NdArray<double, 2>
using superdex::Double3 = NdArray<double, 3>
using superdex::Double4 = NdArray<double, 4>
using superdex::Float2 = NdArray<float, 2>
using superdex::Float3 = NdArray<float, 3>
using superdex::Float4 = NdArray<float, 4>
using superdex::Int2 = NdArray<int, 2>
using superdex::Int3 = NdArray<int, 3>
using superdex::Int4 = NdArray<int, 4>
using superdex::Matrix2x2f = NdArray<float, 2, 2>
using superdex::Matrix2x2r = NdArray<real, 2, 2>
using superdex::Matrix2x3f = NdArray<float, 2, 3>
using superdex::Matrix2x3r = NdArray<real, 2, 3>
using superdex::Matrix3x2f = NdArray<float, 3, 2>
using superdex::Matrix3x2r = NdArray<real, 3, 2>
using superdex::Matrix3x3f = NdArray<float, 3, 3>
using superdex::Matrix3x3r = NdArray<real, 3, 3>
using superdex::Matrix4x3f = NdArray<float, 4, 3>
using superdex::Matrix4x3r = NdArray<real, 4, 3>
using superdex::Matrix4x4f = NdArray<float, 4, 4>
using superdex::Matrix4x4r = NdArray<real, 4, 4>
using superdex::Real1 = NdArray<real, 1>
using superdex::Real2 = NdArray<real, 2>
using superdex::Real3 = NdArray<real, 3>
using superdex::Real4 = NdArray<real, 4>
using superdex::Real5 = NdArray<real, 5>
using superdex::Real6 = NdArray<real, 6>
using superdex::Tensor3x3x3f = NdArray<float, 3, 3, 3>
using superdex::Tensor3x3x3r = NdArray<real, 3, 3, 3>
using superdex::Tensor3x3x3x3f = NdArray<float, 3, 3, 3, 3>
using superdex::Tensor3x3x3x3r = NdArray<real, 3, 3, 3, 3>

Functions

template<typename A>
constexpr A superdex::MultiplyConstexpr (A a)
template<typename A, typename... ARGS>
constexpr A superdex::MultiplyConstexpr (A a, ARGS... args)
template<typename T, size_t D0, size_t... DIMS>
constexpr bool superdex::operator!= (NdArray< T, D0, DIMS... > const &lhs, NdArray< T, D0, DIMS... > const &rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > superdex::operator* (NdArray< T, D0, DIMS... > const &lhs, NdArray< T, D0, DIMS... > const &rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > superdex::operator* (NdArray< T, D0, DIMS... > const &lhs, T rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > superdex::operator* (T lhs, NdArray< T, D0, DIMS... > const &rhs)
template<typename T, size_t D0, size_t... DIMS, typename AnyRHS>
constexpr NdArray< T, D0, DIMS... > & superdex::operator*= (NdArray< T, D0, DIMS... > &lhs, AnyRHS const &rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > & superdex::operator*= (NdArray< T, D0, DIMS... > &lhs, NdArray< T, D0, DIMS... > const &rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > & superdex::operator*= (NdArray< T, D0, DIMS... > &lhs, T rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > superdex::operator+ (NdArray< T, D0, DIMS... > const &lhs, NdArray< T, D0, DIMS... > const &rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > superdex::operator+ (NdArray< T, D0, DIMS... > const &lhs, T rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > superdex::operator+ (T lhs, NdArray< T, D0, DIMS... > const &rhs)
template<typename T, size_t D0, size_t... DIMS, typename AnyRHS>
constexpr NdArray< T, D0, DIMS... > & superdex::operator+= (NdArray< T, D0, DIMS... > &lhs, AnyRHS const &rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > & superdex::operator+= (NdArray< T, D0, DIMS... > &lhs, NdArray< T, D0, DIMS... > const &rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > & superdex::operator+= (NdArray< T, D0, DIMS... > &lhs, T rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > superdex::operator- (NdArray< T, D0, DIMS... > const &a)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > superdex::operator- (NdArray< T, D0, DIMS... > const &lhs, NdArray< T, D0, DIMS... > const &rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > superdex::operator- (NdArray< T, D0, DIMS... > const &lhs, T rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > superdex::operator- (T lhs, NdArray< T, D0, DIMS... > const &rhs)
template<typename T, size_t D0, size_t... DIMS, typename AnyRHS>
constexpr NdArray< T, D0, DIMS... > & superdex::operator-= (NdArray< T, D0, DIMS... > &lhs, AnyRHS const &rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > & superdex::operator-= (NdArray< T, D0, DIMS... > &lhs, NdArray< T, D0, DIMS... > const &rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > & superdex::operator-= (NdArray< T, D0, DIMS... > &lhs, T rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > superdex::operator/ (NdArray< T, D0, DIMS... > const &lhs, NdArray< T, D0, DIMS... > const &rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > superdex::operator/ (NdArray< T, D0, DIMS... > const &lhs, T rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > superdex::operator/ (T lhs, NdArray< T, D0, DIMS... > const &rhs)
template<typename T, size_t D0, size_t... DIMS, typename AnyRHS>
constexpr NdArray< T, D0, DIMS... > & superdex::operator/= (NdArray< T, D0, DIMS... > &lhs, AnyRHS const &rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > & superdex::operator/= (NdArray< T, D0, DIMS... > &lhs, NdArray< T, D0, DIMS... > const &rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr NdArray< T, D0, DIMS... > & superdex::operator/= (NdArray< T, D0, DIMS... > &lhs, T rhs)
template<typename T, size_t D0, size_t... DIMS>
constexpr bool superdex::operator== (NdArray< T, D0, DIMS... > const &lhs, NdArray< T, D0, DIMS... > const &rhs)

Variables

template<typename T>
static constexpr bool superdex::kIsNdArray = IsNdArray<std::decay_t<T>>::value

Macro Definition Documentation

◆ MOCHI_DETAILS_NDARRAY_MEMBERWISE_OP

#define MOCHI_DETAILS_NDARRAY_MEMBERWISE_OP ( OP_EQ,
OP )

Definition at line 237 of file nd_array.h.

◆ MOCHI_DETAILS_UNROLL_D0

#define MOCHI_DETAILS_UNROLL_D0 ( BODY)
Value:
if constexpr (D0 <= 4) { \
if constexpr (D0 > 0) { \
constexpr size_t i = 0; \
BODY; \
} \
if constexpr (D0 > 1) { \
constexpr size_t i = 1; \
BODY; \
} \
if constexpr (D0 > 2) { \
constexpr size_t i = 2; \
BODY; \
} \
if constexpr (D0 > 3) { \
constexpr size_t i = 3; \
BODY; \
} \
} else { \
for (size_t i = 0; i < D0; ++i) { \
BODY; \
} \
}

Definition at line 155 of file nd_array.h.