Advertisement
bloowper

Untitled

Jun 15th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.79 KB | None | 0 0
  1. #include <iostream>
  2. #include "matrix.h"
  3. using namespace std;
  4.  
  5. int main(int argc, char argv[])
  6. {
  7.     //test
  8.     cout << "//test metody transpone_matrix" << endl;
  9.     cout << "//test" << endl;
  10.     vector< vector<double> > vector1{ {2,5},{6,8},{8,10},{7,9} };
  11.     matrix new_matrix(vector1);
  12.     cout << "******"<<endl;
  13.     new_matrix.print_matrix();
  14.     cout << "******"<<endl<<endl;
  15.  
  16.     //test metody transpone_matrix
  17.    
  18.     cout << "******" << endl;
  19.     new_matrix.transpone_matrix();
  20.     new_matrix.print_matrix();
  21.     cout << "******" << endl << endl;
  22.  
  23.     //test metody liczenia wyznaczika
  24.     cout << "testt metody liczenia wyznacnzika" << endl;
  25.     cout << "******" << endl;
  26.     vector< vector<double> > vector2{ {6,8},{3,2} };
  27.     matrix new_matrix2(vector2);
  28.     new_matrix2.print_matrix();
  29.     cout << "******" << endl;
  30.     cout << "DET : " << new_matrix2.det_matrix()<<endl;
  31.     cout << "******" << endl << endl;
  32.  
  33.     //test metody tworzenia minorw z vectora
  34.     cout << "//test metody tworzenia minorw" << endl;
  35.     vector< vector<double> > vector3{ {1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16} };
  36.  
  37.     matrix new_matrix3(vector3);
  38.     new_matrix3.print_matrix();
  39.     cout << endl<<endl;
  40.     matrix new_matrix3_minor(vector3, 0,0);
  41.     new_matrix3_minor.print_matrix();
  42.  
  43.  
  44.     //test metody liczenia wyznacznika dla macierzy >2x2
  45.     cout <<endl<<endl<< "//test metody liczenia wyznacznika dla macierzy >2x2" << endl;
  46.     vector< vector<double> > vector4{ {1,3,0,-1},{0,2,1,3},{3,1,2,1},{-1,2,0,3} };
  47.     matrix new_matrix4(vector4);
  48.     new_matrix4.print_matrix();
  49.     cout << "(poprawny to 14)DET: " << new_matrix4.det_matrix();
  50.  
  51.     cout << endl << endl;
  52.     vector< vector<double> > vector5{ {1,3,4,},{0,3,0},{2,-2,-3} };
  53.     matrix new_matrix5(vector5);
  54.     new_matrix5.print_matrix();
  55.     cout << "(poprawny to -33)DET: " << new_matrix5.det_matrix();
  56.    
  57.     getchar();
  58.     return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement