toon-members
[Top][All Lists]
Advanced

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

[Toon-members] TooN/internal vector.hh


From: Edward Rosten
Subject: [Toon-members] TooN/internal vector.hh
Date: Fri, 06 Mar 2009 12:25:24 +0000

CVSROOT:        /cvsroot/toon
Module name:    TooN
Changes by:     Edward Rosten <edrosten>        09/03/06 12:25:24

Modified files:
        internal       : vector.hh 

Log message:
        More fixes for VBase: test3.cc works.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/vector.hh?cvsroot=toon&r1=1.18&r2=1.19

Patches:
Index: vector.hh
===================================================================
RCS file: /cvsroot/toon/TooN/internal/vector.hh,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- vector.hh   6 Mar 2009 12:19:53 -0000       1.18
+++ vector.hh   6 Mar 2009 12:25:24 -0000       1.19
@@ -11,18 +11,19 @@
        inline Vector(Precision* data_in, int size_in, int stride_in, Slicing) 
: Base::template Layout<Size, Precision>(data_in, size_in, stride_in) {}
        inline Vector(Precision* data_in, int stride_in, Slicing) : 
Base::template Layout<Size, Precision>(data_in, stride_in) {}
 
+       using Base::template Layout<Size, Precision>::size;
 
        // constructors to allow return value optimisations
        // construction from 1-ary operator
        template <class T, class Op>
-       inline Vector(const T& arg, const Operator<Op>&, int size) : 
Base::Layout(size) {
+       inline Vector(const T& arg, const Operator<Op>&, int size) : 
Base::template Layout<Size, Precision>(size) {
                Op::eval(*this,arg);
        }
 
        // constructor from 2-ary operator
        template <class LHS, class RHS, class Op>
        inline Vector(const LHS& lhs, const RHS& rhs, const Operator<Op>&, int 
size)
-               : Base::Layout(size) {
+               : Base::template Layout<Size, Precision>(size) {
                Op::eval(*this,lhs,rhs);
        }
 
@@ -38,14 +39,14 @@
        // constructor from arbitrary vector
        template<int Size2, typename Precision2, typename Base2>
        inline Vector(const Vector<Size2,Precision2,Base2>& from):
-               Base::Layout(from.size()) {
+               Base::template Layout<Size, Precision>(from.size()) {
                operator=(from);
        }
 
        // operator = from copy
        inline Vector& operator= (const Vector& from){
-               SizeMismatch<Size,Size>::test(Base::size(), from.size());
-               const int s=Base::size();
+               SizeMismatch<Size,Size>::test(size(), from.size());
+               const int s=size();
                for(int i=0; i<s; i++){
                        (*this)[i]=from[i];
                }
@@ -55,8 +56,8 @@
        // operator =
        template<int Size2, typename Precision2, typename Base2>
        Vector<Size,Precision,Base >& operator= (const Vector<Size2, 
Precision2, Base2>& from){
-               SizeMismatch<Size,Size2>::test(Base::size(), from.size());
-               const int s=Base::size();
+               SizeMismatch<Size,Size2>::test(size(), from.size());
+               const int s=size();
                for(int i=0; i<s; i++){
                        (*this)[i]=from[i];
                }
@@ -92,16 +93,16 @@
        
        template<int Size2, class Precision2, class Base2>
        Vector& operator+=(const Vector<Size2, Precision2, Base2>& rhs) {
-               SizeMismatch<Size,Size2>::test(Base::size(),rhs.size());
-               for(int i=0; i<Base::size(); i++)
+               SizeMismatch<Size,Size2>::test(size(),rhs.size());
+               for(int i=0; i<size(); i++)
                        (*this)[i]+=rhs;
                return *this;
        }
 
        template<int Size2, class Precision2, class Base2>
        Vector& operator-=(const Vector<Size2, Precision2, Base2>& rhs) {
-               SizeMismatch<Size,Size2>::test(Base::size(),rhs.size());
-               for(int i=0; i<Base::size(); i++)
+               SizeMismatch<Size,Size2>::test(size(),rhs.size());
+               for(int i=0; i<size(); i++)
                        (*this)[i]-=rhs;
                return *this;
        }




reply via email to

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