-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dense_Matrix.h
46 lines (38 loc) · 1.51 KB
/
Dense_Matrix.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
#ifndef __DENSE_MATRIX_H
#define __DENSE_MATRIX_H
#include "Base_Matrix.h"
namespace Matrix {
template <typename T>
class DenseMatrix : public BaseMatrix<T>
{
public:
DenseMatrix();
DenseMatrix(std::vector<std::vector<T>> init);
DenseMatrix(std::initializer_list<std::initializer_list<T>> init);
template <typename F>
DenseMatrix(const ProductExpr<F> &rhs); // copy constructor
DenseMatrix(const ProductExpr<T> &rhs); // copy constructor
template <typename F>
DenseMatrix(const DenseMatrix<F> &rhs); // copy constructor
DenseMatrix(const DenseMatrix<T> &rhs); // copy constructor
template <typename F>
DenseMatrix(const BaseMatrix<F> &rhs); // copy constructor
DenseMatrix(const BaseMatrix<T> &rhs); // copy constructor
DenseMatrix(DenseMatrix<T> &&rhs) noexcept = default; // move constructor
virtual ~DenseMatrix() = default;
// Assignment operator overloading
DenseMatrix<T>& operator=(const ProductExpr<T> &rhs);
DenseMatrix<T>& operator=(const BaseMatrix<T> &rhs);
DenseMatrix<T>& operator=(const DenseMatrix<T> &rhs);
DenseMatrix<T>& operator=(DenseMatrix<T> &&rhs) = default;
DenseMatrix<T>& Transpose();
std::shared_ptr<std::vector<std::vector<T>>> GetMatrix() const;
private:
inline void UnityMatrix(unsigned, unsigned, const T &);
inline void CopyFromMat(const std::vector<std::vector<T>>&);
private:
std::vector<std::vector<T>> m_mat;
};
} // Matrix
#include "Dense_Matrix.cpp"
#endif