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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
#ifndef math_Matrix_H__
#define math_Matrix_H__
#include <cstdlib>
#include <vector>
namespace meow{
template<class Entry>
class Matrix{
private:
size_t _rows;
size_t _cols;
std::vector<Entry> _entries;
//
size_t index(size_t __r, size_t __c) const;
public:
Matrix();
Matrix(Matrix const& __m);
Matrix(size_t __rows, size_t __cols, Entry const& __entry);
~Matrix();
Matrix& copy(Matrix const& __m);
bool valid() const;
size_t rows() const;
size_t cols() const;
size_t size(size_t __rows, size_t __cols);
Entry const& entry(size_t __i, size_t __j) const;
Entry const& entry(size_t __i, size_t __j, Entry const& __entry);
void entries(size_t __rFirst, size_t __rLast,
size_t __cFirst, size_t __cLast,
Entry const& __entry);
Matrix subMatrix(size_t __rFirst, size_t __rLast,
size_t __cFirst, size_t __cLast) const;
Matrix row(size_t __row) const;
Matrix col(size_t __col) const;
Matrix positive() const;
Matrix negative() const;
Matrix add(Matrix const& __m) const;
Matrix sub(Matrix const& __m) const;
Matrix mul(Matrix const& __m) const;
Matrix mul(Entry const& __s) const;
Matrix div(Entry const& __s) const;
Matrix identity () const;
Matrix& identitied();
Matrix transpose () const;
Matrix& transposed();
Matrix& operator=(Matrix const& __m);
Entry const& operator()(size_t __i, size_t __j) const;
Entry & operator()(size_t __i, size_t __j);
Matrix operator+() const;
Matrix operator-() const;
Matrix operator+(Matrix const& __m) const;
Matrix operator-(Matrix const& __m) const;
Matrix operator*(Matrix const& __m) const;
Matrix operator*(Entry const& __s) const;
Matrix operator/(Entry const& __s) const;
};
}
#include "Matrix.hpp"
#endif // math_Matrix_H__
|