-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMatrix.h
More file actions
74 lines (51 loc) · 1.75 KB
/
Matrix.h
File metadata and controls
74 lines (51 loc) · 1.75 KB
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
/* -----------------------------------------------------------------------------
FILE NAME: Matrix.h
DESCRIPTION: This is the specification file for the Matrix class
USAGE: This program is linkked to the driver via a .o file
COMPILER: g++ compiler c++11 standard
NOTES: both Matrix and Matrix_ops specifications are included here
MODIFICATION HISTORY:
Author Date Modification(s)
---------------- ----------- ---------------
Peter Kilonzo 2018-05-15 Version 1
Peter Kilonzo 2018-06-01 Version 2
---------------------------------------------------------------------------- */
#ifndef MATRIX_H
#define MATRIX_H
#include <fstream>
#include <iostream>
#include <iomanip>
#include <string.h>
using namespace std;
template <class T>
class Matrix {
protected:
int rows;
int cols;
T **array;
public:
Matrix(); // Overloaded Constructor
Matrix(const Matrix<T> &); // Copy Test
Matrix(int rows, int cols); // Accessor
~Matrix(); // Destructor
Matrix<T>& operator = (const Matrix<T> &);
template <class R>
friend ostream& operator << (ostream &strm, const Matrix<R> &);
template <class R>
friend istream& operator >> (istream &istrm, Matrix<R> &);
};
template <class T>
class Matrix_ops : public Matrix<T> {
using Matrix<T>::rows;
using Matrix<T>::cols;
using Matrix<T>::array;
public:
Matrix_ops<T> operator + (const Matrix_ops<T> &);
Matrix_ops<T> operator - (const Matrix_ops<T> &);
Matrix_ops<T> operator * (const Matrix_ops<T> &);
bool operator == (const Matrix_ops<T> &) const;
Matrix_ops<T> transpose();
//Matrix_ops<T> inverse();
//Matriix_ops<T> eigenvalues();
};
#endif