-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboundary_conditions.cc
40 lines (34 loc) · 1.03 KB
/
boundary_conditions.cc
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
#include "boundary_conditions.hh"
boundary_conditions & boundary_conditions::operator+= (boundary_conditions const & second) {
x1 += second.x1;
x2 += second.x2;
p1 += second.p1;
p2 += second.p2;
return *this;
}
boundary_conditions boundary_conditions::operator+ (boundary_conditions const & second) const {
boundary_conditions answer = *this;
answer += second;
return answer;
}
boundary_conditions & boundary_conditions::operator*= (double const multiplicator) {
x1 *= multiplicator;
x2 *= multiplicator;
p1 *= multiplicator;
p2 *= multiplicator;
return *this;
}
boundary_conditions boundary_conditions::operator* (double const multiplicator) const {
boundary_conditions answer = *this;
answer *= multiplicator;
return answer;
}
boundary_conditions & boundary_conditions::operator/= (double const divisor) {
*this *= (1. / divisor);
return *this;
}
boundary_conditions boundary_conditions::operator/ (double const divisor) const {
boundary_conditions answer = *this;
answer *= (1. / divisor);
return answer;
}