Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
scalar.h File Reference
#include <cmath>
#include "Utils.h"
#include "Logger.h"
#include "scalar.tpp"
Include dependency graph for scalar.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  scalar_t
 

Macros

#define DEFINE_MATH_FUNCTION(func)
 

Functions

template<class T >
std::enable_if_t< not std::numeric_limits< T >::is_integer, bool > fpeq (T, T, std::size_t n=10)
 Compares two floating point numbers with a given precision.
 
scalar_t pow (const scalar_t &base, const scalar_t &exp)
 
scalar_t pow (const scalar_t &base, double exp)
 
template<typename T >
requires std::is_integral_v<T>
scalar_t pow (const scalar_t &base, T exp)
 
double real (const scalar_t &z)
 
double imag (const scalar_t &z)
 

Macro Definition Documentation

◆ DEFINE_MATH_FUNCTION

#define DEFINE_MATH_FUNCTION (   func)
Value:
inline scalar_t func(const scalar_t& x) { \
return scalar_t(std::func(static_cast<complex_t>(x))); \
}
std::complex< double > complex_t
Convenience alias for std::complex<double>.
Definition Utils.h:35

Definition at line 99 of file scalar.h.

Function Documentation

◆ fpeq()

template<class T >
std::enable_if_t< not std::numeric_limits< T >::is_integer, bool > fpeq ( T  x,
T  y,
std::size_t  n 
)

Compares two floating point numbers with a given precision.

Template Parameters
TFloating point type.
Parameters
xFirst number.
ySecond number.
nNumber of machine epsilons allowed.
Returns
True if numbers are approximately equal.

Definition at line 107 of file special_generic.h.

◆ imag()

double imag ( const scalar_t z)

Definition at line 87 of file scalar.cpp.

◆ pow() [1/3]

scalar_t pow ( const scalar_t base,
const scalar_t exp 
)

Definition at line 75 of file scalar.cpp.

◆ pow() [2/3]

scalar_t pow ( const scalar_t base,
double  exp 
)

Definition at line 79 of file scalar.cpp.

◆ pow() [3/3]

template<typename T >
requires std::is_integral_v<T>
scalar_t pow ( const scalar_t base,
T  exp 
)

◆ real()

double real ( const scalar_t z)

Definition at line 83 of file scalar.cpp.