need to valgrind

This commit is contained in:
2022-03-28 21:32:22 -05:00
parent 77ab0a6a6e
commit 9b8dd8c6c6
2 changed files with 49 additions and 13 deletions

View File

@@ -8,13 +8,33 @@
* @copyright Copyright (c) 2022
*
*/
#include<iostream>
#include <iostream>
#include "matrix.h"
using namespace std;
int main()
{
Matrix m1(2,2);
int rows, cols;
cout << "Enter the number of rows in the test matrix: " << endl;
cin >> rows;
cout << "Enter the number of columns in the test matrix: " << endl;
cin >> cols;
Matrix m1(rows,cols);
// add more tests
for(int i = 0; i < rows; i++){
for(int j = 0; j < cols; j++){
m1[i][j] = 4.268394 + (i+7)*(j+7);
}
m1[0][0] = 4.20;
m1[0][1] = 6.9;
m1[0][2] = 1.337;
m1[0][3] = 12.18;
}
cout << m1 << endl;
m1*5;
cout << m1 << endl;
m1.clear();
cout << m1;
return 0;
}