Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. #pragma once
  2. #include <iostream>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. class Matrix {
  7. int m,n;
  8. double** p;
  9. static int NextID;
  10. const int ID;
  11. public:
  12. Matrix();
  13. Matrix(int, int);
  14. Matrix(const Matrix&); // конструктор копирования
  15. ~Matrix(); // деструктор
  16. void SetM(int str) {m=str;};
  17. void SetN(int col){n=col;};
  18. int GetM() const {return m;};
  19. int GetN() const {return n;};
  20. void SetAij(int, int, double);
  21. double GetAij(int, int) const;
  22. int GetID() const;
  23. Matrix& operator=(const Matrix&); // оператор присваивания
  24. Matrix& operator+=(const Matrix&); // составные оператор присваивания
  25. Matrix& operator-=(const Matrix&);
  26. Matrix& operator*=(const Matrix&);
  27.  
  28. Matrix operator*(double); // умножение на константу справа
  29. friend Matrix operator*(double, const Matrix&); // умножение на константу слева
  30. Matrix& operator*=(double); // умножение на константу и присваивание
  31. Matrix operator/(double); // деление на константу
  32. Matrix& operator/=(double); // деление на константу и присваивание
  33.  
  34. Matrix operator+(const Matrix&); // сложение матриц
  35. Matrix operator-(const Matrix&); // вычитание матриц
  36. Matrix operator*(const Matrix&); // умножение матриц
  37.  
  38. bool operator==(const Matrix&) const; // сравнение матриц на равенство и неравенство
  39. bool operator!=(const Matrix&) const;
  40.  
  41. friend istream& operator>>(istream&, Matrix&); // ввод и вывод матрицы
  42. friend ostream& operator<<(ostream&, const Matrix&);
  43. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement