basix_doc 0.1
/Users/mourrain/Devel/mmx/basix/include/basix/int.hpp File Reference
#include "basix/port.hpp"

Go to the source code of this file.

Classes

Namespaces

Defines

Functions


Define Documentation

#define INT_DIV_DECLARE (   I)
Value:
inline bool divides (const I& n, const I& m) { return (m % n) == 0; } \
  inline I rem (const I& n, const I& m) { return m == 0 ? n : n % m; }  \
  inline I quo (const I& n, const I& m) { return m == 0 ? 0 : n / m; }  \
  inline I rem (const I& n, const I& m, I& q) {                         \
    I _q= quo (n, m); I _r= n - _q * m; q= _q; return _r; }

Definition at line 425 of file int.hpp.

#define INT_GCD_DECLARE (   I)
Value:
inline I gcd (const I a, const I b) {                                   \
    return int_gcd_helper::gcd (a, b); }                                \
                                                                        \
  inline I gcd (const I a, const I b, I& co_a) {                        \
    return int_gcd_helper::gcd (a, b, co_a); }                          \
                                                                        \
  inline I gcd (const I a, const I b, I& co_a, I& co_b) {               \
    return int_gcd_helper::gcd (a, b, co_a, co_b); }

Definition at line 547 of file int.hpp.

#define MMX_SAFE_LEFT_SHIFT_INT (   C,
  a,
 
)    (((n) >= 8*sizeof(C)) ? ((C) 0) : (((C) a) << ((n)/2)) << ((n)-(n)/2))

Hereafter C must a genuine C/C++ int type, signed or not.

Definition at line 85 of file int.hpp.

#define MMX_SAFE_RIGHT_SHIFT_INT (   C,
  a,
 
)    (((n) >= 8*sizeof(C)) ? ((C) 0) : (((C) a) >> ((n)/2)) >> ((n)-(n)/2))

Definition at line 88 of file int.hpp.

#define UINT_GCD_DECLARE (   I)
Value:
inline I gcd (const I a, const I b) {                                   \
    return unsigned_int_gcd_helper::gcd (a, b); }

Definition at line 564 of file int.hpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines