toon-members
[Top][All Lists]
Advanced

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

[Toon-members] TooN helpers.h internal/operators.hh internal/v...


From: Tom Drummond
Subject: [Toon-members] TooN helpers.h internal/operators.hh internal/v...
Date: Mon, 30 Mar 2009 22:52:12 +0000

CVSROOT:        /cvsroot/toon
Module name:    TooN
Changes by:     Tom Drummond <twd20>    09/03/30 22:52:12

Modified files:
        .              : helpers.h 
        internal       : operators.hh vector.hh 

Log message:
        Removed NoAliasOperator

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/helpers.h?cvsroot=toon&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/operators.hh?cvsroot=toon&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/vector.hh?cvsroot=toon&r1=1.32&r2=1.33

Patches:
Index: helpers.h
===================================================================
RCS file: /cvsroot/toon/TooN/helpers.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- helpers.h   30 Mar 2009 21:22:36 -0000      1.35
+++ helpers.h   30 Mar 2009 22:52:11 -0000      1.36
@@ -105,7 +105,7 @@
  };
 
 
-static NoAliasOperator<Internal::Zero> Zero;
+static Operator<Internal::Zero> Zero;
 static Operator<Internal::Identity> Identity;
 
 

Index: internal/operators.hh
===================================================================
RCS file: /cvsroot/toon/TooN/internal/operators.hh,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- internal/operators.hh       30 Mar 2009 21:22:38 -0000      1.25
+++ internal/operators.hh       30 Mar 2009 22:52:12 -0000      1.26
@@ -13,14 +13,6 @@
 
 template<class Op> struct Operator{};
 
-template<class Op> struct NoAliasOperator : public Operator<Op> {
-       NoAliasOperator(){}
-       explicit NoAliasOperator(const Operator<Op>& op) : Operator<Op>(op) {}
-};
-
-template<class Op> NoAliasOperator<Op> NoAlias(const Operator<Op>& op){
-       return NoAliasOperator<Op>(op);
-}
 
 namespace Internal{
        
@@ -153,18 +145,17 @@
        template<int i> struct Sizer<-1, i>{static const int size=i;};
        template<int i> struct Sizer<i, -1>{static const int size=i;};
        template<> struct Sizer<-1, -1>    {static const int size=-1;};
-}
 
-
-template<typename Op,                           // the operation
+       template<typename Op,                           // the operation
                 int S1, typename P1, typename B1,      // lhs vector
                 int S2, typename P2, typename B2>      // rhs vector
-struct VPairwise;
+       struct VPairwise;
+}
 
 template<typename Op,                           // the operation
                 int S1, typename P1, typename B1,      // lhs vector
                 int S2, typename P2, typename B2>      // rhs vector
-struct Operator<VPairwise<Op, S1, P1, B1, S2, P2, B2> > {
+struct Operator<Internal::VPairwise<Op, S1, P1, B1, S2, P2, B2> > {
        const Vector<S1, P1, B1> & lhs;
        const Vector<S2, P2, B2> & rhs;
 
@@ -189,12 +180,13 @@
 
 // Addition Vector + Vector
 template<int S1, int S2, typename P1, typename P2, typename B1, typename B2> 
-Vector<Internal::Sizer<S1,S2>::size, typename Internal::AddType<P1, P2>::type> 
operator+(const Vector<S1, P1, B1>& v1, const Vector<S2, P2, B2>& v2)
+Vector<Internal::Sizer<S1,S2>::size, typename Internal::AddType<P1, P2>::type> 
+operator+(const Vector<S1, P1, B1>& v1, const Vector<S2, P2, B2>& v2)
 {
        typedef typename Internal::AddType<P1, P2>::type P0;
        SizeMismatch<S1, S2>:: test(v1.size(),v2.size());
        const int S0=Internal::Sizer<S1,S2>::size;
-       return 
Vector<S0,P0>(Operator<VPairwise<Internal::Add,S1,P1,B1,S2,P2,B2> >(v1,v2));
+       return 
Vector<S0,P0>(Operator<Internal::VPairwise<Internal::Add,S1,P1,B1,S2,P2,B2> 
>(v1,v2));
 }
 
 // Addition Vector - Vector
@@ -204,7 +196,7 @@
        typedef typename Internal::SubtractType<P1, P2>::type P0;
        SizeMismatch<S1, S2>:: test(v1.size(),v2.size());
        const int S0=Internal::Sizer<S1,S2>::size;
-       return 
Vector<S0,P0>(Operator<VPairwise<Internal::Subtract,S1,P1,B1,S2,P2,B2> 
>(v1,v2));
+       return 
Vector<S0,P0>(Operator<Internal::VPairwise<Internal::Subtract,S1,P1,B1,S2,P2,B2>
 >(v1,v2));
 }
 
 // Dot product Vector * Vector

Index: internal/vector.hh
===================================================================
RCS file: /cvsroot/toon/TooN/internal/vector.hh,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- internal/vector.hh  30 Mar 2009 21:22:38 -0000      1.32
+++ internal/vector.hh  30 Mar 2009 22:52:12 -0000      1.33
@@ -53,7 +53,7 @@
 
        // assignment from a 0-ary operator
        template <class Op>
-       inline Vector & operator=(const NoAliasOperator<Op>& op){
+       inline Vector & operator=(const Operator<Op>& op){
                op.eval(*this);
                return *this;
        }




reply via email to

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