-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMatrix.h
More file actions
35 lines (24 loc) · 708 Bytes
/
Matrix.h
File metadata and controls
35 lines (24 loc) · 708 Bytes
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
#ifndef MATRIX_H
#define MATRIX_H
#include <iostream>
#include <vector>
class Matrix {
public:
//Constructor
Matrix(unsigned int = 0, unsigned int = 0);
//Getters
unsigned int get_num_of_rows() const;
unsigned int get_num_of_columns() const;
//Class member functions
int get(unsigned int, unsigned int) const;
void set(unsigned int, unsigned int, int);
//Operators
Matrix operator +(const Matrix&) const; //Overloads "Matrix + Matrix"
friend std::ostream& operator << (std::ostream&, const Matrix&); //Overloads << operator
private:
//Data fields
std::vector<std::vector<int> > data;
unsigned int num_of_rows;
unsigned int num_of_columns;
};
#endif