-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsquarematrix.cpp
More file actions
34 lines (26 loc) · 926 Bytes
/
squarematrix.cpp
File metadata and controls
34 lines (26 loc) · 926 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
#include "squarematrix.h"
#include "elementarymatrix.h"
#include <iostream>
///////////////////////////////////////////////////
/////////////////// Yhteiset //////////////////////
///////////////////////////////////////////////////
//! Tulostusoperaattori
std::ostream& operator<<(std::ostream& out, const SquareMatrix& sm){
return out << sm.toString();
}
//! Laskuoperaattorit joita voidaan käyttää CompositeSquareMatrix luokkaa muodostaessa
ConcreteSquareMatrix operator+(const ConcreteSquareMatrix& c1, const ConcreteSquareMatrix& c2){
ConcreteSquareMatrix temp(c1);
temp += c2;
return temp;
}
ConcreteSquareMatrix operator-(const ConcreteSquareMatrix& c1, const ConcreteSquareMatrix& c2){
ConcreteSquareMatrix temp(c1);
temp -= c2;
return temp;
}
ConcreteSquareMatrix operator*(const ConcreteSquareMatrix& c1, const ConcreteSquareMatrix& c2){
ConcreteSquareMatrix temp(c1);
temp *= c2;
return temp;
}