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