I am working on a Matrix class that will eventually do a lot of stuff, but early on I have already hit a snag, how do I initialize (in a constructor) the 2D vector I have declared.
//matrix class
#ifndef MAT_CLASS
#define MAT_CLASS
//template <typename T>
using namespace std;
class Matrix {
private:
Matrix();
unsigned rows;
unsigned cols;
protected:
vector<vector<double>> mat;
public:
Matrix(unsigned Rows, unsigned Cols);
Matrix operator+(Matrix mat);
Matrix operator-(Matrix mat);
Matrix operator*(double scalar);
Matrix operator/(double scalar);
Matrix operator*(Matrix mat);
static double det(Matrix mat);
Matrix multAddRow(unsigned row, double multiplier, unsigned rowToChange);
Matrix multSubRow(unsigned row, double multiplier, unsigned rowToChange);
Matrix divRow(double num);
Matrix identity();
Matrix gauss();
Matrix reducedGauss();
Matrix inverse();
};
Matrix::Matrix(){}
Matrix::Matrix(unsigned Rows, unsigned Cols){
rows=Rows;
cols=Cols;
//what do do here to make mat of size[Rows][Cols]
}
#endif
I am using Dev-C++ and the compiler that came with it.