-
Notifications
You must be signed in to change notification settings - Fork 0
/
matrices.hpp
36 lines (26 loc) · 863 Bytes
/
matrices.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
#include <cstddef>
class matrix {
private:
size_t N_, M_;
double* data_;
public:
matrix() noexcept;
matrix(size_t N, size_t M);
matrix(const matrix& m);
matrix(matrix&& m) noexcept;
~matrix();
size_t get_rows() const noexcept;
size_t get_columns() const noexcept;
matrix& resize(size_t N, size_t M);
matrix& operator=(matrix&& m) noexcept;
matrix& operator=(const matrix& m);
double& operator()(const size_t i, const size_t j);
double operator()(const size_t i, const size_t j) const;
matrix operator*(const matrix& m) const;
matrix& operator*=(const matrix& m);
matrix operator+(const matrix& m) const;
matrix& operator+=(const matrix& m);
};
std::istream& operator>>(std::istream& stream, matrix& m);
std::ostream& operator<<(std::ostream& stream, const matrix& m);