8#ifndef _AUROSTD_XSCALAR_H_
9#define _AUROSTD_XSCALAR_H_
21#define _AUROSTD_XSCALAR_DEFAULT_SIZE_ 3
22#define _AUROSTD_XSCALAR_TOLERANCE_IDENTITY_ 1.0e-6
23#define _AUROSTD_XSCALAR_TOLERANCE_ROUNDOFF_ 1.0e-6
25#define _AUROSTD_XSCALAR_TOLERANCE_INTEGER_ 1.0e-2
43 template <
class utype>
void _GCD(
int a,
int b,
int& gcd,
int& x,
int& y);
44 template <
class utype>
void _GCD(
int a,
int b,
int& gcd);
45 void GCD(
int a,
int b,
int& gcd,
int& x,
int& y);
46 void GCD(
int a,
int b,
int& gcd);
49 void GCD(
long int a,
long int b,
long int& gcd,
long int& x,
long int& y);
50 void GCD(
long int a,
long int b,
long int& gcd);
51 void GCD(
unsigned long int a,
unsigned long int b,
unsigned long int& gcd,
unsigned long int& x,
unsigned long int& y);
52 void GCD(
unsigned long int a,
unsigned long int b,
unsigned long int& gcd);
53 void GCD(
long long int a,
long long int b,
long long int& gcd,
long long int& x,
long long int& y);
54 void GCD(
long long int a,
long long int b,
long long int& gcd);
55 void GCD(
unsigned long long int a,
unsigned long long int b,
unsigned long long int& gcd,
unsigned long long int& x,
unsigned long long int& y);
56 void GCD(
unsigned long long int a,
unsigned long long int b,
unsigned long long int& gcd);
57 void GCD(
float a,
float b,
float& gcd,
float& x,
float& y,
float tolerance = 0.01);
58 void GCD(
float a,
float b,
float& gcd,
float tolerance = 0.01);
59 void GCD(
double a,
double b,
double& gcd,
double& x,
double& y,
double tolerance = 0.01);
60 void GCD(
double a,
double b,
double& gcd,
double tolerance = 0.01);
61 void GCD(
long double a,
long double b,
long double& gcd,
long double& x,
long double& y,
long double tolerance = 0.01);
62 void GCD(
long double a,
long double b,
long double& gcd,
long double tolerance = 0.01);
63 int LCM(
int a,
int b);
70 std::string
dbl2frac(
double a,
bool sign_prefix =
true);
78 template <
class utype> utype
angle(utype, utype, utype, utype, utype, utype)
__xprototype;
156#ifdef _AUROSTD_XCOMPLEX_
178#ifdef _AUROSTD_XCOMPLEX_
199#ifdef _AUROSTD_XCOMPLEX_
220#ifdef _AUROSTD_XCOMPLEX_
242#ifdef _AUROSTD_XCOMPLEX_
262#ifdef _AUROSTD_XCOMPLEX_
284#ifdef _AUROSTD_XCOMPLEX_
307#ifdef _AUROSTD_XCOMPLEX_
317 template <
class utype> utype
pow(utype, utype);
323 int roundDouble(
double doub,
int multiple,
bool up);
326 bool notPositive(
double val,
bool soft_cutoff,
double tol);
327 bool notNegative(
double val,
bool soft_cutoff,
double tol);
337 bool identical(
const bool a,
const bool b);
338 bool identical(
const char a,
const char b);
339 bool identical(
const std::string& a,
const std::string& b);
345 template <
class utype>
bool isequal(
const utype&,
const utype&,
const utype&)
__xprototype;
347 bool isequal(
const bool a,
const bool b);
348 bool isequal(
const char a,
const char b);
349 bool isequal(
const std::string& a,
const std::string& b);
364 template <
class utype> utype
min(utype, utype, utype, utype)
__xprototype;
365 template <
class utype> utype
min(utype, utype, utype, utype, utype)
__xprototype;
366 template <
class utype> utype
min(utype, utype, utype, utype, utype, utype)
__xprototype;
367 template <
class utype> utype
min(utype, utype, utype, utype, utype, utype, utype)
__xprototype;
368 template <
class utype> utype
min(utype, utype, utype, utype, utype, utype, utype, utype)
__xprototype;
369 template <
class utype> utype
min(utype, utype, utype, utype, utype, utype, utype, utype, utype)
__xprototype;
370 template <
class utype> utype
min(utype, utype, utype, utype, utype, utype, utype, utype, utype, utype)
__xprototype;
371 template <
class utype> utype
min(utype, utype, utype, utype, utype, utype, utype, utype, utype, utype, utype)
__xprototype;
372 template <
class utype> utype
min(utype, utype, utype, utype, utype, utype, utype, utype, utype, utype, utype, utype)
__xprototype;
375 template <
class utype> utype
max(utype, utype, utype, utype)
__xprototype;
376 template <
class utype> utype
max(utype, utype, utype, utype, utype)
__xprototype;
377 template <
class utype> utype
max(utype, utype, utype, utype, utype, utype)
__xprototype;
378 template <
class utype> utype
max(utype, utype, utype, utype, utype, utype, utype)
__xprototype;
379 template <
class utype> utype
max(utype, utype, utype, utype, utype, utype, utype, utype)
__xprototype;
380 template <
class utype> utype
max(utype, utype, utype, utype, utype, utype, utype, utype, utype)
__xprototype;
381 template <
class utype> utype
max(utype, utype, utype, utype, utype, utype, utype, utype, utype, utype)
__xprototype;
382 template <
class utype> utype
max(utype, utype, utype, utype, utype, utype, utype, utype, utype, utype, utype)
__xprototype;
383 template <
class utype> utype
max(utype, utype, utype, utype, utype, utype, utype, utype, utype, utype, utype, utype)
__xprototype;
387 template <
class utype> utype
_roundoff(
const utype& x, utype tolerance);
389 long roundoff(
long x,
long tolerance);
391 float roundoff(
float x,
float tolerance);
392 double roundoff(
double x,
double tolerance);
393 long long int roundoff(
long long int x,
long long int tolerance);
394 unsigned long int roundoff(
unsigned long int x,
unsigned long int tolerance);
395 unsigned long long int roundoff(
unsigned long long int x,
unsigned long long int tolerance);
396 long double roundoff(
long double x,
long double tolerance);
409 unsigned long long int powint(
unsigned long long int x,
uint exp);
414 double FermiDirac(
double E,
double mu,
double T);
420 template <
class utype> utype
nCk(utype n, utype k);
426 bool isNaN(
double d);
#define AUROSTD_IDENTITY_TOL
double FermiDirac(double E, double mu, double T)
utype _roundoff(const utype &x, utype tolerance)
xcomplex< utype > exp(const xcomplex< utype > &x)
utype mod(utype x, utype y)
bool isinteger(const xmatrix< utype > &a, const utype &tol)
int roundDouble(double doub, int multiple, bool up)
int boundary_conditions_periodic(int lrows, int urows, int i)
xcomplex< utype > sqrt(const xcomplex< utype > &x)
xmatrix< utype > sign(const xmatrix< utype > &a)
utype modulus(const xmatrix< utype > &a)
bool notNegative(double val, bool soft_cutoff, double tol)
void GCD(const xmatrix< int > &ma, const xmatrix< int > &mb, xmatrix< int > &mgcd)
utype abs(const xcomplex< utype > &x)
bool notPositive(double val, bool soft_cutoff, double tol)
int getNumeratorContinuedFractions(int &p, const int &n, vector< int > &fraction_sequence)
bool _ishex(const string &hexstr)
bool greaterEqualZero(double val)
utype angle(utype x1, utype x2, utype x3, utype y1, utype y2, utype y3)
bool nonZeroWithinTol(double val, double tol)
xmatrix< utype > log10(const xmatrix< utype > &) __xprototype
bool isequal(const xcomplex< utype > &a, const xcomplex< utype > &b, utype _tol_)
bool isdifferent(const xcomplex< utype > &a, const xcomplex< utype > &b, utype _tol_)
utype max(const vector< utype > vec)
double frac2dbl(const string &str)
void _GCD(utype a, utype b, utype &gcd, utype &x, utype &y)
xcomplex< utype > pow(const xcomplex< utype > &x, const xcomplex< utype > &y)
uint powint(uint x, uint exp)
int getDenominatorContinuedFractions(int &q, const int &n, vector< int > &fraction_sequence)
utype mod_floored(utype x, utype y)
floored mod function e.g. std::fmod(-4.0,+1.1)= -0.7; std::fmod(-4.0,-1.1)= -0.7 std::remainder(-4....
bool isfloat(const string &in)
string dbl2frac(double a, bool sign_prefix)
xcomplex< utype > log(const xcomplex< utype > &x)
bool identical(vector< utype > v1, vector< utype > v2, utype epsilon)
utype min(const vector< utype > vec)
bool lessEqualZero(double val)
xmatrix< utype > nint(const xmatrix< utype > &a)
utype nCk(utype n, utype k)
bool zeroWithinTol(double val, double tol)
xmatrix< utype > roundoff(const xmatrix< utype > &a, utype _tol_)
void double2fraction(const double &input_double, int &numerator, int &denominator, double tol_diff, double tol_remainder)
xmatrix< utype > round(const xmatrix< utype > &a)