M4RI 20200125
brilliantrussian.h
Go to the documentation of this file.
1
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 <string.h>
39#include <stdlib.h>
40
41#include <m4ri/mzd.h>
42#include <m4ri/mzp.h>
43
56void mzd_make_table(mzd_t const *M, rci_t r, rci_t c, int k, mzd_t *T, rci_t *L);
57
74void 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);
75
91void 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);
92
110void mzd_process_rows3(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k,
111 mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1,
112 mzd_t const *T2, rci_t const *L2);
113
133void mzd_process_rows4(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k,
134 mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1,
135 mzd_t const *T2, rci_t const *L2, mzd_t const *T3, rci_t const *L3);
136
158void mzd_process_rows5(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k,
159 mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1,
160 mzd_t const *T2, rci_t const *L2, mzd_t const *T3, rci_t const *L3,
161 mzd_t const *T4, rci_t const *L4);
162
186void mzd_process_rows6(mzd_t *M, rci_t startrow, rci_t endrow, rci_t startcol, int k,
187 mzd_t const *T0, rci_t const *L0, mzd_t const *T1, rci_t const *L1,
188 mzd_t const *T2, rci_t const *L2, mzd_t const *T3, rci_t const *L3,
189 mzd_t const *T4, rci_t const *L4, mzd_t const *T5, rci_t const *L5);
190
213rci_t _mzd_echelonize_m4ri(mzd_t *A, const int full, int k, int heuristic, const double threshold);
214
225void mzd_top_echelonize_m4ri(mzd_t *M, int k);
226
241rci_t _mzd_top_echelonize_m4ri(mzd_t *A, int k, rci_t r, rci_t c, rci_t max_r);
242
254mzd_t *mzd_inv_m4ri(mzd_t *dst, const mzd_t* src, int k);
255
272mzd_t *mzd_mul_m4rm(mzd_t *C, mzd_t const *A, mzd_t const *B, int k);
273
274
290mzd_t *mzd_addmul_m4rm(mzd_t *C, mzd_t const *A, mzd_t const *B, int k);
291
316mzd_t *_mzd_mul_m4rm(mzd_t *C, mzd_t const *A, mzd_t const *B, int k, int clear);
317
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:969
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:356
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:477
rci_t _mzd_echelonize_m4ri(mzd_t *A, const int full, int k, int heuristic, const double threshold)
Definition: brilliantrussian.c:585
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:1033
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:226
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:175
mzd_t * mzd_addmul_m4rm(mzd_t *C, mzd_t const *A, mzd_t const *B, int k)
Definition: brilliantrussian.c:1013
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:998
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:965
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:390
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:838
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:527
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:86