|
#define | __STDC_LIMIT_MACROS |
|
#define | __M4RI_CONVERT_TO_INT(w) ((int)(w)) |
| Explicit conversion macro. More...
|
|
#define | __M4RI_CONVERT_TO_BIT(w) ((BIT)(w)) |
| Explicit conversion macro. More...
|
|
#define | __M4RI_CONVERT_TO_UINT64_T(w) (w) |
| Explicit conversion macro. More...
|
|
#define | __M4RI_CONVERT_TO_WORD(i) ((word)(i)) |
| Explicit conversion macro. More...
|
|
#define | MAX(x, y) (((x) > (y))?(x):(y)) |
| Return the maximal element of x and y. More...
|
|
#define | MIN(x, y) (((x) < (y))?(x):(y)) |
| Return the minimal element of x and y. More...
|
|
#define | TRUE 1 |
| Pretty for 1.
|
|
#define | FALSE 0 |
| Pretty for 0.
|
|
#define | __M4RI_TWOPOW(i) ((uint64_t)1 << (i)) |
| $2^i$ More...
|
|
#define | __M4RI_CLR_BIT(w, spot) ((w) &= ~(m4ri_one << (spot)) |
| Clear the bit spot (counting from the left) in the word w. More...
|
|
#define | __M4RI_SET_BIT(w, spot) ((w) |= (m4ri_one << (spot))) |
| Set the bit spot (counting from the left) in the word w. More...
|
|
#define | __M4RI_GET_BIT(w, spot) __M4RI_CONVERT_TO_BIT(((w) >> (spot)) & m4ri_one) |
| Get the bit spot (counting from the left) in the word w. More...
|
|
#define | __M4RI_WRITE_BIT(w, spot, value) ((w) = (((w) & ~(m4ri_one << (spot))) | (-__M4RI_CONVERT_TO_WORD(value) & (m4ri_one << (spot))))) |
| Write the value to the bit spot in the word w. More...
|
|
#define | __M4RI_FLIP_BIT(w, spot) ((w) ^= (m4ri_one << (spot))) |
| Flip the spot in the word w. More...
|
|
#define | __M4RI_LEFT_BITMASK(n) (m4ri_ffff >> (m4ri_radix - (n)) % m4ri_radix) |
| create a bit mask to zero out all but the (n - 1) % m4ri_radix + 1 leftmost bits. More...
|
|
#define | __M4RI_RIGHT_BITMASK(n) (m4ri_ffff << (m4ri_radix - (n))) |
| create a bit mask to zero out all but the n rightmost bits. More...
|
|
#define | __M4RI_MIDDLE_BITMASK(n, offset) (__M4RI_LEFT_BITMASK(n) << (offset)) |
| create a bit mask that is the combination of __M4RI_LEFT_BITMASK and __M4RI_RIGHT_BITMASK. More...
|
|
#define | __M4RI_ALIGNMENT(addr, n) (((unsigned long)(addr))%(n)) |
| Return alignment of addr w.r.t. n. For example the address 17 would be 1 aligned w.r.t. 16. More...
|
|
#define | __M4RI_GNUC_PREREQ(maj, min) FALSE |
| Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc. More...
|
|
#define | __M4RI_LIKELY(cond) __builtin_expect ((cond) != 0, 1) |
| Macro to help with branch prediction.
|
|
#define | __M4RI_UNLIKELY(cond) __builtin_expect ((cond) != 0, 0) |
| Macro to help with branch prediction.
|
|
#define | __M4RI_CPU_L3_CACHE 4194304 |
|
#define | __M4RI_CPU_L2_CACHE 262144 |
|
#define | __M4RI_CPU_L1_CACHE 16384 |
|
#define | RESTRICT |
|
|
static word | m4ri_swap_bits (word v) |
| swap bits in the word v More...
|
|
static word | m4ri_shrink_bits (word const from, rci_t *const Q, int const length, int const base) |
| pack bits (inverse of m4ri_spread_bits) More...
|
|
static word | m4ri_spread_bits (word const from, rci_t *const Q, int const length, int const base) |
| spread bits More...
|
|
static int | m4ri_lesser_LSB (word a, word b) |
|
void | m4ri_die (const char *errormessage,...) |
| Print error message and abort(). More...
|
|
void | m4ri_word_to_str (char *destination, word data, int colon) |
| Write a sting representing the word data to destination. More...
|
|
static BIT | m4ri_coin_flip () |
| Return 1 or 0 uniformly randomly distributed. More...
|
|
word | m4ri_random_word () |
| Return uniformly randomly distributed random word. More...
|
|
void | m4ri_init (void) |
| Initialize global data structures for the M4RI library. More...
|
|
void | m4ri_fini (void) |
| De-initialize global data structures from the M4RI library. More...
|
|
static void * | m4ri_mm_calloc (size_t count, size_t size) |
| Calloc wrapper. More...
|
|
static void * | m4ri_mm_malloc_aligned (size_t size, size_t alignment) |
| Aligned malloc wrapper. More...
|
|
static void * | m4ri_mm_malloc (size_t size) |
| Malloc wrapper. More...
|
|
static void | m4ri_mm_free (void *condemned,...) |
| Free wrapper. More...
|
|
#define __M4RI_CONVERT_TO_UINT64_T |
( |
|
w | ) |
(w) |
Explicit conversion macro.
Explicit conversion of a word, representing 64 columns, to an uint64_t.
The returned value is the underlaying integer representation of these 64 columns, meaning in particular that if val is an uint64_t then __M4RI_CONVERT_TO_UINT64_T(__M4RI_CONVERT_TO_WORD(val)) == val.
- Note
- This is a no-op. It's purpose it to track intention.
create a bit mask to zero out all but the (n - 1) % m4ri_radix + 1 leftmost bits.
This function returns 1..64 bits, never zero bits. This mask is mainly used to mask the valid bits in the most significant word, by using __M4RI_LEFT_BITMASK((M->ncols + M->offset) % m4ri_radix). In other words, the set bits represent the columns with the lowest index in the word.
Thus,
n Output 0=64 1111111111111111111111111111111111111111111111111111111111111111 1 0000000000000000000000000000000000000000000000000000000000000001 2 0000000000000000000000000000000000000000000000000000000000000011 . ... 62 0011111111111111111111111111111111111111111111111111111111111111 63 0111111111111111111111111111111111111111111111111111111111111111
Note that n == 64 is only passed from __M4RI_MIDDLE_BITMASK, and still works (behaves the same as n == 0): the input is modulo 64.
- Parameters
-
n | Integer with 0 <= n <= m4ri_radix |
create a bit mask that is the combination of __M4RI_LEFT_BITMASK and __M4RI_RIGHT_BITMASK.
This function returns 1..64 bits, never zero bits. This mask is mainly used to mask the n valid bits in the only word with valid bits, when M->ncols + M->offset <= m4ri_radix), by using __M4RI_MIDDLE_BITMASK(M->ncols, M->offset). It is equivalent to __M4RI_LEFT_BITMASK(n + offset) & __M4RI_RIGHT_BITMASK(m4ri_radix - offset). In other words, the set bits represent the valid columns in the word.
Note that when n == m4ri_radix (and thus offset == 0) then __M4RI_LEFT_BITMASK is called with n == 64.
- Parameters
-
n | Integer with 0 < n <= m4ri_radix - offset |
offset | Column offset, with 0 <= offset < m4ri_radix |
create a bit mask to zero out all but the n rightmost bits.
This function returns 1..64 bits, never zero bits. This mask is mainly used to mask the n valid bits in the least significant word with valid bits by using __M4RI_RIGHT_BITMASK(m4ri_radix - M->offset). In other words, the set bits represent the columns with the highest index in the word.
Thus,
n Output 1 1000000000000000000000000000000000000000000000000000000000000000 2 1100000000000000000000000000000000000000000000000000000000000000 3 1110000000000000000000000000000000000000000000000000000000000000 . ... 63 1111111111111111111111111111111111111111111111111111111111111110 64 1111111111111111111111111111111111111111111111111111111111111111
Note that n == 0 is never passed and would fail.
- Parameters
-
n | Integer with 0 < n <= m4ri_radix |