source: git/ntl/doc/mat_ZZ.txt @ 2cfffe

spielwiese
Last change on this file since 2cfffe was 2cfffe, checked in by Hans Schönemann <hannes@…>, 21 years ago
This commit was generated by cvs2svn to compensate for changes in r6316, which included commits to RCS files with non-trunk default branches. git-svn-id: file:///usr/local/Singular/svn/trunk@6317 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 4.8 KB
Line 
1
2/**************************************************************************\
3
4MODULE: mat_ZZ
5
6SUMMARY:
7
8Defines the class mat_ZZ.
9
10\**************************************************************************/
11
12
13#include <NTL/matrix.h>
14#include <NTL/vec_vec_ZZ.h>
15
16NTL_matrix_decl(ZZ,vec_ZZ,vec_vec_ZZ,mat_ZZ)
17NTL_io_matrix_decl(ZZ,vec_ZZ,vec_vec_ZZ,mat_ZZ)
18NTL_eq_matrix_decl(ZZ,vec_ZZ,vec_vec_ZZ,mat_ZZ)
19
20void add(mat_ZZ& X, const mat_ZZ& A, const mat_ZZ& B);
21// X = A + B
22
23void sub(mat_ZZ& X, const mat_ZZ& A, const mat_ZZ& B);
24// X = A - B
25
26void negate(mat_ZZ& X, const mat_ZZ& A);
27// X = - A
28
29void mul(mat_ZZ& X, const mat_ZZ& A, const mat_ZZ& B);
30// X = A * B
31
32void mul(vec_ZZ& x, const mat_ZZ& A, const vec_ZZ& b);
33// x = A * b
34
35void mul(vec_ZZ& x, const vec_ZZ& a, const mat_ZZ& B);
36// x = a * B
37
38void mul(mat_ZZ& X, const mat_ZZ& A, const ZZ& b);
39void mul(mat_ZZ& X, const mat_ZZ& A, long b);
40// X = A * b
41
42void mul(mat_ZZ& X, const ZZ& a, const mat_ZZ& B);
43void mul(mat_ZZ& X, long a, const mat_ZZ& B);
44// X = a * B
45
46
47
48void determinant(ZZ& d, const mat_ZZ& A, long deterministic=0);
49ZZ determinant(const mat_ZZ& a, long deterministic=0);
50// d = determinant(A).  If !deterministic, a randomized strategy may
51// be used that errs with probability at most 2^{-80}.
52
53
54
55void solve(ZZ& d, vec_ZZ& x,
56           const mat_ZZ& A, const vec_ZZ& b,
57           long deterministic=0)
58// computes d = determinant(A) and solves x*A = b*d if d != 0; A must
59// be a square matrix and have compatible dimensions with b.  If
60// !deterministic, the computation of d may use a randomized strategy
61// that errs with probability 2^{-80}.
62
63
64
65void solve1(ZZ& d, vec_ZZ& x, const mat_ZZ& A, const vec_ZZ& b);
66// A must be a square matrix.
67// If A is singular, this routine sets d = 0 and returns.
68// Otherwise, it computes d, x such that x*A == b*d,
69// such that d > 0 and minimal.
70// Note that d is a positive divisor of the determinant,
71// and is not in general equal to the determinant.
72// The routine is deterministic, and uses either a Hensel lifting
73// strategy.
74
75// For backward compatability, there is also a routine called
76// HenselSolve1 that simply calls solve1.
77
78
79void inv(ZZ& d, mat_ZZ& X, const mat_ZZ& A, long deterministic=0);
80// computes d = determinant(A) and solves X*A = I*d if d != 0; A must
81// be a square matrix.  If !deterministic, the computation of d may
82// use a randomized strategy that errs with probability 2^{-80}.
83
84
85// NOTE:  See LLL.txt for routines that compute the kernel and
86// image of an integer matrix.
87
88// NOTE: See HNF.txt for a routine that computes Hermite Normal Forms.
89
90void sqr(mat_ZZ& X, const mat_ZZ& A);
91mat_ZZ sqr(const mat_ZZ& A);
92// X = A*A   
93
94void inv(mat_ZZ& X, const mat_ZZ& A);
95mat_ZZ inv(const mat_ZZ& A);
96// X = A^{-1}; error is raised if |det(A)| != 1.
97
98void power(mat_ZZ& X, const mat_ZZ& A, const ZZ& e);
99mat_ZZ power(const mat_ZZ& A, const ZZ& e);
100
101void power(mat_ZZ& X, const mat_ZZ& A, long e);
102mat_ZZ power(const mat_ZZ& A, long e);
103// X = A^e; e may be negative (in which case A must be nonsingular).
104
105
106
107void ident(mat_ZZ& X, long n);
108mat_ZZ ident_mat_ZZ(long n);
109// X = n x n identity matrix
110
111long IsIdent(const mat_ZZ& A, long n);
112// test if A is the n x n identity matrix
113
114void diag(mat_ZZ& X, long n, const ZZ& d);
115mat_ZZ diag(long n, const ZZ& d);
116// X = n x n diagonal matrix with d on diagonal
117
118long IsDiag(const mat_ZZ& A, long n, const ZZ& d);
119// test if X is an  n x n diagonal matrix with d on diagonal
120
121
122void transpose(mat_ZZ& X, const mat_ZZ& A);
123mat_ZZ transpose(const mat_ZZ& A);
124// X = transpose of A
125
126
127long CRT(mat_ZZ& a, ZZ& prod, const mat_zz_p& A);
128// Incremental Chinese Remaindering: If p is the current zz_p modulus with
129// (p, prod) = 1; Computes a' such that a' = a mod prod and a' = A mod p,
130// with coefficients in the interval (-p*prod/2, p*prod/2];
131// Sets a := a', prod := p*prod, and returns 1 if a's value changed.
132
133
134
135// miscellaneous:
136
137void clear(mat_ZZ& a);
138// x = 0 (dimension unchanged)
139
140long IsZero(const mat_ZZ& a);
141// test if a is the zero matrix (any dimension)
142
143
144// operator notation:
145
146mat_ZZ operator+(const mat_ZZ& a, const mat_ZZ& b);
147mat_ZZ operator-(const mat_ZZ& a, const mat_ZZ& b);
148mat_ZZ operator*(const mat_ZZ& a, const mat_ZZ& b);
149
150mat_ZZ operator-(const mat_ZZ& a);
151
152
153// matrix/scalar multiplication:
154
155mat_ZZ operator*(const mat_ZZ& a, const ZZ& b);
156mat_ZZ operator*(const mat_ZZ& a, long b);
157
158mat_ZZ operator*(const ZZ& a, const mat_ZZ& b);
159mat_ZZ operator*(long a, const mat_ZZ& b);
160
161// matrix/vector multiplication:
162
163vec_ZZ operator*(const mat_ZZ& a, const vec_ZZ& b);
164
165vec_ZZ operator*(const vec_ZZ& a, const mat_ZZ& b);
166
167
168
169// assignment operator notation:
170
171mat_ZZ& operator+=(mat_ZZ& x, const mat_ZZ& a);
172mat_ZZ& operator-=(mat_ZZ& x, const mat_ZZ& a);
173mat_ZZ& operator*=(mat_ZZ& x, const mat_ZZ& a);
174
175mat_ZZ& operator*=(mat_ZZ& x, const ZZ& a);
176mat_ZZ& operator*=(mat_ZZ& x, long a);
177
178vec_ZZ& operator*=(vec_ZZ& x, const mat_ZZ& a);
179
180
Note: See TracBrowser for help on using the repository browser.