-
Notifications
You must be signed in to change notification settings - Fork 0
/
library.h
55 lines (50 loc) · 1.68 KB
/
library.h
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
#ifndef NUMCPP_LIBRARY_H
#define NUMCPP_LIBRARY_H
#include <vector>
void hello();
namespace nc {
class Matrix{
};
template <typename T>
class Matrix2D: public Matrix {
private:
std::vector<T> content;
int height{};
int width{};
bool transposed = false;
public:
/*
* Constructor which uses an already existing vector, width and height to build matrix class
*
* @param values vector holding the values for each entry of the matrix, width and height integers
*/
explicit Matrix2D(const std::vector<T> &content, const int& width, const int& height);
/*
* Basic constructor which assumes a matrix of dimension 3x3.
*/
Matrix2D();
/*
* Constructor based on the dimension of the matrix
*
* @param values height and width as integers which will be used for precise allocation of needed storage
*/
Matrix2D(const int& height, const int& width);
/*
* Traditional copy constructor which copies class and contents.
*/
Matrix2D(const Matrix2D<T>& original);
/*
* Destructor of 2d matrix class; frees all allocated memory
*/
~Matrix2D();
/*
* Copy assignment constructor of 2d matrix which does not swap, but delete previous contents of matrix class
* and copy contents of assigned matrix.
*
* @param values Matrix which contents will be set as the new contents of this matrix
* @return the matrix itself
*/
Matrix2D<T>& operator=(const Matrix2D<T>& other);
};
}
#endif //NUMCPP_LIBRARY_H