basix_doc 0.1
|
#include <basix/basix.hpp>
Go to the source code of this file.
Definition in file defaults.hpp.
#define ADDITIVE_INT_SUGAR | ( | TMPL, | |
T | |||
) |
TMPL inline T operator + (const T& x, const int& y) { \ return x + promote (y, x); } \ TMPL inline T operator + (const int& x, const T& y) { \ return promote (x, y) + y; } \ TMPL inline T operator - (const T& x, const int& y) { \ return x - promote (y, x); } \ TMPL inline T operator - (const int& x, const T& y) { \ return promote (x, y) - y; }
Definition at line 248 of file defaults.hpp.
#define ADDITIVE_SCALAR_INT_SUGAR | ( | TMPL, | |
T | |||
) |
TMPL inline T operator + (const T& x, const int& y) { \ return x + promote_scalar (y, x); } \ TMPL inline T operator + (const int& x, const T& y) { \ return promote_scalar (x, y) + y; } \ TMPL inline T operator - (const T& x, const int& y) { \ return x - promote_scalar (y, x); } \ TMPL inline T operator - (const int& x, const T& y) { \ return promote_scalar (x, y) - y; }
Definition at line 258 of file defaults.hpp.
#define ADDITIVE_SCALAR_SUGAR | ( | TMPL, | |
T, | |||
C | |||
) |
TMPL inline T operator + (const T& x, const C& y) { return x + T(y); } \ TMPL inline T operator + (const C& x, const T& y) { return T(x) + y; } \ TMPL inline T operator - (const T& x, const C& y) { return x - T(y); } \ TMPL inline T operator - (const C& x, const T& y) { return T(x) - y; }
Definition at line 268 of file defaults.hpp.
#define ARG_HYPER_SUGAR | ( | TMPL, | |
C | |||
) |
TMPL inline C acosh (const C& x) { \ return log (x + sqrt (square (x) - promote (1, x))); } \ TMPL inline C asinh (const C& x) { \ return log (x + sqrt (square (x) + promote (1, x))); } \ TMPL inline C atanh (const C& x) { \ return log ((promote (1, x) + x) / (promote (1, x) - x)) / promote (2, x); }
Definition at line 679 of file defaults.hpp.
#define ARITH_INT_SUGAR | ( | TMPL, | |
T | |||
) |
TMPL inline T operator + (const T& x, const int& y) { \ return x + promote (y, x); } \ TMPL inline T operator + (const int& x, const T& y) { \ return promote (x, y) + y; } \ TMPL inline T operator - (const T& x, const int& y) { \ return x - promote (y, x); } \ TMPL inline T operator - (const int& x, const T& y) { \ return promote (x, y) - y; } \ TMPL inline T operator * (const T& x, const int& y) { \ return x * promote (y, x); } \ TMPL inline T operator * (const int& x, const T& y) { \ return promote (x, y) * y; } \ TMPL inline T operator / (const T& x, const int& y) { \ return x / promote (y, x); } \ TMPL inline T operator / (const int& x, const T& y) { \ return promote (x, y) / y; }
Definition at line 274 of file defaults.hpp.
#define ARITH_SCALAR_INT_SUGAR | ( | TMPL, | |
T | |||
) |
TMPL inline T operator + (const T& x, const int& y) { \ return x + promote_scalar (y, x); } \ TMPL inline T operator + (const int& x, const T& y) { \ return promote_scalar (x, y) + y; } \ TMPL inline T operator - (const T& x, const int& y) { \ return x - promote_scalar (y, x); } \ TMPL inline T operator - (const int& x, const T& y) { \ return promote_scalar (x, y) - y; } \ TMPL inline T operator * (const T& x, const int& y) { \ return x * promote_scalar (y, x); } \ TMPL inline T operator * (const int& x, const T& y) { \ return promote_scalar (x, y) * y; } \ TMPL inline T operator / (const T& x, const int& y) { \ return x / promote_scalar (y, x); } \ TMPL inline T operator / (const int& x, const T& y) { \ return promote_scalar (x, y) / y; }
Definition at line 292 of file defaults.hpp.
#define ARITH_SCALAR_SUGAR | ( | TMPL, | |
T, | |||
C | |||
) |
TMPL inline T operator + (const T& x, const C& y) { return x + T(y); } \ TMPL inline T operator + (const C& x, const T& y) { return T(x) + y; } \ TMPL inline T operator - (const T& x, const C& y) { return x - T(y); } \ TMPL inline T operator - (const C& x, const T& y) { return T(x) - y; } \ TMPL inline T operator * (const T& x, const C& y) { return x * T(y); } \ TMPL inline T operator * (const C& x, const T& y) { return T(x) * y; } \ TMPL inline T operator / (const T& x, const C& y) { return x / T(y); } \ TMPL inline T operator / (const C& x, const T& y) { return T(x) / y; }
Definition at line 310 of file defaults.hpp.
#define ARITH_SWAP_TIMES_SUGAR | ( | TMPL, | |
T, | |||
C | |||
) | TMPL inline T operator * (const C& x, const T& y) { return y * x; } |
Definition at line 326 of file defaults.hpp.
#define ATAN2_SUGAR | ( | TMPL, | |
C | |||
) |
TMPL inline C atan2 (const C& y, const C& x) { \ if (x > promote (0, x)) \ return atan (y/x); \ else if (y == promote (0, x)) \ return x == promote (0, x)? \ promote (0, x): promote (-4, x) * atan (promote (1, x)); \ else if (x == promote (0, x)) \ return promote (2 * sign (y), x) * atan (promote (1, x)); \ else \ return promote (sign (y), x) * \ (promote (4, x) * atan (promote (1, x)) - atan (abs (y/x))); }
Definition at line 642 of file defaults.hpp.
#define COMPARE_INT_SUGAR | ( | TMPL, | |
T | |||
) |
TMPL inline bool operator < (const T& x, const int& y) { \ return x < promote (y, x); } \ TMPL inline bool operator <= (const T& x, const int& y) { \ return x <= promote (y, x); } \ TMPL inline bool operator > (const T& x, const int& y) { \ return x > promote (y, x); } \ TMPL inline bool operator >= (const T& x, const int& y) { \ return x >= promote (y, x); }
Definition at line 531 of file defaults.hpp.
#define COMPARE_SCALAR_SUGAR | ( | TMPL, | |
T, | |||
C | |||
) |
TMPL inline bool operator < (const T& x, const C& y) { return x < T(y); } \ TMPL inline bool operator <= (const T& x, const C& y) { return x <= T(y); } \ TMPL inline bool operator > (const T& x, const C& y) { return x > T(y); } \ TMPL inline bool operator >= (const T& x, const C& y) { return x >= T(y); }
Definition at line 541 of file defaults.hpp.
#define COMPARE_SUGAR | ( | TMPL, | |
T | |||
) |
TMPL inline bool operator < (const T& x, const T& y) { \ return compare (x,y) < 0; } \ TMPL inline bool operator <= (const T& x, const T& y) { \ return compare (x,y) <= 0; } \ TMPL inline bool operator > (const T& x, const T& y) { \ return compare (x,y) > 0; } \ TMPL inline bool operator >= (const T& x, const T& y) { \ return compare (x,y) >= 0; }
Definition at line 515 of file defaults.hpp.
#define COPY_OP_SUGAR | ( | TMPL, | |
T | |||
) |
#define EQUAL_INT_SUGAR | ( | TMPL, | |
T | |||
) |
TMPL inline bool operator == (const T& x, const int& y) { \ return x == promote (y, x); } \ TMPL inline bool operator != (const T& x, const int& y) { \ return x != promote (y, x); } \ TMPL inline bool exact_eq (const T& x, const int& y) { \ return exact_eq (x, promote (y, x)); } \ TMPL inline bool exact_neq (const T& x, const int& y) { \ return exact_neq (x, promote (y, x)); }
Definition at line 192 of file defaults.hpp.
#define EQUAL_SCALAR_SUGAR | ( | TMPL, | |
T, | |||
C | |||
) |
TMPL inline bool operator == (const T& x, const C& y) { \ return x == T(y); } \ TMPL inline bool operator != (const T& x, const C& y) { \ return x != T(y); } \ TMPL inline bool exact_eq (const T& x, const C& y) { \ return exact_eq (x, T(y)); } \ TMPL inline bool exact_neq (const T& x, const C& y) { \ return exact_neq (x, T(y)); }
Definition at line 202 of file defaults.hpp.
#define EXACT_IDENTITY_OP_SUGAR | ( | TMPL, | |
T | |||
) |
TMPL inline nat exact_hash (const T& x) { \ return unary_hash<exact_hash_op> (x); } \ TMPL inline bool exact_eq (const T& x, const T& y) { \ return binary_test<exact_eq_op> (x, y); } \ TMPL inline bool exact_neq (const T& x, const T& y) { \ return !binary_test<exact_eq_op> (x, y); }
Definition at line 176 of file defaults.hpp.
#define GCD_SUGAR | ( | TMPL, | |
C | |||
) |
TMPL inline C gcd (const C& x, const C& y) { \ return (x == promote (0, x) && y == promote (0, x))? \ promote (0, x): promote (1, x); } \ TMPL inline C lcm (const C& x, const C& y) { \ return (x == promote (0, x) || y == promote (0, x))? \ promote (0, x): x*y; } \ TMPL inline xgcd_matrix<C> xgcd (const C& x, const C& y) { \ if (x == 0) { \ if (y == 0) \ return xgcd_matrix<C> (promote (1, x), promote (0, x), \ promote (0, x), promote (1, x)); \ else \ return xgcd_matrix<C> (promote (0, x), promote (1, x) / y, \ promote (1, x), promote (0, x)); \ } \ else { \ if (y == 0) \ return xgcd_matrix<C> (promote (1, x) / x, promote (0, x), \ promote (0, x), promote (1, x)); \ else \ return xgcd_matrix<C> (promote (1, x) / x, promote (0, x), \ -y, x); \ } \ }
Definition at line 429 of file defaults.hpp.
#define HARD_IDENTITY_OP_SUGAR | ( | TMPL, | |
T | |||
) |
TMPL inline nat hard_hash (const T& x) { \ return unary_hash<hard_hash_op> (x); } \ TMPL inline bool hard_eq (const T& x, const T& y) { \ return binary_test<hard_eq_op> (x, y); } \ TMPL inline bool hard_neq (const T& x, const T& y) { \ return !binary_test<hard_eq_op> (x, y); }
Definition at line 184 of file defaults.hpp.
#define HARD_TO_EXACT_IDENTITY_SUGAR | ( | TMPL, | |
T | |||
) |
#define HARD_TO_TRUE_IDENTITY_SUGAR | ( | TMPL, | |
T | |||
) |
#define HYPER_SUGAR | ( | TMPL, | |
C | |||
) |
TMPL inline C cosh (const C& x) { \ return (exp (x) + exp (-x)) / promote (2, x); } \ TMPL inline C sinh (const C& x) { \ return (exp (x) - exp (-x)) / promote (2, x); } \ TMPL inline C tanh (const C& x) { \ return (exp (x) - exp (-x)) / (exp (x) + exp (-x)); }
Definition at line 663 of file defaults.hpp.
#define HYPOT_SUGAR | ( | TMPL, | |
C | |||
) |
#define INV_HYPER_SUGAR | ( | TMPL, | |
C | |||
) |
TMPL inline C sech (const C& x) { \ return promote (2, x) / (exp (x) + exp (-x)); } \ TMPL inline C csch (const C& x) { \ return promote (2, x) / (exp (x) - exp (-x)); } \ TMPL inline C coth (const C& x) { \ return (exp (x) + exp (-x)) / (exp (x) - exp (-x)); }
Definition at line 671 of file defaults.hpp.
#define INV_TRIGO_SUGAR | ( | TMPL, | |
C | |||
) |
#define MMX_ABS_FCT |
Definition at line 490 of file defaults.hpp.
#define MMX_SIGN_FCT |
Definition at line 460 of file defaults.hpp.
#define POOR_MAN_ELEMENTARY_SUGAR | ( | TMPL, | |
C | |||
) |
TMPL inline C exp (const C& x) { \ ASSERT (x == (promote (0, x)), "zero expected"); \ return promote (1, x); } \ TMPL inline C log (const C& x) { \ ASSERT (x == (promote (1, x)), "one expected"); \ return promote (0, x); } \ TMPL inline C cos (const C& x) { \ ASSERT (x == (promote (0, x)), "zero expected"); \ return promote (1, x); } \ TMPL inline C sin (const C& x) { \ ASSERT (x == (promote (0, x)), "zero expected"); \ return promote (0, x); } \ TMPL inline C tan (const C& x) { \ ASSERT (x == (promote (0, x)), "zero expected"); \ return promote (0, x); } \ TMPL inline C acos (const C& x) { \ ASSERT (x == (promote (1, x)), "one expected"); \ return promote (0, x); } \ TMPL inline C asin (const C& x) { \ ASSERT (x == (promote (0, x)), "zero expected"); \ return promote (0, x); } \ TMPL inline C atan (const C& x) { \ ASSERT (x == (promote (0, x)), "zero expected"); \ return promote (0, x); }
Definition at line 608 of file defaults.hpp.
#define POOR_MAN_SQRT_SUGAR | ( | TMPL, | |
C | |||
) |
#define POW_SUGAR | ( | TMPL, | |
C | |||
) |
#define SHIFT_INT_SUGAR | ( | TMPL, | |
T | |||
) |
TMPL inline T& operator <<= (T& x, const int& y) { return x= x << y; } \ TMPL inline T& operator >>= (T& x, const int& y) { return x= x >> y; } \ TMPL inline T& operator <<= (T& x, const long int& y) { return x= x << y; } \ TMPL inline T& operator >>= (T& x, const long int& y) { return x= x >> y; }
Definition at line 320 of file defaults.hpp.
#define STRICT_COMPARE_SUGAR | ( | TMPL, | |
T | |||
) |
TMPL inline bool operator < (const T& x, const T& y) { \ return x<=y && !(x==y); } \ TMPL inline bool operator > (const T& x, const T& y) { \ return x>=y && !(x==y); }
Definition at line 525 of file defaults.hpp.
#define TRUE_IDENTITY_OP_SUGAR | ( | TMPL, | |
T | |||
) |
TMPL inline nat hash (const T& x) { \ return unary_hash<hash_op> (x); } \ TMPL inline bool operator == (const T& x, const T& y) { \ return binary_test<equal_op> (x, y); } \ TMPL inline bool operator != (const T& x, const T& y) { \ return !binary_test<equal_op> (x, y); }
Definition at line 168 of file defaults.hpp.
#define TRUE_TO_EXACT_IDENTITY_SUGAR | ( | TMPL, | |
T | |||
) |