?? mat_lzz_p.txt
字號:
/**************************************************************************\MODULE: mat_zz_pSUMMARY:Defines the class mat_zz_p.\**************************************************************************/#include <NTL/matrix.h>#include "vec_vec_zz_p.h"NTL_matrix_decl(zz_p,vec_zz_p,vec_vec_zz_p,mat_zz_p)NTL_io_matrix_decl(zz_p,vec_zz_p,vec_vec_zz_p,mat_zz_p)NTL_eq_matrix_decl(zz_p,vec_zz_p,vec_vec_zz_p,mat_zz_p)void add(mat_zz_p& X, const mat_zz_p& A, const mat_zz_p& B); // X = A + Bvoid sub(mat_zz_p& X, const mat_zz_p& A, const mat_zz_p& B); // X = A - Bvoid mul(mat_zz_p& X, const mat_zz_p& A, const mat_zz_p& B); // X = A * Bvoid mul(vec_zz_p& x, const mat_zz_p& A, const vec_zz_p& b); // x = A * bvoid mul(vec_zz_p& x, const vec_zz_p& a, const mat_zz_p& B); // x = a * Bvoid mul(mat_zz_p& X, const mat_zz_p& A, zz_p b);void mul(mat_zz_p& X, const mat_zz_p& A, long b);// X = A * bvoid mul(mat_zz_p& X, zz_p a, const mat_zz_p& B);void mul(mat_zz_p& X, long a, const mat_zz_p& B);// X = a * Bvoid determinant(zz_p& d, const mat_zz_p& A);zz_p determinant(const mat_zz_p& a); // d = determinant(A)void transpose(mat_zz_p& X, const mat_zz_p& A);mat_zz_p transpose(const mat_zz_p& A);// X = transpose of Avoid solve(zz_p& d, vec_zz_p& X, const mat_zz_p& A, const vec_zz_p& 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 inv(zz_p& d, mat_zz_p& X, const mat_zz_p& A);// A is an n x n matrix. Computes d = determinant(A). If d != 0,// computes X = A^{-1}.void sqr(mat_zz_p& X, const mat_zz_p& A);mat_zz_p sqr(const mat_zz_p& A);// X = A*A void inv(mat_zz_p& X, const mat_zz_p& A);mat_zz_p inv(const mat_zz_p& A);// X = A^{-1}; error is raised if A is singularvoid power(mat_zz_p& X, const mat_zz_p& A, const ZZ& e);mat_zz_p power(const mat_zz_p& A, const ZZ& e);void power(mat_zz_p& X, const mat_zz_p& A, long e);mat_zz_p power(const mat_zz_p& A, long e);// X = A^e; e may be negative (in which case A must be nonsingular).void ident(mat_zz_p& X, long n);mat_zz_p ident_mat_zz_p(long n);// X = n x n identity matrixlong IsIdent(const mat_zz_p& A, long n);// test if A is the n x n identity matrixvoid diag(mat_zz_p& X, long n, zz_p d);mat_zz_p diag(long n, zz_p d);// X = n x n diagonal matrix with d on diagonallong IsDiag(const mat_zz_p& A, long n, zz_p d);// test if X is an n x n diagonal matrix with d on diagonallong gauss(mat_zz_p& M);long gauss(mat_zz_p& 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_zz_p& X, const mat_zz_p& A);// The rows of X are computed as basis of A's row space. X is is row// echelon formvoid kernel(mat_zz_p& X, const mat_zz_p& A);// Computes a basis for the kernel of the map x -> x*A. where x is a// row vector.// miscellaneous:void clear(mat_zz_p& a);// x = 0 (dimension unchanged)long IsZero(const mat_zz_p& a);// test if a is the zero matrix (any dimension)// operator notation:mat_zz_p operator+(const mat_zz_p& a, const mat_zz_p& b);mat_zz_p operator-(const mat_zz_p& a, const mat_zz_p& b);mat_zz_p operator*(const mat_zz_p& a, const mat_zz_p& b);mat_zz_p operator-(const mat_zz_p& a);// matrix/scalar multiplication:mat_zz_p operator*(const mat_zz_p& a, zz_p b);mat_zz_p operator*(const mat_zz_p& a, long b);mat_zz_p operator*(zz_p a, const mat_zz_p& b);mat_zz_p operator*(long a, const mat_zz_p& b);// matrix/vector multiplication:vec_zz_p operator*(const mat_zz_p& a, const vec_zz_p& b);vec_zz_p operator*(const vec_zz_p& a, const mat_zz_p& b);// assignment operator notation:mat_zz_p& operator+=(mat_zz_p& x, const mat_zz_p& a);mat_zz_p& operator-=(mat_zz_p& x, const mat_zz_p& a);mat_zz_p& operator*=(mat_zz_p& x, const mat_zz_p& a);mat_zz_p& operator*=(mat_zz_p& x, zz_p a);mat_zz_p& operator*=(mat_zz_p& x, long a);vec_zz_p& operator*=(vec_zz_p& x, const mat_zz_p& a);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -