AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
Utilities.hpp File Reference
#include "axom/config.hpp"
#include "axom/core/Types.hpp"
#include "axom/core/Macros.hpp"
#include <cassert>
#include <cmath>
#include <random>
#include <type_traits>

Classes

class  axom::utilities::LexiComparator< T >
 Compares std::vector< T > in lexicographic order. More...
 

Namespaces

 axom
 
 axom::utilities
 

Functions

void axom::utilities::processAbort ()
 Gracefully aborts the application. More...
 
template<typename T >
AXOM_HOST_DEVICEaxom::utilities::abs (const T &x)
 Returns the absolute value of x. More...
 
template<typename T >
AXOM_HOST_DEVICE const T & axom::utilities::max (const T &x, const T &y)
 Returns the max value of x and y. More...
 
template<typename T >
AXOM_HOST_DEVICE const T & axom::utilities::min (const T &x, const T &y)
 Returns the min value of x and y. More...
 
template<typename T >
AXOM_HOST_DEVICE void axom::utilities::swap (T &a, T &b)
 Swaps the values of a, b. More...
 
template<typename T >
axom::utilities::log2 (T &val)
 Returns the base 2 logarithm of the input. More...
 
template<typename T >
AXOM_HOST_DEVICEaxom::utilities::clampVal (T val, T lower, T upper)
 Clamps an input value to a given range. More...
 
template<typename T >
AXOM_HOST_DEVICEaxom::utilities::clampUpper (T val, T upper)
 Clamps the upper range on an input value. More...
 
template<typename T >
AXOM_HOST_DEVICEaxom::utilities::clampLower (T val, T lower)
 Clamps the lower range on an input value. More...
 
template<typename T >
axom::utilities::random_real (const T &a, const T &b)
 Returns a random real number within the specified interval. More...
 
template<typename T >
axom::utilities::random_real (const T &a, const T &b, unsigned int seed)
 Returns a random real number within the specified interval given the bounds of the interval and a seed value for the underlying random number generator. More...
 
bool axom::utilities::isLittleEndian ()
 Tests the endianness of the system. More...
 
template<typename T >
axom::utilities::swapEndian (T val)
 Swaps the endianness of the input value. More...
 
template<typename RealType >
AXOM_HOST_DEVICE bool axom::utilities::isNearlyEqual (RealType a, RealType b, RealType thresh=1.0e-8)
 Fuzzy comparison of two real valued quantities. More...
 
template<typename RealType >
AXOM_HOST_DEVICE bool axom::utilities::isNearlyEqualRelative (RealType a, RealType b, RealType relThresh=1.0e-6, RealType absThresh=1.0e-8)
 Fuzzy comparison of two real valued quantities. More...