/usr/share/doc/libntl-dev/NTL/mat_ZZ.cpp.html is in libntl-dev 6.2.1-1.
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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>/Volumes/Unix/unix-files.noindex/ntl-new/ntl-6.1.0/doc/mat_ZZ.cpp.html</title>
<meta name="Generator" content="Vim/7.3">
<meta name="plugin-version" content="vim7.3_v6">
<meta name="syntax" content="cpp">
<meta name="settings" content="use_css">
<style type="text/css">
<!--
pre { font-family: monospace; color: #000000; background-color: #ffffff; }
body { font-family: monospace; color: #000000; background-color: #ffffff; }
.Statement { color: #b03060; font-weight: bold; }
.Constant { color: #ff8c00; }
.Type { color: #008b00; font-weight: bold; }
.String { color: #4a708b; }
.PreProc { color: #1874cd; }
.Comment { color: #0000ee; font-style: italic; }
-->
</style>
</head>
<body>
<pre>
<span class="Comment">/*</span><span class="Comment">*************************************************************************\</span>
<span class="Comment">MODULE: mat_ZZ</span>
<span class="Comment">SUMMARY:</span>
<span class="Comment">Defines the class mat_ZZ.</span>
<span class="Comment">\*************************************************************************</span><span class="Comment">*/</span>
<span class="PreProc">#include </span><span class="String"><NTL/matrix.h></span>
<span class="PreProc">#include </span><span class="String"><NTL/vec_vec_ZZ.h></span>
<span class="Type">typedef</span> Mat<ZZ> mat_ZZ; <span class="Comment">// backward compatibility</span>
<span class="Type">void</span> add(mat_ZZ& X, <span class="Type">const</span> mat_ZZ& A, <span class="Type">const</span> mat_ZZ& B);
<span class="Comment">// X = A + B</span>
<span class="Type">void</span> sub(mat_ZZ& X, <span class="Type">const</span> mat_ZZ& A, <span class="Type">const</span> mat_ZZ& B);
<span class="Comment">// X = A - B</span>
<span class="Type">void</span> negate(mat_ZZ& X, <span class="Type">const</span> mat_ZZ& A);
<span class="Comment">// X = - A</span>
<span class="Type">void</span> mul(mat_ZZ& X, <span class="Type">const</span> mat_ZZ& A, <span class="Type">const</span> mat_ZZ& B);
<span class="Comment">// X = A * B</span>
<span class="Type">void</span> mul(vec_ZZ& x, <span class="Type">const</span> mat_ZZ& A, <span class="Type">const</span> vec_ZZ& b);
<span class="Comment">// x = A * b</span>
<span class="Type">void</span> mul(vec_ZZ& x, <span class="Type">const</span> vec_ZZ& a, <span class="Type">const</span> mat_ZZ& B);
<span class="Comment">// x = a * B</span>
<span class="Type">void</span> mul(mat_ZZ& X, <span class="Type">const</span> mat_ZZ& A, <span class="Type">const</span> ZZ& b);
<span class="Type">void</span> mul(mat_ZZ& X, <span class="Type">const</span> mat_ZZ& A, <span class="Type">long</span> b);
<span class="Comment">// X = A * b</span>
<span class="Type">void</span> mul(mat_ZZ& X, <span class="Type">const</span> ZZ& a, <span class="Type">const</span> mat_ZZ& B);
<span class="Type">void</span> mul(mat_ZZ& X, <span class="Type">long</span> a, <span class="Type">const</span> mat_ZZ& B);
<span class="Comment">// X = a * B</span>
<span class="Type">void</span> determinant(ZZ& d, <span class="Type">const</span> mat_ZZ& A, <span class="Type">long</span> deterministic=<span class="Constant">0</span>);
ZZ determinant(<span class="Type">const</span> mat_ZZ& a, <span class="Type">long</span> deterministic=<span class="Constant">0</span>);
<span class="Comment">// d = determinant(A). If !deterministic, a randomized strategy may</span>
<span class="Comment">// be used that errs with probability at most 2^{-80}.</span>
<span class="Type">void</span> solve(ZZ& d, vec_ZZ& x,
<span class="Type">const</span> mat_ZZ& A, <span class="Type">const</span> vec_ZZ& b,
<span class="Type">long</span> deterministic=<span class="Constant">0</span>)
<span class="Comment">// computes d = determinant(A) and solves x*A = b*d if d != 0; A must</span>
<span class="Comment">// be a square matrix and have compatible dimensions with b. If</span>
<span class="Comment">// !deterministic, the computation of d may use a randomized strategy</span>
<span class="Comment">// that errs with probability 2^{-80}.</span>
<span class="Type">void</span> solve1(ZZ& d, vec_ZZ& x, <span class="Type">const</span> mat_ZZ& A, <span class="Type">const</span> vec_ZZ& b);
<span class="Comment">// A must be a square matrix.</span>
<span class="Comment">// If A is singular, this routine sets d = 0 and returns.</span>
<span class="Comment">// Otherwise, it computes d, x such that x*A == b*d, </span>
<span class="Comment">// such that d > 0 and minimal.</span>
<span class="Comment">// Note that d is a positive divisor of the determinant,</span>
<span class="Comment">// and is not in general equal to the determinant.</span>
<span class="Comment">// The routine is deterministic, and uses a Hensel lifting strategy.</span>
<span class="Comment">// For backward compatability, there is also a routine called</span>
<span class="Comment">// HenselSolve1 that simply calls solve1.</span>
<span class="Type">void</span> inv(ZZ& d, mat_ZZ& X, <span class="Type">const</span> mat_ZZ& A, <span class="Type">long</span> deterministic=<span class="Constant">0</span>);
<span class="Comment">// computes d = determinant(A) and solves X*A = I*d if d != 0; A must</span>
<span class="Comment">// be a square matrix. If !deterministic, the computation of d may</span>
<span class="Comment">// use a randomized strategy that errs with probability 2^{-80}.</span>
<span class="Comment">// NOTE: See LLL.txt for routines that compute the kernel and</span>
<span class="Comment">// image of an integer matrix.</span>
<span class="Comment">// NOTE: See HNF.txt for a routine that computes Hermite Normal Forms.</span>
<span class="Type">void</span> sqr(mat_ZZ& X, <span class="Type">const</span> mat_ZZ& A);
mat_ZZ sqr(<span class="Type">const</span> mat_ZZ& A);
<span class="Comment">// X = A*A </span>
<span class="Type">void</span> inv(mat_ZZ& X, <span class="Type">const</span> mat_ZZ& A);
mat_ZZ inv(<span class="Type">const</span> mat_ZZ& A);
<span class="Comment">// X = A^{-1}; error is raised if |det(A)| != 1.</span>
<span class="Type">void</span> power(mat_ZZ& X, <span class="Type">const</span> mat_ZZ& A, <span class="Type">const</span> ZZ& e);
mat_ZZ power(<span class="Type">const</span> mat_ZZ& A, <span class="Type">const</span> ZZ& e);
<span class="Type">void</span> power(mat_ZZ& X, <span class="Type">const</span> mat_ZZ& A, <span class="Type">long</span> e);
mat_ZZ power(<span class="Type">const</span> mat_ZZ& A, <span class="Type">long</span> e);
<span class="Comment">// X = A^e; e may be negative (in which case A must be nonsingular).</span>
<span class="Type">void</span> ident(mat_ZZ& X, <span class="Type">long</span> n);
mat_ZZ ident_mat_ZZ(<span class="Type">long</span> n);
<span class="Comment">// X = n x n identity matrix</span>
<span class="Type">long</span> IsIdent(<span class="Type">const</span> mat_ZZ& A, <span class="Type">long</span> n);
<span class="Comment">// test if A is the n x n identity matrix</span>
<span class="Type">void</span> diag(mat_ZZ& X, <span class="Type">long</span> n, <span class="Type">const</span> ZZ& d);
mat_ZZ diag(<span class="Type">long</span> n, <span class="Type">const</span> ZZ& d);
<span class="Comment">// X = n x n diagonal matrix with d on diagonal</span>
<span class="Type">long</span> IsDiag(<span class="Type">const</span> mat_ZZ& A, <span class="Type">long</span> n, <span class="Type">const</span> ZZ& d);
<span class="Comment">// test if X is an n x n diagonal matrix with d on diagonal</span>
<span class="Type">void</span> transpose(mat_ZZ& X, <span class="Type">const</span> mat_ZZ& A);
mat_ZZ transpose(<span class="Type">const</span> mat_ZZ& A);
<span class="Comment">// X = transpose of A</span>
<span class="Type">long</span> CRT(mat_ZZ& a, ZZ& prod, <span class="Type">const</span> mat_zz_p& A);
<span class="Comment">// Incremental Chinese Remaindering: If p is the current zz_p modulus with</span>
<span class="Comment">// (p, prod) = 1; Computes a' such that a' = a mod prod and a' = A mod p,</span>
<span class="Comment">// with coefficients in the interval (-p*prod/2, p*prod/2]; </span>
<span class="Comment">// Sets a := a', prod := p*prod, and returns 1 if a's value changed.</span>
<span class="Comment">// miscellaneous:</span>
<span class="Type">void</span> clear(mat_ZZ& a);
<span class="Comment">// x = 0 (dimension unchanged)</span>
<span class="Type">long</span> IsZero(<span class="Type">const</span> mat_ZZ& a);
<span class="Comment">// test if a is the zero matrix (any dimension)</span>
<span class="Comment">// operator notation:</span>
mat_ZZ <span class="Statement">operator</span>+(<span class="Type">const</span> mat_ZZ& a, <span class="Type">const</span> mat_ZZ& b);
mat_ZZ <span class="Statement">operator</span>-(<span class="Type">const</span> mat_ZZ& a, <span class="Type">const</span> mat_ZZ& b);
mat_ZZ <span class="Statement">operator</span>*(<span class="Type">const</span> mat_ZZ& a, <span class="Type">const</span> mat_ZZ& b);
mat_ZZ <span class="Statement">operator</span>-(<span class="Type">const</span> mat_ZZ& a);
<span class="Comment">// matrix/scalar multiplication:</span>
mat_ZZ <span class="Statement">operator</span>*(<span class="Type">const</span> mat_ZZ& a, <span class="Type">const</span> ZZ& b);
mat_ZZ <span class="Statement">operator</span>*(<span class="Type">const</span> mat_ZZ& a, <span class="Type">long</span> b);
mat_ZZ <span class="Statement">operator</span>*(<span class="Type">const</span> ZZ& a, <span class="Type">const</span> mat_ZZ& b);
mat_ZZ <span class="Statement">operator</span>*(<span class="Type">long</span> a, <span class="Type">const</span> mat_ZZ& b);
<span class="Comment">// matrix/vector multiplication:</span>
vec_ZZ <span class="Statement">operator</span>*(<span class="Type">const</span> mat_ZZ& a, <span class="Type">const</span> vec_ZZ& b);
vec_ZZ <span class="Statement">operator</span>*(<span class="Type">const</span> vec_ZZ& a, <span class="Type">const</span> mat_ZZ& b);
<span class="Comment">// assignment operator notation:</span>
mat_ZZ& <span class="Statement">operator</span>+=(mat_ZZ& x, <span class="Type">const</span> mat_ZZ& a);
mat_ZZ& <span class="Statement">operator</span>-=(mat_ZZ& x, <span class="Type">const</span> mat_ZZ& a);
mat_ZZ& <span class="Statement">operator</span>*=(mat_ZZ& x, <span class="Type">const</span> mat_ZZ& a);
mat_ZZ& <span class="Statement">operator</span>*=(mat_ZZ& x, <span class="Type">const</span> ZZ& a);
mat_ZZ& <span class="Statement">operator</span>*=(mat_ZZ& x, <span class="Type">long</span> a);
vec_ZZ& <span class="Statement">operator</span>*=(vec_ZZ& x, <span class="Type">const</span> mat_ZZ& a);
</pre>
</body>
</html>
|