/usr/share/doc/libntl-dev/NTL/mat_GF2.txt is in libntl-dev 10.5.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | /**************************************************************************\
MODULE: mat_GF2
SUMMARY:
Defines the class mat_GF2.
\**************************************************************************/
#include <NTL/matrix.h>
#include <NTL/vec_vec_GF2.h>
typedef Mat<GF2> mat_GF2; // backward compatibility
void conv(mat_GF2& X, const vec_vec_GF2& A);
mat_GF2 to_mat_GF2(const vec_vec_GF2& A);
// convert a vector of vec_GF2's to a matrix
// procedural arithmetic routines:
void add(mat_GF2& X, const mat_GF2& A, const mat_GF2& B);
// X = A + B
void sub(mat_GF2& X, const mat_GF2& A, const mat_GF2& B);
// X = A - B = A + B
void negate(mat_GF2& X, const mat_GF2& A);
// X = -A = A
void mul(mat_GF2& X, const mat_GF2& A, const mat_GF2& B);
// X = A * B
void mul(vec_GF2& x, const mat_GF2& A, const vec_GF2& b);
// x = A * b
void mul(vec_GF2& x, const vec_GF2& a, const mat_GF2& B);
// x = a * B
void mul(mat_GF2& X, const mat_GF2& A, GF2 b);
void mul(mat_GF2& X, const mat_GF2& A, long b);
// X = A * b
void mul(mat_GF2& X, GF2 a, const mat_GF2& B);
void mul(mat_GF2& X, long a, const mat_GF2& B);
// X = a * B
void determinant(GF2& d, const mat_GF2& A);
GF2 determinant(const mat_GF2& A);
// d = determinant of A
void transpose(mat_GF2& X, const mat_GF2& A);
mat_GF2 transpose(const mat_GF2& A);
// X = transpose of A
void solve(GF2& d, vec_GF2& x, const mat_GF2& A, const vec_GF2& b);
// A is an n x n matrix, b is a length n vector. Computes d = determinant(A).
// If d != 0, solves x*A = b.
void solve(GF2& d, const mat_GF2& A, vec_GF2& x, const vec_GF2& b);
// A is an n x n matrix, b is a length n vector. Computes d = determinant(A).
// If d != 0, solves A*x = b (so x and b are treated as a column vectors).
void inv(GF2& d, mat_GF2& X, const mat_GF2& A);
// A is an n x n matrix. Computes d = det(A). If d != 0,
// computes X = A^{-1}.
void sqr(mat_GF2& X, const mat_GF2& A);
mat_GF2 sqr(const mat_GF2& A);
// X = A*A
void inv(mat_GF2& X, const mat_GF2& A);
mat_GF2 inv(const mat_GF2& A);
// X = A^{-1}; error is raised if A is singular
void power(mat_GF2& X, const mat_GF2& A, const ZZ& e);
mat_GF2 power(const mat_GF2& A, const ZZ& e);
void power(mat_GF2& X, const mat_GF2& A, long e);
mat_GF2 power(const mat_GF2& A, long e);
// X = A^e; e may be negative (in which case A must be nonsingular).
void ident(mat_GF2& X, long n);
mat_GF2 ident_mat_GF2(long n);
// X = n x n identity matrix
long IsIdent(const mat_GF2& A, long n);
// test if A is n x n identity matrix
void diag(mat_GF2& X, long n, GF2 d);
mat_GF2 diag(long n, GF2 d);
// X = n x n diagonal matrix with diagonal element d
long IsDiag(const mat_GF2& A, long n, long d);
// test if X is an n x n diagonal matrix with diagonal element (d mod 2)
void random(mat_GF2& x, long n, long m); // x = random n x m matrix
mat_GF2 random_mat_GF2(long n, long m);
long gauss(mat_GF2& M);
long gauss(mat_GF2& M, long w);
// Performs unitary row operations so as to bring M into row echelon
// form. If the optional argument w is supplied, stops when first w
// columns are in echelon form. The return value is the rank (or the
// rank of the first w columns).
void image(mat_GF2& X, const mat_GF2& A);
// The rows of X are computed as basis of A's row space. X is is row
// echelon form
void kernel(mat_GF2& X, const mat_GF2& A);
// Computes a basis for the kernel of the map x -> x*A. where x is a
// row vector.
// miscellaneous:
void clear(mat_GF2& X);
// X = 0 (dimension unchanged)
long IsZero(const mat_GF2& A);
// test if A is the zero matrix (any dimension)
// arithmetic operator notation:
mat_GF2 operator+(const mat_GF2& a, const mat_GF2& b);
mat_GF2 operator-(const mat_GF2& a, const mat_GF2& b);
mat_GF2 operator*(const mat_GF2& a, const mat_GF2& b);
mat_GF2 operator-(const mat_GF2& a);
// matrix/scalar multiplication:
mat_GF2 operator*(const mat_GF2& a, GF2 b);
mat_GF2 operator*(const mat_GF2& a, long b);
mat_GF2 operator*(GF2 a, const mat_GF2& b);
mat_GF2 operator*(long a, const mat_GF2& b);
// matrix/vector multiplication:
vec_GF2 operator*(const mat_GF2& a, const vec_GF2& b);
vec_GF2 operator*(const vec_GF2& a, const mat_GF2& b);
// assignment operator notation:
mat_GF2& operator+=(mat_GF2& x, const mat_GF2& a);
mat_GF2& operator-=(mat_GF2& x, const mat_GF2& a);
mat_GF2& operator*=(mat_GF2& x, const mat_GF2& a);
mat_GF2& operator*=(mat_GF2& x, GF2 a);
mat_GF2& operator*=(mat_GF2& x, long a);
vec_GF2& operator*=(vec_GF2& x, const mat_GF2& a);
|