toon-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Toon-members] TooN se3.h


From: Ethan Eade
Subject: [Toon-members] TooN se3.h
Date: Fri, 09 Jun 2006 13:02:20 +0000

CVSROOT:        /cvsroot/toon
Module name:    TooN
Changes by:     Ethan Eade <ethaneade>  06/06/09 13:02:20

Modified files:
        .              : se3.h 

Log message:
        Product had dangling reference, so took out Product object for lazy se3
        multiplication evaluation.  Now se3 multiplication is always correct, 
but
        with more temporaries.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/se3.h?cvsroot=toon&r1=1.12&r2=1.13

Patches:
Index: se3.h
===================================================================
RCS file: /cvsroot/toon/TooN/se3.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- se3.h       29 May 2006 13:07:22 -0000      1.12
+++ se3.h       9 Jun 2006 13:02:19 -0000       1.13
@@ -30,17 +30,8 @@
   friend SE3 operator*(const SO3& lhs, const SE3& rhs);
   friend std::istream& operator>> (std::istream& is, SE3& rhs);
   
-  struct Product {
-      Product(const SE3& l, const SE3& r) : left(l), right(r) {}
-      const SE3& left;
-      const SE3& right;
-      Product operator *(const SE3 & rhs) const { SE3 lhs = *this; return lhs 
* rhs; }
-      Product operator *(const Product & rhs) const { SE3 lhs = *this; return 
lhs * rhs; }
-  };
-
  public:
   inline SE3();
-  inline SE3(const SE3::Product& p) { *this = p;  }
   template <class A> inline SE3(const SO3& R, const FixedVector<3,A>& T) : 
my_rotation(R), my_translation(T) {}
       
 
@@ -55,16 +46,8 @@
 
   inline SE3 inverse() const;
 
-  inline SE3& operator=(const Product& p) {
-      Matrix<3> tmp;
-      util::matrix_multiply<3,3,3>(p.left.my_rotation.my_matrix, 
p.right.my_rotation.my_matrix, tmp);
-      my_rotation.my_matrix = tmp;
-      my_translation = p.left.my_translation + 
p.left.my_rotation*p.right.my_translation;
-      return *this;
-  }
   inline SE3& operator *=(const SE3& rhs);
-  inline Product operator *(const SE3& rhs) const { return Product(*this,rhs); 
}
-  inline Product operator *(const Product & rhs) const { SE3 temp = rhs; 
return Product(*this, temp); }
+  inline SE3 operator *(const SE3& rhs) const { return 
SE3(my_rotation*rhs.my_rotation, my_translation + 
my_rotation*rhs.my_translation); }
   inline SE3& left_multiply_by(const SE3& left);
 
   static inline Vector<4> generator_field(int i, Vector<4> pos);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]