M4RI 20250128
brilliantrussian.h
Go to the documentation of this file.
1
12
13#ifndef M4RI_BRILLIANTRUSSIAN_H
14#define M4RI_BRILLIANTRUSSIAN_H
15
16/*******************************************************************
17 *
18 * M4RI: Linear Algebra over GF(2)
19 *
20 * Copyright (C) 2007, 2008 Gregory Bard <bard@fordham.edu>
21 * Copyright (C) 2008-2010 Martin Albrecht <martinralbrecht@googlemail.com>
22 *
23 * Distributed under the terms of the GNU General Public License (GPL)
24 * version 2 or higher.
25 *
26 * This code is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29 * General Public License for more details.
30 *
31 * The full text of the GPL is available at:
32 *
33 * http://www.gnu.org/licenses/
34 *
35 ********************************************************************/
36
37#include <math.h>
38#include <stdlib.h>
39#include <string.h>
40
41#include <m4ri/mzd.h>
42#include <m4ri/mzp.h>
43
55
56void mzd_make_table(mzd_t const *M, rci_t r, rci_t c, int k, mzd_t *T, rci_t *L);
57
73
74void mzd_process_rows(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k, mzd_t const *T,
75 rci_t const *L);
76
91
92void mzd_process_rows2(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k,
93 mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1);
94
111
112void mzd_process_rows3(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k,
113 mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1,
114 mzd_t const *T2, rci_t const *L2);
115
134
135void mzd_process_rows4(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k,
136 mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1,
137 mzd_t const *T2, rci_t const *L2, mzd_t const *T3, rci_t const *L3);
138
159
160void mzd_process_rows5(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k,
161 mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1,
162 mzd_t const *T2, rci_t const *L2, mzd_t const *T3, rci_t const *L3,
163 mzd_t const *T4, rci_t const *L4);
164
187
188void mzd_process_rows6(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k,
189 mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1,
190 mzd_t const *T2, rci_t const *L2, mzd_t const *T3, rci_t const *L3,
191 mzd_t const *T4, rci_t const *L4, mzd_t const *T5, rci_t const *L5);
192
214
215rci_t _mzd_echelonize_m4ri(mzd_t *A, const int full, int k, int heuristic, const double threshold);
216
226
227void mzd_top_echelonize_m4ri(mzd_t *M, int k);
228
242
243rci_t _mzd_top_echelonize_m4ri(mzd_t *A, int k, rci_t r, rci_t c, rci_t max_r);
244
255
256mzd_t *mzd_inv_m4ri(mzd_t *dst, const mzd_t *src, int k);
257
273
274mzd_t *mzd_mul_m4rm(mzd_t *C, mzd_t const *A, mzd_t const *B, int k);
275
290
291mzd_t *mzd_addmul_m4rm(mzd_t *C, mzd_t const *A, mzd_t const *B, int k);
292
316
317mzd_t *_mzd_mul_m4rm(mzd_t *C, mzd_t const *A, mzd_t const *B, int k, int clear);
318
319#endif // M4RI_BRILLIANTRUSSIAN_H
mzd_t * mzd_inv_m4ri(mzd_t *dst, const mzd_t *src, int k)
Invert the matrix src using Konrod's method.
Definition brilliantrussian.c:971
void mzd_process_rows2(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k, mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1)
Same as mzd_process_rows but works with two Gray code tables in parallel.
Definition brilliantrussian.c:350
void mzd_process_rows5(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k, mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1, mzd_t const *T2, rci_t const *L2, mzd_t const *T3, rci_t const *L3, mzd_t const *T4, rci_t const *L4)
Same as mzd_process_rows but works with five Gray code tables in parallel.
Definition brilliantrussian.c:481
rci_t _mzd_echelonize_m4ri(mzd_t *A, const int full, int k, int heuristic, const double threshold)
Definition brilliantrussian.c:603
mzd_t * _mzd_mul_m4rm(mzd_t *C, mzd_t const *A, mzd_t const *B, int k, int clear)
Matrix multiplication using Konrod's method, i.e. compute C such that C == AB.
Definition brilliantrussian.c:1032
void mzd_process_rows(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k, mzd_t const *T, rci_t const *L)
The function looks up k bits from position i,startcol in each row and adds the appropriate row from T...
Definition brilliantrussian.c:213
void mzd_process_rows4(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k, mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1, mzd_t const *T2, rci_t const *L2, mzd_t const *T3, rci_t const *L3)
Same as mzd_process_rows but works with four Gray code tables in parallel.
Definition brilliantrussian.c:431
void mzd_make_table(mzd_t const *M, rci_t r, rci_t c, int k, mzd_t *T, rci_t *L)
Constructs all possible row combinations using the gray code table.
Definition brilliantrussian.c:163
mzd_t * mzd_addmul_m4rm(mzd_t *C, mzd_t const *A, mzd_t const *B, int k)
Definition brilliantrussian.c:1014
mzd_t * mzd_mul_m4rm(mzd_t *C, mzd_t const *A, mzd_t const *B, int k)
Matrix multiplication using Konrod's method, i.e. compute C such that C == AB.
Definition brilliantrussian.c:999
void mzd_top_echelonize_m4ri(mzd_t *M, int k)
Given a matrix in upper triangular form compute the reduced row echelon form of that matrix.
Definition brilliantrussian.c:969
void mzd_process_rows3(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k, mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1, mzd_t const *T2, rci_t const *L2)
Same as mzd_process_rows but works with three Gray code tables in parallel.
Definition brilliantrussian.c:386
rci_t _mzd_top_echelonize_m4ri(mzd_t *A, int k, rci_t r, rci_t c, rci_t max_r)
Given a matrix in upper triangular form compute the reduced row echelon form of that matrix but only ...
Definition brilliantrussian.c:846
void mzd_process_rows6(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k, mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1, mzd_t const *T2, rci_t const *L2, mzd_t const *T3, rci_t const *L3, mzd_t const *T4, rci_t const *L4, mzd_t const *T5, rci_t const *L5)
Same as mzd_process_rows but works with six Gray code tables in parallel.
Definition brilliantrussian.c:537
int rci_t
Type of row and column indexes.
Definition misc.h:72
Dense matrices over GF(2) represented as a bit field.
Permutation matrices.
Dense matrices over GF(2).
Definition mzd.h:68