31#ifndef BERTINI_DOUBLE_EXTENSIONS_HPP
32#define BERTINI_DOUBLE_EXTENSIONS_HPP
42 using dbl = std::complex<double>;
43 using dbl_complex = std::complex<double>;
49 std::complex<double>
operator*(
unsigned i, std::complex<double> z)
59 bool isnan(std::complex<double>
const& z)
72 static std::default_random_engine generator;
73 static std::uniform_real_distribution<double> distribution(-1.0,1.0);
74 return distribution(generator);
78 using dbl = std::complex<double>;
88 inline dbl
pow(
const dbl & z,
int power)
91 return pow(1./z, -power);
103 unsigned int p(power);
104 dbl result(1,0), z_to_the_current_power_of_two = z;
107 if ( (p & 1) == 1 ) {
108 result *= z_to_the_current_power_of_two;
110 z_to_the_current_power_of_two *= z_to_the_current_power_of_two;
std::complex< double > operator*(unsigned i, std::complex< double > z)
Overload * for unsigned * complex<double>
Definition double_extensions.hpp:49
bool isnan(std::complex< double > const &z)
Definition double_extensions.hpp:59
double RandReal()
Gets you a random real number between -1 and 1, fwiw.
Definition double_extensions.hpp:70
dbl pow(const dbl &z, int power)
Definition double_extensions.hpp:88