//array2d.h //10/28/1998, Oguz Yetkin //2-D dynamic array and gaussian random number #ifndef ARRAY2D_H #define ARRAY2D_H 1 //#include "ran2.h" #include double gauss(int gaussnum=16); class array2d{ //dynamically allocated 2-d array public: double** base; int width; //number of columns int height; //number of rows array2d(int h, int w); ~array2d(); //the following are superfluous, you can just use 2darray::base directly double getvalue(int i, int j); //sets error flag if it fails int putvalue(int i, int j,double value); //returns -1 on failure void dump(); void dump(int beg, int end); //dump a subpart of array void randomize(); //fill array with random values void bzero(); //zero out everything (done often enough) int error; //0 if nothing is wrong, 1 if something is wrong //assumes 2 arrays are of same size array2d &operator=(array2d &in); }; #endif