| 78 | } |
| 79 | |
| 80 | Matrix::Matrix(unsigned rows, unsigned cols, double **data) |
| 81 | : mRows{ rows } |
| 82 | , mCols{ cols } |
| 83 | , mRowVec{ mRows } |
| 84 | { |
| 85 | for(unsigned i = 0; i < mRows; i++) { |
| 86 | mRowVec[i].Reinit( mCols ); |
| 87 | for(unsigned j = 0; j < mCols; j++) { |
| 88 | if (data) |
| 89 | (*this)[i][j] = data[i][j]; |
| 90 | else |
| 91 | (*this)[i][j] = 0.0; |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | Matrix& Matrix::operator=(const Matrix &other) |
| 97 | { |