271 |
} |
} |
272 |
|
|
273 |
/** |
/** |
274 |
|
* Compares two vectors |
275 |
|
* |
276 |
|
* @param V the vector to compare with |
277 |
|
* |
278 |
|
* @return true is the vector is smaller than the given one |
279 |
|
* |
280 |
|
* @note this function uses an arbitrary order |
281 |
|
*/ |
282 |
|
inline bool operator < (const TinyVector<N,T>& V) const |
283 |
|
{ |
284 |
|
for (size_t i=0; i<N; ++i) { |
285 |
|
if(__x[i] != V.__x[i]) { |
286 |
|
return (__x[i] < V.__x[i]); |
287 |
|
} |
288 |
|
} |
289 |
|
return false; |
290 |
|
} |
291 |
|
|
292 |
|
/** |
293 |
* Compares 2 vectors. true if they are not \b exactly the same |
* Compares 2 vectors. true if they are not \b exactly the same |
294 |
* |
* |
295 |
* @param V the vector to compare with |
* @param V the vector to compare with |
296 |
* |
* |
297 |
* @return true if vector do not match |
* @return true if vector do not match |
298 |
*/ |
*/ |
299 |
inline const bool operator!=(const TinyVector<N, T>& V) const |
inline bool operator!=(const TinyVector<N, T>& V) const |
300 |
{ |
{ |
301 |
for (size_t i=0; i<N; i++) { |
for (size_t i=0; i<N; i++) { |
302 |
if (__x[i] != V.__x[i]) { |
if (__x[i] != V.__x[i]) { |
665 |
} |
} |
666 |
|
|
667 |
/** |
/** |
668 |
|
* Compares two vectors |
669 |
|
* |
670 |
|
* @param V the vector to compare with |
671 |
|
* |
672 |
|
* @return true is the vector is smaller than the given one |
673 |
|
* |
674 |
|
* @note this function uses an arbitrary order |
675 |
|
*/ |
676 |
|
inline bool operator < (const TinyVector<3,T>& V) const |
677 |
|
{ |
678 |
|
for (size_t i=0; i<3; ++i) { |
679 |
|
if(__x[i] != V.__x[i]) { |
680 |
|
return (__x[i] < V.__x[i]); |
681 |
|
} |
682 |
|
} |
683 |
|
return false; |
684 |
|
} |
685 |
|
|
686 |
|
/** |
687 |
* Compares 2 vectors. true if they are not \b exactly the same |
* Compares 2 vectors. true if they are not \b exactly the same |
688 |
* |
* |
689 |
* @param V the vector to compare with |
* @param V the vector to compare with |