9
9
* License, v. 2.0. If a copy of the MPL was not distributed with this
10
10
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
11
*/
12
- // ----------------------------------------------------------------------------
13
-
14
12
#pragma once
15
13
#include " vector1.hpp"
16
14
30
28
modm::Vector<T, 1 >::set(const T& value)
31
29
{ this ->x = value; }
32
30
33
- // ----------------------------------------------------------------------------
34
31
template <typename T>
35
32
void
36
33
modm::Vector<T, 1 >::setX(const T& value)
37
34
{ this ->x = value; }
38
35
39
- // ----------------------------------------------------------------------------
40
36
template <typename T>
41
37
const T&
42
38
modm::Vector<T, 1 >::getX() const
43
- {
44
- return this ->x ;
45
- }
39
+ { return this ->x ; }
46
40
47
41
// ----------------------------------------------------------------------------
48
42
template <typename T>
@@ -61,39 +55,34 @@ modm::Vector<T, 1>::operator == (const modm::Vector<T, 1> &rhs) const
61
55
return (rhs.x == x);
62
56
}
63
57
64
- // ----------------------------------------------------------------------------
65
58
template <typename T>
66
59
bool
67
60
modm::Vector<T, 1 >::operator != (const modm::Vector<T, 1 > &rhs) const
68
61
{
69
62
return (rhs.x != x);
70
63
}
71
64
72
- // ----------------------------------------------------------------------------
73
65
template <typename T>
74
66
bool
75
67
modm::Vector<T, 1 >::operator < (const modm::Vector<T, 1 > &rhs) const
76
68
{
77
69
return (x < rhs.x );
78
70
}
79
71
80
- // ----------------------------------------------------------------------------
81
72
template <typename T>
82
73
bool
83
74
modm::Vector<T, 1 >::operator <= (const modm::Vector<T, 1 > &rhs) const
84
75
{
85
76
return (x <= rhs.x );
86
77
}
87
78
88
- // ----------------------------------------------------------------------------
89
79
template <typename T>
90
80
bool
91
81
modm::Vector<T, 1 >::operator > (const modm::Vector<T, 1 > &rhs) const
92
82
{
93
83
return (x > rhs.x );
94
84
}
95
85
96
- // ----------------------------------------------------------------------------
97
86
template <typename T>
98
87
bool
99
88
modm::Vector<T, 1 >::operator >= (const modm::Vector<T, 1 > &rhs) const
@@ -139,31 +128,27 @@ modm::Vector<T, 1>::operator + (const modm::Vector<T, 1> &rhs) const
139
128
return modm::Vector<T, 1 >(x+rhs.x );
140
129
}
141
130
142
- // ----------------------------------------------------------------------------
143
131
template <typename T>
144
132
modm::Vector<T, 1 >
145
133
modm::Vector<T, 1 >::operator - (const modm::Vector<T, 1 > &rhs) const
146
134
{
147
135
return modm::Vector<T, 1 >(x-rhs.x );
148
136
}
149
137
150
- // ----------------------------------------------------------------------------
151
138
template <typename T>
152
139
T
153
140
modm::Vector<T, 1 >::operator * (const modm::Vector<T, 1 > &rhs) const
154
141
{
155
142
return x*rhs.x ;
156
143
}
157
144
158
- // ----------------------------------------------------------------------------
159
145
template <typename T>
160
146
modm::Vector<T, 1 >
161
147
modm::Vector<T, 1 >::operator * (const T &rhs) const
162
148
{
163
149
return modm::Vector<T, 1 >(x*rhs);
164
150
}
165
151
166
- // ----------------------------------------------------------------------------
167
152
template <typename T>
168
153
modm::Vector<T, 1 >
169
154
modm::Vector<T, 1 >::operator / (const T &rhs) const
@@ -180,7 +165,6 @@ modm::Vector<T, 1>::operator += (const modm::Vector<T, 1> &rhs)
180
165
return *this ;
181
166
}
182
167
183
- // ----------------------------------------------------------------------------
184
168
template <typename T>
185
169
modm::Vector<T, 1 >&
186
170
modm::Vector<T, 1 >::operator -= (const modm::Vector<T, 1 > &rhs)
@@ -189,7 +173,6 @@ modm::Vector<T, 1>::operator -= (const modm::Vector<T, 1> &rhs)
189
173
return *this ;
190
174
}
191
175
192
- // ----------------------------------------------------------------------------
193
176
template <typename T>
194
177
modm::Vector<T, 1 >&
195
178
modm::Vector<T, 1 >::operator *= (const T &rhs)
@@ -198,7 +181,6 @@ modm::Vector<T, 1>::operator *= (const T &rhs)
198
181
return *this ;
199
182
}
200
183
201
- // ----------------------------------------------------------------------------
202
184
template <typename T>
203
185
modm::Vector<T, 1 >&
204
186
modm::Vector<T, 1 >::operator /= (const T &rhs)
@@ -223,7 +205,6 @@ modm::Vector<T, 1>::getLength() const
223
205
return std::abs (x);
224
206
}
225
207
226
- // ----------------------------------------------------------------------------
227
208
template <typename T>
228
209
T
229
210
modm::Vector<T, 1 >::getLengthSquared() const
@@ -239,7 +220,6 @@ modm::Vector<T, 1>::asMatrix()
239
220
return *(modm::Matrix<T, 1 , 1 >*) this ;
240
221
}
241
222
242
- // ----------------------------------------------------------------------------
243
223
template <typename T>
244
224
const modm::Matrix<T, 1 , 1 >&
245
225
modm::Vector<T, 1 >::asMatrix() const
@@ -255,7 +235,6 @@ modm::Vector<T, 1>::hasNan() const
255
235
return std::isnan (x);
256
236
}
257
237
258
- // ----------------------------------------------------------------------------
259
238
template <typename T>
260
239
bool
261
240
modm::Vector<T, 1 >::hasInf() const
0 commit comments