|
|
@ -11,12 +11,20 @@ private:
|
|
|
|
vector *cols;
|
|
|
|
vector *cols;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
matrix(const long long num_cols, const long long num_rows) {
|
|
|
|
matrix(const long long num_rows, const long long num_cols) {
|
|
|
|
this->num_cols = num_rows;
|
|
|
|
this->num_cols = num_cols;
|
|
|
|
this->num_rows = num_cols;
|
|
|
|
this->num_rows = num_rows;
|
|
|
|
this->cols = (vector *)calloc(sizeof(vector), num_rows);
|
|
|
|
this->cols = (vector *)calloc(sizeof(vector), num_cols);
|
|
|
|
for (long long i = 0; i < num_rows; i++) {
|
|
|
|
for (long long i = 0; i < num_cols; i++) {
|
|
|
|
this->cols[i] = vector(num_cols);
|
|
|
|
this->cols[i] = vector(num_rows);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
matrix(const matrix &m) {
|
|
|
|
|
|
|
|
this->num_cols = m.num_cols;
|
|
|
|
|
|
|
|
this->num_rows = m.num_rows;
|
|
|
|
|
|
|
|
this->cols = (vector *)calloc(sizeof(vector), m.num_cols);
|
|
|
|
|
|
|
|
for (long long i = 0; i < m.num_cols; i++) {
|
|
|
|
|
|
|
|
this->cols[i] = m[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
~matrix() {
|
|
|
|
~matrix() {
|
|
|
|