From 9514ebc5981632fa61a28e3972427fb0ba4778dd Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 16 Aug 2012 14:30:12 +0800 Subject: [PATCH] optimize tm --- src/util.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util.h b/src/util.h index df3110d..92c9c5e 100644 --- a/src/util.h +++ b/src/util.h @@ -103,7 +103,8 @@ public: TM() {} TM(const double * m) {memcpy(_, m, sizeof(_));} bool operator < (const TM & m) const { - for(int i = 0; i < 6; ++i) + // Note that we only care about the first 4 elements + for(int i = 0; i < 4; ++i) { if(_[i] < m._[i] - EPS) return true; @@ -113,7 +114,7 @@ public: return false; } bool operator == (const TM & m) const { - return _tm_equal(_, m._); + return _tm_equal(_, m._, 4); } double _[6]; };