?? p53_54test.cpp
字號:
//Test is T55_59.cpp
#include <iostream.h>
const int MaxTerms = 100;
template <class Type> class SparseMatrix; //稀疏矩陣的類聲明
template <class Type> class Trituple { //三元組類Trituple
friend class SparseMatrix<Type> ;
friend istream & operator >> ( istream & , SparseMatrix<Type> & );
friend ostream & operator << ( ostream & , SparseMatrix<Type> & );
private:
int row, col; //非零元素的行號、列號
Type value; //非零元素的值
};
template <class Type> class SparseMatrix {
//對象: 是一個三元組<row, column, value>的集合。其中, row和column是整數, 記憶矩陣
//元素所在的行號和列號,而value是矩陣元素的值。
friend istream & operator >> ( istream & , SparseMatrix<Type> & );
friend ostream & operator << ( ostream & , SparseMatrix<Type> & );
public:
SparseMatrix ();
SparseMatrix ( int MaxRow, int MaxCol ): Rows( MaxRow ), Cols( MaxCol ){}; //構造函數
//建立一個MaxRow行, Maxcol列的稀疏矩陣。
SparseMatrix<Type> Transpose ( );
//對*t
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -