MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / Matrix

Class Matrix

src/RaceNet/Matrix.h:14–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12
13template<class T>
14class Matrix {
15public:
16 Matrix<T>(int height, int width);
17
18 Matrix<T>(std::vector<std::vector<T> > const &array);
19
20 Matrix<T>();
21
22 int getHeight();
23
24 int getWidth();
25
26 void fill(T const &value);
27
28 void put(int h, int w, T const &value);
29
30 T get(int h, int w) const;
31
32 Matrix<T> add(T const &value);
33
34 Matrix<T> subtract(T const &value);
35
36 Matrix<T> multiply(T const &value);
37
38 Matrix<T> add(Matrix<T> const &m) const;
39
40 Matrix<T> subtract(Matrix<T> const &m) const;
41
42 Matrix<T> multiply(Matrix<T> const &m) const;
43
44 Matrix<T> dot(Matrix<T> const &m) const;
45
46 Matrix<T> transpose() const;
47
48 Matrix<T> applyFunction(T (*function)(T)) const;
49
50 Matrix<T> subMatrix(int startH, int startW, int h, int w) const;
51
52 void print(std::ostream &flux) const;
53
54 bool operator==(Matrix<T> const &m);
55
56 bool operator!=(Matrix<T> const &m);
57
58 void operator+=(Matrix<T> const &m);
59
60 void operator-=(Matrix<T> const &m);
61
62 void operator*=(Matrix<T> const &m);
63
64 void operator+=(T const &m);
65
66 void operator-=(T const &m);
67
68 void operator*=(T const &m);
69
70 T &operator()(int y, int x);
71

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected