0

I know they are out there, but I think that I can learn a lot by creating my own. I do not want to get too convoluted with optimizing this thing, but I was hoping some folks could offer some input.

I am narrowing the scope of this project so that the goal is to end up with a Matrix class that could be used for Gaussian elimination and matrix addition and multiplication for now.

My outline is as follows:

Code:
1. Class name: Matrix

2. Uses <vector> as a building block.

3. Constructors should consider:
  a. Data Type
  b. Size of Matrix to be created 

4. Member functions:
  a. row swapping
  b. row multiply by non zero, real, constant
  c. add multiple of one row to another row 
  d. get/set Element
  e. augment (to append column of constants for solving systems)
  f. gauss solve

5. Properties:
  a. is singular
  b. is zero
  c. is square

I am sure there is much to consider, but I am just looking for a starting point.

Do you see any problems with using vector as my building block? Any other elementary member functions/properties you would suggest?

Thanks!

4

1 回答 1

0

这看起来是一个好的开始。我会开始构建和测试你所拥有的......然后在需要时进行更改。

一旦您开始编写代码并进行测试,您将看到需要更改或添加的内容。

我会从一个 2x2 矩阵开始,然后再转向更大的矩阵。

于 2012-09-19T01:54:39.953 回答