矩阵类 正常存储:
Design a template class Matrix that has the following private member variables:
- int rows
- int columns
- vector
values
where T is the type parameter.
Besides, it has the functions such that the main function runs correctly with the following output.
1 | EXAMPLE OUTPUT |
1 |
|
矩阵类 稀疏矩阵存储:
Design a class Sparse that implements interface Matrix: Sparse should has the following public object functions in addition:
A constructor Sparse(int rows, int column), which initializes all elements in the matrix to 0's.
A function Sparse Sparse::operator * (Sparse & sparse2), which returns the product of two sparse matrixes.
1 | EXAMPLE INPUT |
1 |
|