toon-members
[Top][All Lists]
Advanced

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

[Toon-members] TooN TODO TooN.h internal/allocator.hh membase....


From: Edward Rosten
Subject: [Toon-members] TooN TODO TooN.h internal/allocator.hh membase....
Date: Mon, 09 Feb 2009 14:26:38 +0000

CVSROOT:        /cvsroot/toon
Module name:    TooN
Changes by:     Edward Rosten <edrosten>        09/02/09 14:26:37

Modified files:
        .              : TODO TooN.h 
        internal       : allocator.hh 
Removed files:
        .              : membase.hh 
        internal       : membase.hh 

Log message:
        Cleaned up dead code.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/TODO?cvsroot=toon&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/TooN/TooN.h?cvsroot=toon&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/TooN/membase.hh?cvsroot=toon&r1=1.6&r2=0
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/allocator.hh?cvsroot=toon&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/membase.hh?cvsroot=toon&r1=1.2&r2=0

Patches:
Index: TODO
===================================================================
RCS file: /cvsroot/toon/TooN/TODO,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- TODO        8 Feb 2009 19:18:57 -0000       1.3
+++ TODO        9 Feb 2009 14:26:37 -0000       1.4
@@ -2,4 +2,8 @@
 const slices of matrices
 const vector indexing of matrices
 bounds checking for matrices
+slice checking for matrices
+bounds checking for vectors
+slice checking for vectors
 .as_row() and .as_col() for vectors
+matrix operators

Index: TooN.h
===================================================================
RCS file: /cvsroot/toon/TooN/TooN.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- TooN.h      7 Feb 2009 15:36:46 -0000       1.19
+++ TooN.h      9 Feb 2009 14:26:37 -0000       1.20
@@ -23,9 +23,11 @@
        #endif
        
        #include <TooN/internal/allocator.hh>
+
        #include <TooN/internal/size_mismatch.hh>
        #include <TooN/internal/slice_error.hh>
        #include <TooN/internal/debug.hh>
+
        #include <TooN/internal/vbase.hh>
        #include <TooN/internal/vector.hh>
 

Index: internal/allocator.hh
===================================================================
RCS file: /cvsroot/toon/TooN/internal/allocator.hh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- internal/allocator.hh       8 Feb 2009 19:18:57 -0000       1.7
+++ internal/allocator.hh       9 Feb 2009 14:26:37 -0000       1.8
@@ -31,26 +31,6 @@
 };
 
 
-template<class Precision> class DynamicSizedAllocator
-{
-       public:
-               DynamicSizedAllocator(int size)
-               :my_data(new Precision[size]){}
-
-
-               ~DynamicSizedAllocator()
-               {
-                       delete[] my_data;
-               }
-
-               Precision *my_data;
-
-       private:
-               DynamicSizedAllocator(const DynamicSizedAllocator& d);
-};
-
-
-
 template<int Size, class Precision> class StaticSizedAllocator: public 
StackOrHeap<Size, Precision, (sizeof(Precision)*Size>max_bytes_on_stack) >
 {
 };

Index: membase.hh
===================================================================
RCS file: membase.hh
diff -N membase.hh
--- membase.hh  12 Dec 2007 15:59:43 -0000      1.6
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,60 +0,0 @@
-
-/*                       
-        Copyright (C) 2005 Tom Drummond
-
-     This library is free software; you can redistribute it and/or
-     modify it under the terms of the GNU Lesser General Public
-     License as published by the Free Software Foundation; either
-     version 2.1 of the License, or (at your option) any later version.
-
-     This library is distributed in the hope that it will be useful,
-     but WITHOUT ANY WARRANTY; without even the implied warranty of
-     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-     Lesser General Public License for more details.
-
-     You should have received a copy of the GNU Lesser General Public
-     License along with this library; if not, write to the Free Software
-     Foundation, Inc.
-     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-#ifndef __MEMBASE_H
-#define __MEMBASE_H
-
-
-// the class *is* the data (so a local variable places it on the stack)
-template<int Size>
-class Stack {
-protected:
-  double my_values[Size];
-#ifndef WIN32
-} __attribute__ ((aligned(16)));
-#else
-};
-#endif
-
-// the class allocates and deallocates the data on the heap
-template<int Size>
-class Heap {
-public:
-  inline Heap(){my_values = new double[Size];}
-  inline Heap(const Heap& copyof){
-    my_values = new double[Size];
-    memcpy(my_values,copyof.my_values,Size*sizeof(double));
-  }
-
-  inline Heap& operator=(const Heap& copyof){
-    memcpy(my_values,copyof.my_values,Size*sizeof(double));
-  }
-
-  inline ~Heap(){delete [] my_values;}
-protected:
-  double* my_values;
-};
-
-
-
-
-
-
-
-#endif

Index: internal/membase.hh
===================================================================
RCS file: internal/membase.hh
diff -N internal/membase.hh
--- internal/membase.hh 30 Jan 2009 14:51:23 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,80 +0,0 @@
-
-#ifndef TOON_MAX_STACK_SIZE
-static const int TOON_MAX_STACK_SIZE=10;
-#endif
-
-template <int Rows, int Cols, typename Precision, int 
Place=(Rows*Cols>TOON_MAX_STACK_SIZE?1:0)>
-struct MMemBase;
-
-// Place=0 => stack
-template <int Rows, int Cols, typename Precision>
-struct MMemBase<Rows, Cols, Precision, 0> {
-  Precision my_data[Rows*Cols];
-};
-
-
-// Place=1 => heap
-template <int Rows, int Cols, typename Precision>
-struct MMemBase <Rows, Cols, Precision, 1>{
-  MMemBase() : my_data(new Precision[Rows*Cols]) {}
-  ~MMemBase() {delete[] my_data}
-  Precision* const my_data;
-};
-
-
-// Rows=Cols=-1 => dynamic
-tempate<typename Precision>
-struct MMembase<-1,-1,Precision,0> {
-  MMemBase(unsigned int r, unsigned int c) : my_data(new Precision[r*c]), 
my_rows(r), my_cols(c){}
-  ~MMemBase() {delete[] my_data;}
-  Precision* my_data;
-  unsigned int my_rows;
-  unsigned int my_cols;
-};
-
-
-
-
-template<int Size, typename Precision, int 
Place=(Size>TOON_MAX_STACK_SIZE?1:0)>
-struct MemBase;
-
-// stack memory
-template<int Size, typename Precision>
-struct MemBase<Size, Precision, 0> {
-
-
-
-  Precision my_data[Size];
-};
-  
-// heap memory
-template<int Size, typename Precision>
-struct MemBase<Size, Precision, 1>{
-  MemBase() : my_data(new Precision[Size]){
-  }
-  ~MemBase(){
-    delete[] my_data;
-  }
-
-
-
-  Precision* const my_data;
-};
-
-
-
-// dynamic memory
-template<typename Precision>
-struct MemBase<-1,Precision,0> {
-  MemBase(const int Size) : my_data(new Precision[Size]), my_size(size){
-  }
-  ~MemBase(){
-    delete[] my_data;
-  }
-
-
-
-  Precision* const my_data;
-  int my_size;
-};
-  




reply via email to

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