GEOSX
Namespaces
math.hpp File Reference

Contains some portable math functions. More...

#include "LvArrayConfig.hpp"
#include "Macros.hpp"
#include <cmath>
#include <type_traits>

Go to the source code of this file.

Namespaces

 LvArray
 The top level namespace.
 
 LvArray::math
 Contains protable wrappers around cmath functions and some cuda specific functions.
 

Functions

General purpose functions
template<typename T >
constexpr std::enable_if_t< std::is_arithmetic< T >::value, T > LvArray::math::max (T const a, T const b)
 
template<typename T >
constexpr std::enable_if_t< std::is_arithmetic< T >::value, T > LvArray::math::min (T const a, T const b)
 
float LvArray::math::abs (float const x)
 
double LvArray::math::abs (double const x)
 
template<typename T >
std::enable_if_t< std::is_integral< T >::value, T > LvArray::math::abs (T const x)
 
Square root and inverse square root.
float LvArray::math::sqrt (float const x)
 
template<typename T >
std::enable_if_t< std::is_arithmetic< T >::value, double > LvArray::math::sqrt (T const x)
 
float LvArray::math::invSqrt (float const x)
 
template<typename T >
std::enable_if_t< std::is_arithmetic< T >::value, double > LvArray::math::invSqrt (T const x)
 
Trigonometric functions
float LvArray::math::sin (float const theta)
 
double LvArray::math::sin (double const theta)
 
float LvArray::math::cos (float const theta)
 
double LvArray::math::cos (double const theta)
 
float LvArray::math::tan (float const theta)
 
double LvArray::math::tan (double const theta)
 
void LvArray::math::sincos (float const theta, float &sinTheta, float &cosTheta)
 Compute the sine and cosine of theta. More...
 
void LvArray::math::sincos (double const theta, double &sinTheta, double &cosTheta)
 Compute the sine and cosine of theta. More...
 
Inverse trigonometric functions
float LvArray::math::asin (float const x)
 
double LvArray::math::asin (double const x)
 
float LvArray::math::acos (float const x)
 
double LvArray::math::acos (double const x)
 
float LvArray::math::atan2 (float const y, float const x)
 
double LvArray::math::atan2 (double const y, double const x)
 

Detailed Description

Contains some portable math functions.

Definition in file math.hpp.