/[ff3d]/ff3d/algebra/TinyVector.hpp
ViewVC logotype

Diff of /ff3d/algebra/TinyVector.hpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by delpinux, Fri Aug 8 08:39:56 2003 UTC revision 1.4 by delpinux, Wed Aug 27 16:48:45 2003 UTC
# Line 271  public: Line 271  public:
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]) {
# Line 646  public: Line 665  public:
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

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26