00001 00005 class VecSimplest(Type) 00006 00007 { 00008 protected: 00009 00010 Type* A; 00011 int length; 00012 bool internal; 00013 00014 00015 public: 00016 static long nbytes; 00017 static long nbytes_dealloc; 00018 static long narrays; 00019 static long narrays_dealloc; 00020 static real report_ifgt; 00021 00022 00023 protected: 00024 bool makeNew (int length); 00025 00026 00027 Type* allocate (int length); 00028 void deallocate (); 00029 Type* borrow (Type* a, int n, int base = 0); 00030 00031 public: 00032 00033 VecSimplest(Type) (); 00034 VecSimplest(Type) (int length); 00035 VecSimplest(Type) (Type* a, int n, int base = 0); 00036 virtual ~VecSimplest(Type) (); 00037 00038 bool redim (int length); 00039 bool redim (Type* a, int n, int base = 0); 00040 bool ok () const; 00041 00042 int size () const { return length; } 00043 00044 bool compatible (const VecSimplest(Type)& X) const; 00045 00046 bool indexOk (int i, const char* message = NULL) const; 00047 const Type& operator () (int i) const; 00048 Type& operator () (int i); 00049 00050 const Type* getPtr0 () const; 00051 Type* getPtr0 (); 00052 const Type* getPtr1 () const; 00053 Type* getPtr1 (); 00054 00055 00056 VecSimplest(Type) (const VecSimplest(Type)& v); 00057 void operator = (const VecSimplest(Type)& v); 00058 }; 00059 00060