📄 spamatrix.3.man
字号:
SPAMATRIX(derived) C++ UITILITY CLASSES SPAMATRIX(derived) Jun 1 15:20NAME SpaMatrix class template, inherited from MatrixSYNOPSIS #include <Matrix.hh> class SpaMatrix : public Matrix<Type> \fIPublic members\fP SpaMatrix(int,int,int); SpaMatrix(Vector<Type>&, Vector<int>&, Vector<int>&); SpaMatrix(Vector<Type>&, int*, int*); SpaMatrix(const SpaMatrix<Type>&); ~SpaMatrix(); const int nzSize() const; const char* matrixType() const; Type& operator[](int i); const Vector<Type> colVector(int) const; const Vector<Type> rowVector(int) const; Type operator()(char*, int); Type operator()(int, char*); Type rowMax(int); Type rowMin(int); Type colMax(int); Type colMin(int); const Type nzElem(int i) const; const int colPos(int i) const; const int rowPos(int i) const; const int nzRow(int i) const; operator SpaMatrix<int>(); operator SpaMatrix<long>(); operator SpaMatrix<float>(); operator SpaMatrix<double>(); int rowCount(int); Type rowNorm(int, int); Type rowNorm2(int); Type rowDot(int, const Vector<Type>&); Vector<Type> rowScale(int, Type); SpaMatrix<Type> operator-(); SpaMatrix<Type>& operator=(const SpaMatrix<Type>&); SpaMatrix<Type>& operator+=(Type); SpaMatrix<Type>& operator-=(Type); SpaMatrix<Type>& operator*=(Type); SpaMatrix<Type>& operator/=(Type); Vector<Type> atdotx(const Vector<Type>&); Vector<Type> adotx(const Vector<Type>&); const SpaMatrix<Type>&); const Vector<Type>&); Type); const SpaMatrix<Type>&); Type); const SpaMatrix<Type>&); Type); const SpaMatrix<Type>&); Type); \fIFriends\fP ostream& operator<<(ostream&, Vector<Type> operator*(const SpaMatrix<Type>&, SpaMatrix<Type> operator+(const SpaMatrix<Type>&, SpaMatrix<Type> operator+(Type, SpaMatrix<Type> operator-(const SpaMatrix<Type>&, SpaMatrix<Type> operator-(Type, SpaMatrix<Type> operator*(const SpaMatrix<Type>&, SpaMatrix<Type> operator*(Type, SpaMatrix<Type> operator/(const SpaMatrix<Type>&, \fIPrivate members\fP int nz; Vector<Type>* elem; Vector<int>* icol; Vector<int>* irow;DESCRIPTION SpaMatrix<Type> is a derived sparse matrix class from Matrix, it manages to do algebraic operations of two-dimensional matrix using sparse-matrix representation. This class is especially useful for handling large, sparse linear systems. it also include some basic row operations. DESCRIPTION Constructors: SpaMatrix(nz,m,n): construct an mxn SpaMatrix with nz nonzeros; SpaMatrix(xx, mm, nn): construct a SpaMatrix with non-zero elements in the Vector xx, row and column indices in Vector<int> mm and nn respectively; SpaMatrix(xx, mm, nn): construct a SpaMatrix with non-zero elements in the Vector xx, row and column indices in integer arrays mm and nn respectively; SpaMatrix(A): copy SpaMatrix A to a new SpaMatrix; Fetching information: int nzSize(): returns number of non-zero elements; char* matrixType(): return the name of the matrix type; Vector<Type> colVector(i): return the ith column; Vector<Type> rowVector(int): return the ith row; Type nzElem(i): returns the ith non-zero element; int colPos(i): column index of the ith non-zero element; int rowPos(i): row index of the ith non-zero element; Type operator()(char*, i): summation of the ith row; Type operator()(i, char*): summation of the ith column; Type rowMax(i): Maximum element of the ith row; Type rowMin(i): Minimum element of the ith row; Type colMax(i): Maximum element of the ith column; Type colMin(i): Minimum element of the ith column; int rowCount(i): count number of non-zeros of the ith row; Type rowNorm(i, p): returns the p-norm of the ith row; Type rowNorm2(int): return the 2-norm of the ith row; Type rowDot(i, v): returns the dot product of the ith row with the Vector v; Vector<Type> rowScale(i, fact): scale the ith row with fact; Modifying the SpaMatrix: Type& operator[](i): access the ith non-zero element; Arithmatic: Operators -, =, +=, -=, *= /=, +, -, *, /, arithmatics with other Matrix, Vectors, a single number; Vector<Type> adotx(x): dot product with Vector x; Vector<Type> atdotx: transpose of the SpaMatrix dots with Vector x; I/O operators: <<, >> CAVEATSDEFINED MACROS SPAMATRIX_HHINCLUDED FILES "Vector.hh" "Matrix.hh" "DensMatrix.hh"SOURCE FILES SpaMatrix.hh
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -