|
MiniTensor Version of the Day
|
Sacado-aware type promotion machinery, index types, and scalar-level helpers such as machine_epsilon and not_a_number. More...
Typedefs | |
| using | minitensor::Index = uint32_t |
| Indexing type. | |
| using | minitensor::LongIndex = uint64_t |
| High count type. | |
| using | minitensor::Real = double |
| Floating point type. | |
| using | minitensor::Complex = std::complex< Real > |
| Complex type. | |
Functions | |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION T | minitensor::abs (T const &a) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION void | minitensor::swap (T &a, T &b) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION T | minitensor::max (T const &a, T const &b) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION T | minitensor::min (T const &a, T const &b) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION int | minitensor::sgn (T const &s) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION T | minitensor::copysign (T const &a, T const &b) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION Sacado::ScalarType< T >::type | minitensor::not_a_number () |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION Sacado::ScalarType< T >::type | minitensor::machine_epsilon () |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION Index | minitensor::num_digits () |
| template<> | |
| KOKKOS_INLINE_FUNCTION Index | minitensor::num_digits< Index > () |
| template<> | |
| KOKKOS_INLINE_FUNCTION Index | minitensor::num_digits< LongIndex > () |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION Sacado::ScalarType< T >::type | minitensor::tau () |
| template<typename T > | |
| Sacado::ScalarType< T >::type | minitensor::random () |
| template<typename T > | |
| Sacado::ScalarType< T >::type | minitensor::random_uniform () |
| template<typename T > | |
| Sacado::ScalarType< T >::type | minitensor::random_normal () |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION void | minitensor::fill_AD (typename enable_if< is_same< T, typename ScalarType< T >::type >::value, T >::type &x, typename ScalarType< T >::type const c) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION void | minitensor::fill_AD (typename enable_if<!is_same< T, typename ScalarType< T >::type >::value, T >::type &x, typename ScalarType< T >::type const c) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION T | minitensor::integer_power (T const &X, Index const exponent) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION T | minitensor::integer_root (T const &x, Index const root) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION T | minitensor::kronecker_delta (Index const i, Index const j) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION T | minitensor::kronecker_delta (Index const i, Index const j, Index const k) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION T | minitensor::kronecker_delta (Index const i, Index const j, Index const k, Index const l) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION T | minitensor::levi_civita (Index const i, Index const j) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION T | minitensor::levi_civita (Index const i, Index const j, Index const k) |
| template<typename T > | |
| KOKKOS_INLINE_FUNCTION T | minitensor::levi_civita (Index const i, Index const j, Index const k, Index const l) |
Variables | |
| constexpr Index | minitensor::INDEX_SIZE {32} |
| constexpr Index | minitensor::LONG_INDEX_SIZE {64} |
| constexpr Index | minitensor::DYNAMIC {0} |
| Indicator for dynamic storage. | |
| template<Index N, Index D> | |
| constexpr bool | minitensor::dimension_reachable {N == DYNAMIC || N >= D} |
Sacado-aware type promotion machinery, index types, and scalar-level helpers such as machine_epsilon and not_a_number.
| using minitensor::Index = typedef uint32_t |
Indexing type.
Definition at line 50 of file MiniTensor_Traits.h.
| using minitensor::LongIndex = typedef uint64_t |
High count type.
Definition at line 59 of file MiniTensor_Traits.h.
| using minitensor::Real = typedef double |
Floating point type.
Definition at line 68 of file MiniTensor_Traits.h.
| using minitensor::Complex = typedef std::complex<Real> |
Complex type.
Definition at line 71 of file MiniTensor_Traits.h.
| KOKKOS_INLINE_FUNCTION T minitensor::abs | ( | T const & | a | ) |
Absolute value, usable on host and device.
Definition at line 244 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION void minitensor::swap | ( | T & | a, |
| T & | b | ||
| ) |
Swap two values, usable on host and device.
Definition at line 258 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION T minitensor::max | ( | T const & | a, |
| T const & | b | ||
| ) |
Maximum of two values, usable on host and device.
Definition at line 277 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION T minitensor::min | ( | T const & | a, |
| T const & | b | ||
| ) |
Minimum of two values, usable on host and device.
Definition at line 291 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION int minitensor::sgn | ( | T const & | s | ) |
Sign function
Definition at line 302 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION T minitensor::copysign | ( | T const & | a, |
| T const & | b | ||
| ) |
Copysign function
Definition at line 313 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION Sacado::ScalarType< T >::type minitensor::not_a_number | ( | ) |
NaN function. Necessary to choose the proper underlying NaN for non-floating-point types. Assumption: non-floating-point types have a typedef that determines the underlying floating-point type.
Definition at line 327 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION Sacado::ScalarType< T >::type minitensor::machine_epsilon | ( | ) |
Machine epsilon function. Necessary to choose the proper underlying machine epsilon for non-floating-point types. Assumption: non-floating-point types have a typedef that determines the underlying floating-point type.
Definition at line 342 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION Index minitensor::num_digits | ( | ) |
Number of digits for integer types.
Definition at line 354 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION Index minitensor::num_digits< Index > | ( | ) |
Number of binary digits in Index.
Definition at line 361 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION Index minitensor::num_digits< LongIndex > | ( | ) |
Number of binary digits in LongIndex.
Definition at line 369 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION Sacado::ScalarType< T >::type minitensor::tau | ( | ) |
The circle constant
Definition at line 381 of file MiniTensor_Scalar.h.
| Sacado::ScalarType< T >::type minitensor::random | ( | ) |
Random number generation. Uniform distribution U(-1,1).
Definition at line 392 of file MiniTensor_Scalar.h.
| Sacado::ScalarType< T >::type minitensor::random_uniform | ( | ) |
Random number generation. Uniform distribution U(0,1).
Definition at line 401 of file MiniTensor_Scalar.h.
| Sacado::ScalarType< T >::type minitensor::random_normal | ( | ) |
Random number generation. Normal distribution N(0,1).
Definition at line 409 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION void minitensor::fill_AD | ( | typename enable_if< is_same< T, typename ScalarType< T >::type >::value, T >::type & | x, |
| typename ScalarType< T >::type const | c | ||
| ) |
Fill a non-AD scalar with a constant.
Definition at line 429 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION void minitensor::fill_AD | ( | typename enable_if<!is_same< T, typename ScalarType< T >::type >::value, T >::type & | x, |
| typename ScalarType< T >::type const | c | ||
| ) |
Fill an AD scalar with a constant, handling its derivative components.
Definition at line 443 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION T minitensor::integer_power | ( | T const & | X, |
| Index const | exponent | ||
| ) |
Compute a non-negative integer power by binary manipulation.
Definition at line 468 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION T minitensor::integer_root | ( | T const & | x, |
| Index const | root | ||
| ) |
Compute a non-negative integer root by bisection.
Definition at line 548 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION T minitensor::kronecker_delta | ( | Index const | i, |
| Index const | j | ||
| ) |
Utility for Kronecker delta in 2D
Definition at line 580 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION T minitensor::kronecker_delta | ( | Index const | i, |
| Index const | j, | ||
| Index const | k | ||
| ) |
Utility for Kronecker delta in 3D
Definition at line 596 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION T minitensor::kronecker_delta | ( | Index const | i, |
| Index const | j, | ||
| Index const | k, | ||
| Index const | l | ||
| ) |
Utility for Kronecker delta in 4D
Definition at line 613 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION T minitensor::levi_civita | ( | Index const | i, |
| Index const | j | ||
| ) |
Utility for Levi-Civita/permutation/alternating symbol in 2D
Definition at line 631 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION T minitensor::levi_civita | ( | Index const | i, |
| Index const | j, | ||
| Index const | k | ||
| ) |
Utility for Levi-Civita/permutation/alternating symbol in 3D
Definition at line 649 of file MiniTensor_Scalar.h.
| KOKKOS_INLINE_FUNCTION T minitensor::levi_civita | ( | Index const | i, |
| Index const | j, | ||
| Index const | k, | ||
| Index const | l | ||
| ) |
Utility for Levi-Civita/permutation/alternating symbol in 4D
Definition at line 672 of file MiniTensor_Scalar.h.
|
constexpr |
Number of bits in Index.
Definition at line 56 of file MiniTensor_Traits.h.
|
constexpr |
Number of bits in LongIndex.
Definition at line 65 of file MiniTensor_Traits.h.
|
constexpr |
Indicator for dynamic storage.
Definition at line 82 of file MiniTensor_Traits.h.
|
inlineconstexpr |
Whether a container whose static dimension is N can ever have the run-time dimension D. Dynamically sized containers can have any dimension, statically sized ones are bounded by N. Use it with if constexpr to discard the branches of a dimension dispatch that a statically sized argument can never take, and that would otherwise look to the compiler like accesses past the end of its storage.
Definition at line 94 of file MiniTensor_Traits.h.