File vector/base.h changed (mode: 100755) (index 10d5eef..8d05c8e) |
... |
... |
namespace math |
89 |
89 |
constexpr inline bool all_greater (const vector &other) const; |
constexpr inline bool all_greater (const vector &other) const; |
90 |
90 |
constexpr inline bool all_less (const vector &other) const; |
constexpr inline bool all_less (const vector &other) const; |
91 |
91 |
|
|
92 |
|
constexpr inline bool all_equal (const type &value) const; |
|
93 |
|
constexpr inline bool all_greater (const type &value) const; |
|
94 |
|
constexpr inline bool all_less_equal(const type &value) const; |
|
|
92 |
|
constexpr inline bool all_less_equal (const type &value) const; |
|
93 |
|
constexpr inline bool all_greater_equal(const type &value) const; |
|
94 |
|
constexpr inline bool all_equal (const type &value) const; |
|
95 |
|
constexpr inline bool all_greater (const type &value) const; |
|
96 |
|
constexpr inline bool all_less (const type &value) const; |
95 |
97 |
|
|
96 |
98 |
constexpr inline type all_scale() const; |
constexpr inline type all_scale() const; |
97 |
99 |
constexpr inline type all_summ() const; |
constexpr inline type all_summ() const; |
File vector/base.hpp changed (mode: 100755) (index 786dac1..ee156ac) |
... |
... |
namespace math |
174 |
174 |
return true; |
return true; |
175 |
175 |
} |
} |
176 |
176 |
|
|
|
177 |
|
template<typename FOO_2values_cmp, unsigned int size, typename type> |
|
178 |
|
inline bool compare_vector (FOO_2values_cmp cmp, const VECTOR &l, const type &r) |
|
179 |
|
{ |
|
180 |
|
for (unsigned int i = 0; i < size; ++i) |
|
181 |
|
if (not cmp(l[i], r)) |
|
182 |
|
return false; |
|
183 |
|
return true; |
|
184 |
|
} |
|
185 |
|
|
177 |
186 |
T_IMPL bool VECTOR::all_less_equal(const vector &other) const |
T_IMPL bool VECTOR::all_less_equal(const vector &other) const |
178 |
187 |
{ |
{ |
179 |
188 |
return compare_vectors([](const type &l, const type &r) { return l <= r; }, *this, other); |
return compare_vectors([](const type &l, const type &r) { return l <= r; }, *this, other); |
|
... |
... |
namespace math |
196 |
205 |
return compare_vectors([](const type &l, const type &r) { return l < r; }, *this, other); |
return compare_vectors([](const type &l, const type &r) { return l < r; }, *this, other); |
197 |
206 |
} |
} |
198 |
207 |
|
|
199 |
|
T_IMPL bool VECTOR::all_equal(const type &value) const |
|
|
208 |
|
T_IMPL bool VECTOR::all_less_equal(const type &value) const |
200 |
209 |
{ |
{ |
201 |
|
for (unsigned int i = 0; i < size; ++i) |
|
202 |
|
if ((*this)[i] != value) |
|
203 |
|
return false; |
|
204 |
|
return true; |
|
|
210 |
|
return compare_vector([](const type &l, const type &r) { return l <= r; }, *this, value); |
205 |
211 |
} |
} |
206 |
212 |
|
|
207 |
|
|
|
|
213 |
|
T_IMPL bool VECTOR::all_greater_equal(const type &value) const |
|
214 |
|
{ |
|
215 |
|
return compare_vector([](const type &l, const type &r) { return l >= r; }, *this, value); |
|
216 |
|
} |
|
217 |
|
T_IMPL bool VECTOR::all_equal(const type &value) const |
|
218 |
|
{ |
|
219 |
|
return compare_vector([](const type &l, const type &r) { return l == r; }, *this, value); |
|
220 |
|
} |
208 |
221 |
T_IMPL bool VECTOR::all_greater(const type &value) const |
T_IMPL bool VECTOR::all_greater(const type &value) const |
209 |
222 |
{ |
{ |
210 |
|
for (unsigned int i = 0; i < size; ++i) |
|
211 |
|
if ((*this)[i] <= value) |
|
212 |
|
return false; |
|
213 |
|
return true; |
|
|
223 |
|
return compare_vector([](const type &l, const type &r) { return l > r; }, *this, value); |
214 |
224 |
} |
} |
215 |
|
|
|
216 |
|
T_IMPL bool VECTOR::all_less_equal(const type &value) const |
|
|
225 |
|
T_IMPL bool VECTOR::all_less(const type &value) const |
217 |
226 |
{ |
{ |
218 |
|
for (unsigned int i = 0; i < size; ++i) |
|
219 |
|
if ((*this)[i] > value) |
|
220 |
|
return false; |
|
221 |
|
return true; |
|
|
227 |
|
return compare_vector([](const type &l, const type &r) { return l < r; }, *this, value); |
222 |
228 |
} |
} |
223 |
229 |
|
|
224 |
230 |
|
|
|
231 |
|
|
225 |
232 |
T_IMPL type VECTOR::all_scale() const |
T_IMPL type VECTOR::all_scale() const |
226 |
233 |
{ |
{ |
227 |
234 |
type r = (*this)[0]; |
type r = (*this)[0]; |