Mantid
|
Classes | |
struct | IndexTypes |
This structure determines Morton index type and underlying unsigned integer type for the floating point coordinate type and number of dimensions. More... | |
struct | Interleaver |
struct | Interleaver< ND, IntT, Morton96 > |
struct | MortonIndex |
This structure binds the size of accesible memory to store the Morton index to the Morton index type. More... | |
struct | MortonIndex< 1 > |
struct | MortonIndex< 12 > |
struct | MortonIndex< 16 > |
struct | MortonIndex< 2 > |
struct | MortonIndex< 4 > |
struct | MortonIndex< 8 > |
struct | UnderlyingInt |
This structure binds floating point types to the unsigned integer types of the same width. More... | |
struct | UnderlyingInt< double > |
struct | UnderlyingInt< float > |
Typedefs | |
template<typename CoordT , size_t ND> | |
using | AffineND = Eigen::Transform< CoordT, static_cast< int >(ND), Eigen::Affine > |
template<size_t ND> | |
using | BinIndices = Eigen::Matrix< size_t, 1, static_cast< int >(ND)> |
template<size_t ND, typename IntT > | |
using | IntArray = Eigen::Array< IntT, static_cast< int >(ND), 1 > |
template<size_t ND> | |
using | MDCoordinate = Eigen::Array< float, static_cast< int >(ND), 1 > |
template<size_t ND> | |
using | MDSpaceBounds = Eigen::Array< float, static_cast< int >(ND), 2 > |
template<size_t ND> | |
using | MDSpaceDimensions = Eigen::Array< float, static_cast< int >(ND), 1 > |
template<size_t ND> | |
using | MDSpaceSteps = Eigen::Array< float, static_cast< int >(ND), 1 > |
using | Morton96 = uint96_t |
This class implements the structure of size 96bit, that can be used as Morton index. More... | |
using | uint128_t = std::uint128_t |
using | uint256_t = std::uint256_t |
using | uint96_t = std::wide_uint< 96 > |
Functions | |
template<size_t ND, typename IntT , typename MortonT > | |
MortonT | calculateDefaultBound (IntT intBound) |
template<int ND> | |
size_t | CalculateRequiredCoordinateIntegerWidth (const MDSpaceBounds< ND > &bounds, const MDSpaceSteps< ND > &steps) |
Calculates the required width of the interleaved integer to accurately represent coordinates in a given space at a given resolution. More... | |
template<int ND> | |
bool | CheckCoordinatesInMDSpace (const MDSpaceBounds< ND > &bounds, const MDCoordinate< ND > &coord) |
Checks that a coordinate is within the extents of an MD space. More... | |
template<size_t N, typename IntT , typename MortonT > | |
IntT | compact (MortonT) |
Compacts (removes padding from) an integer with a given number of padding bits. More... | |
template<> | |
uint16_t | compact< 1, uint16_t, uint32_t > (uint32_t x) |
template<> | |
uint16_t | compact< 1, uint16_t, uint64_t > (uint64_t x) |
template<> | |
uint32_t | compact< 1, uint32_t, uint128_t > (uint128_t x) |
template<> | |
uint16_t | compact< 2, uint16_t, uint64_t > (uint64_t x) |
template<> | |
uint32_t | compact< 2, uint32_t, uint128_t > (uint128_t x) |
template<> | |
uint64_t | compact< 2, uint64_t, uint256_t > (uint256_t x) |
template<> | |
uint8_t | compact< 2, uint8_t, uint32_t > (uint32_t x) |
template<> | |
uint16_t | compact< 3, uint16_t, uint64_t > (uint64_t x) |
template<> | |
uint32_t | compact< 3, uint32_t, uint128_t > (uint128_t x) |
template<> | |
uint64_t | compact< 3, uint64_t, uint256_t > (uint256_t x) |
template<typename IntT > | |
float | ConvertCoordinateFromIntegerRange (IntT value, float lower, float upper) |
Converts a single integer coordinate to a floating point. More... | |
template<int ND, typename IntT > | |
MDCoordinate< ND > | ConvertCoordinatesFromIntegerRange (const MDSpaceBounds< ND > &bounds, const Eigen::Array< IntT, ND, 1 > &intCoord) |
Converts a point expressed as integer coordinates back to floating point, given bounds of the original coordinate space. More... | |
template<int ND, typename IntT > | |
Eigen::Array< IntT, ND, 1 > | ConvertCoordinatesToIntegerRange (const MDSpaceBounds< ND > &bounds, const float *crd) |
Converts a point to integer range given a range of floating point coordinates. More... | |
template<typename IntT > | |
IntT | ConvertCoordinateToIntegerRange (float value, float lower, float upper) |
Converts a single floating point coordinate to an integer range. More... | |
template<size_t nd, typename IntT , typename MortonT , typename coord_t = float> | |
MortonT | coordinatesToIndex (coord_t *coord, const MDSpaceBounds< nd > &space) |
template<size_t ND, typename IntT > | |
IntArray< ND, IntT > | deinterleave (const Morton96 &z) |
template<size_t ND, typename IntT , typename MortonT > | |
IntArray< ND, IntT > | deinterleave (const MortonT z) |
Deinterleaves a Morton number into an integer coordinate. More... | |
template<int ND> | |
void | ExpandBounds (MDSpaceBounds< ND > &bounds) |
Expands a coordinate space enough that floating point error cannot cause an overflow when mapping a value at the upper limit of the range to an integer range. More... | |
template<size_t nd, typename IntT , typename MortonT > | |
MDCoordinate< nd > | indexToCoordinates (const MortonT &idx, const MDSpaceBounds< nd > &space) |
template<size_t ND, typename IntT > | |
Morton96 | interleave (const IntArray< 3, uint32_t > &coord) |
template<size_t ND, typename IntT , typename MortonT > | |
MortonT | interleave (const IntArray< ND, IntT > &coord) |
Interleaves an integer coordinate. More... | |
template<typename MortonT > | |
bool | morton_contains (const MortonT lower, const MortonT upper, const MortonT value) |
Checks if a point defined by a Morton number is within the box bounds (as defined by an upper and lower Morton number). More... | |
template<size_t N, typename IntT , typename MortonT > | |
MortonT | pad (IntT) |
Pad an integer with a given number of padding bits. More... | |
template<> | |
uint32_t | pad< 1, uint16_t, uint32_t > (uint16_t v) |
template<> | |
uint64_t | pad< 1, uint16_t, uint64_t > (uint16_t v) |
template<> | |
uint128_t | pad< 1, uint32_t, uint128_t > (uint32_t v) |
template<> | |
uint64_t | pad< 2, uint16_t, uint64_t > (uint16_t v) |
template<> | |
uint128_t | pad< 2, uint32_t, uint128_t > (uint32_t v) |
template<> | |
uint256_t | pad< 2, uint64_t, uint256_t > (uint64_t v) |
template<> | |
uint32_t | pad< 2, uint8_t, uint32_t > (uint8_t v) |
template<> | |
uint64_t | pad< 3, uint16_t, uint64_t > (uint16_t v) |
template<> | |
uint128_t | pad< 3, uint32_t, uint128_t > (uint32_t v) |
template<> | |
uint256_t | pad< 3, uint64_t, uint256_t > (uint64_t v) |
using morton_index::AffineND = typedef Eigen::Transform<CoordT, static_cast<int>(ND), Eigen::Affine> |
using morton_index::BinIndices = typedef Eigen::Matrix<size_t, 1, static_cast<int>(ND)> |
using morton_index::IntArray = typedef Eigen::Array<IntT, static_cast<int>(ND), 1> |
using morton_index::MDCoordinate = typedef Eigen::Array<float, static_cast<int>(ND), 1> |
using morton_index::MDSpaceBounds = typedef Eigen::Array<float, static_cast<int>(ND), 2> |
using morton_index::MDSpaceDimensions = typedef Eigen::Array<float, static_cast<int>(ND), 1> |
using morton_index::MDSpaceSteps = typedef Eigen::Array<float, static_cast<int>(ND), 1> |
using morton_index::Morton96 = typedef uint96_t |
using morton_index::uint128_t = typedef std::uint128_t |
using morton_index::uint256_t = typedef std::uint256_t |
using morton_index::uint96_t = typedef std::wide_uint<96> |
MortonT morton_index::calculateDefaultBound | ( | IntT | intBound | ) |
Definition at line 30 of file CoordinateConversion.h.
References morton_index::Interleaver< ND, IntT, MortonT >::interleave().
size_t morton_index::CalculateRequiredCoordinateIntegerWidth | ( | const MDSpaceBounds< ND > & | bounds, |
const MDSpaceSteps< ND > & | steps | ||
) |
Calculates the required width of the interleaved integer to accurately represent coordinates in a given space at a given resolution.
Definition at line 41 of file CoordinateConversion.h.
bool morton_index::CheckCoordinatesInMDSpace | ( | const MDSpaceBounds< ND > & | bounds, |
const MDCoordinate< ND > & | coord | ||
) |
Checks that a coordinate is within the extents of an MD space.
Definition at line 72 of file CoordinateConversion.h.
IntT morton_index::compact | ( | MortonT | ) |
Compacts (removes padding from) an integer with a given number of padding bits.
N | Number of padding bits to remove |
IntT | Integer type |
MortonT | Padded integer type |
Definition at line 37 of file BitInterleaving.h.
Referenced by deinterleave().
|
inline |
Definition at line 55 of file BitInterleaving.h.
|
inline |
Definition at line 74 of file BitInterleaving.h.
|
inline |
Definition at line 153 of file BitInterleaving.h.
|
inline |
Definition at line 110 of file BitInterleaving.h.
|
inline |
Definition at line 176 of file BitInterleaving.h.
|
inline |
Definition at line 227 of file BitInterleaving.h.
|
inline |
Definition at line 92 of file BitInterleaving.h.
|
inline |
Definition at line 131 of file BitInterleaving.h.
|
inline |
Definition at line 201 of file BitInterleaving.h.
|
inline |
Definition at line 254 of file BitInterleaving.h.
float morton_index::ConvertCoordinateFromIntegerRange | ( | IntT | value, |
float | lower, | ||
float | upper | ||
) |
Converts a single integer coordinate to a floating point.
Definition at line 128 of file CoordinateConversion.h.
MDCoordinate< ND > morton_index::ConvertCoordinatesFromIntegerRange | ( | const MDSpaceBounds< ND > & | bounds, |
const Eigen::Array< IntT, ND, 1 > & | intCoord | ||
) |
Converts a point expressed as integer coordinates back to floating point, given bounds of the original coordinate space.
Definition at line 109 of file CoordinateConversion.h.
Eigen::Array< IntT, ND, 1 > morton_index::ConvertCoordinatesToIntegerRange | ( | const MDSpaceBounds< ND > & | bounds, |
const float * | crd | ||
) |
Converts a point to integer range given a range of floating point coordinates.
Definition at line 90 of file CoordinateConversion.h.
References n.
IntT morton_index::ConvertCoordinateToIntegerRange | ( | float | value, |
float | lower, | ||
float | upper | ||
) |
Converts a single floating point coordinate to an integer range.
Definition at line 119 of file CoordinateConversion.h.
MortonT morton_index::coordinatesToIndex | ( | coord_t * | coord, |
const MDSpaceBounds< nd > & | space | ||
) |
Definition at line 140 of file CoordinateConversion.h.
References morton_index::Interleaver< ND, IntT, MortonT >::interleave().
IntArray< ND, IntT > morton_index::deinterleave | ( | const Morton96 & | z | ) |
Definition at line 306 of file BitInterleaving.h.
IntArray< ND, IntT > morton_index::deinterleave | ( | const MortonT | z | ) |
Deinterleaves a Morton number into an integer coordinate.
ND | Number of dimensions |
IntT | Intermediate integer type |
MortonT | Morton number type |
z | Morton number |
Definition at line 298 of file BitInterleaving.h.
References compact().
void morton_index::ExpandBounds | ( | MDSpaceBounds< ND > & | bounds | ) |
Expands a coordinate space enough that floating point error cannot cause an overflow when mapping a value at the upper limit of the range to an integer range.
Sets bounds to the next lowest (for lower axis bound) or highest (for upper axis bound) representable floating point value.
Definition at line 62 of file CoordinateConversion.h.
MDCoordinate< nd > morton_index::indexToCoordinates | ( | const MortonT & | idx, |
const MDSpaceBounds< nd > & | space | ||
) |
Definition at line 134 of file CoordinateConversion.h.
Morton96 morton_index::interleave | ( | const IntArray< 3, uint32_t > & | coord | ) |
Definition at line 285 of file BitInterleaving.h.
MortonT morton_index::interleave | ( | const IntArray< ND, IntT > & | coord | ) |
Interleaves an integer coordinate.
ND | Number of dimensions |
IntT | Intermediate integer type |
MortonT | Morton number type |
coord | Coordinate in intermediate integer space |
Definition at line 277 of file BitInterleaving.h.
References pad().
bool morton_index::morton_contains | ( | const MortonT | lower, |
const MortonT | upper, | ||
const MortonT | value | ||
) |
Checks if a point defined by a Morton number is within the box bounds (as defined by an upper and lower Morton number).
A box contains a Morton number if it is within the upper and lower bounds, inclusive of the box bounds themselves.
lower | Lower bound |
upper | Upper bound |
value | Morton value to test |
Definition at line 26 of file CoordinateConversion.h.
MortonT morton_index::pad | ( | IntT | ) |
Pad an integer with a given number of padding bits.
N | Number of padding bits to add |
IntT | Integer type |
MortonT | Padded integer type |
Definition at line 24 of file BitInterleaving.h.
Referenced by interleave().
|
inline |
Definition at line 45 of file BitInterleaving.h.
|
inline |
Definition at line 64 of file BitInterleaving.h.
|
inline |
Definition at line 142 of file BitInterleaving.h.
|
inline |
Definition at line 100 of file BitInterleaving.h.
|
inline |
Definition at line 164 of file BitInterleaving.h.
|
inline |
Definition at line 214 of file BitInterleaving.h.
|
inline |
Definition at line 83 of file BitInterleaving.h.
|
inline |
Definition at line 119 of file BitInterleaving.h.
|
inline |
Definition at line 187 of file BitInterleaving.h.
|
inline |
Definition at line 239 of file BitInterleaving.h.