File vector/base.h changed (mode: 100755) (index 2582e96..10d5eef) |
... |
... |
namespace math |
83 |
83 |
|
|
84 |
84 |
//constexpr inline matrix<size, size, type> operator * (const matrix<size, size, type>&) const; |
//constexpr inline matrix<size, size, type> operator * (const matrix<size, size, type>&) const; |
85 |
85 |
|
|
86 |
|
constexpr inline bool all_less_equal(const vector &other) const; |
|
|
86 |
|
constexpr inline bool all_less_equal (const vector &other) const; |
|
87 |
|
constexpr inline bool all_greater_equal(const vector &other) const; |
|
88 |
|
constexpr inline bool all_equal (const vector &other) const; |
|
89 |
|
constexpr inline bool all_greater (const vector &other) const; |
|
90 |
|
constexpr inline bool all_less (const vector &other) const; |
87 |
91 |
|
|
88 |
92 |
constexpr inline bool all_equal (const type &value) const; |
constexpr inline bool all_equal (const type &value) const; |
89 |
93 |
constexpr inline bool all_greater (const type &value) const; |
constexpr inline bool all_greater (const type &value) const; |
File vector/base.hpp changed (mode: 100755) (index cc2ea2d..786dac1) |
... |
... |
namespace math |
165 |
165 |
} |
} |
166 |
166 |
*/ |
*/ |
167 |
167 |
|
|
168 |
|
T_IMPL bool VECTOR::all_less_equal(const vector &other) const |
|
|
168 |
|
template<typename FOO_2values_cmp, unsigned int size, typename type> |
|
169 |
|
inline bool compare_vectors (FOO_2values_cmp cmp, const VECTOR &l, const VECTOR &r) |
169 |
170 |
{ |
{ |
170 |
171 |
for (unsigned int i = 0; i < size; ++i) |
for (unsigned int i = 0; i < size; ++i) |
171 |
|
if ((*this)[i] > other[i]) |
|
|
172 |
|
if (not cmp(l[i], r[i])) |
172 |
173 |
return false; |
return false; |
173 |
174 |
return true; |
return true; |
174 |
175 |
} |
} |
175 |
176 |
|
|
|
177 |
|
T_IMPL bool VECTOR::all_less_equal(const vector &other) const |
|
178 |
|
{ |
|
179 |
|
return compare_vectors([](const type &l, const type &r) { return l <= r; }, *this, other); |
|
180 |
|
} |
|
181 |
|
|
|
182 |
|
T_IMPL bool VECTOR::all_greater_equal(const vector &other) const |
|
183 |
|
{ |
|
184 |
|
return compare_vectors([](const type &l, const type &r) { return l >= r; }, *this, other); |
|
185 |
|
} |
|
186 |
|
T_IMPL bool VECTOR::all_equal(const vector &other) const |
|
187 |
|
{ |
|
188 |
|
return compare_vectors([](const type &l, const type &r) { return l == r; }, *this, other); |
|
189 |
|
} |
|
190 |
|
T_IMPL bool VECTOR::all_greater(const vector &other) const |
|
191 |
|
{ |
|
192 |
|
return compare_vectors([](const type &l, const type &r) { return l > r; }, *this, other); |
|
193 |
|
} |
|
194 |
|
T_IMPL bool VECTOR::all_less(const vector &other) const |
|
195 |
|
{ |
|
196 |
|
return compare_vectors([](const type &l, const type &r) { return l < r; }, *this, other); |
|
197 |
|
} |
|
198 |
|
|
176 |
199 |
T_IMPL bool VECTOR::all_equal(const type &value) const |
T_IMPL bool VECTOR::all_equal(const type &value) const |
177 |
200 |
{ |
{ |
178 |
201 |
for (unsigned int i = 0; i < size; ++i) |
for (unsigned int i = 0; i < size; ++i) |