00001 //============================================================================= 00002 /*! zgematrix constructor without arguments */ 00003 inline zgematrix::zgematrix() 00004 {VERBOSE_REPORT; 00005 //////// initialize //////// 00006 m =0; 00007 n =0; 00008 array =NULL; 00009 darray =NULL; 00010 } 00011 00012 /////////////////////////////////////////////////////////////////////////////// 00013 /////////////////////////////////////////////////////////////////////////////// 00014 /////////////////////////////////////////////////////////////////////////////// 00015 00016 //============================================================================= 00017 /*! zgematrix copy constructor */ 00018 inline zgematrix::zgematrix(const zgematrix& mat) 00019 {VERBOSE_REPORT; 00020 //////// initialize //////// 00021 m =mat.m; 00022 n =mat.n; 00023 array =new comple[m*n]; 00024 darray =new comple*[n]; 00025 for(int i=0; i<n; i++){ darray[i] =&array[i*m]; } 00026 00027 //////// copy //////// 00028 zcopy_(m*n, mat.array, 1, array, 1); 00029 } 00030 00031 //============================================================================= 00032 /*! zgematrix constructor to cast _zgematrix */ 00033 inline zgematrix::zgematrix(const _zgematrix& mat) 00034 {VERBOSE_REPORT; 00035 m =mat.m; 00036 n =mat.n; 00037 array =mat.array; 00038 darray =mat.darray; 00039 00040 mat.nullify(); 00041 } 00042 00043 /////////////////////////////////////////////////////////////////////////////// 00044 /////////////////////////////////////////////////////////////////////////////// 00045 /////////////////////////////////////////////////////////////////////////////// 00046 00047 //============================================================================= 00048 /*! zgematrix constructor with size specification */ 00049 inline zgematrix::zgematrix(const long& _m, const long& _n) 00050 {VERBOSE_REPORT; 00051 #ifdef CPPL_DEBUG 00052 if( _m<0 || _n<0 ){ 00053 ERROR_REPORT; 00054 std::cerr << "Matrix sizes must be positive integers. " << std::endl 00055 << "Your input was (" << _m << "," << _n << ")." << std::endl; 00056 exit(1); 00057 } 00058 #endif//CPPL_DEBUG 00059 00060 //////// initialize //////// 00061 m =_m; 00062 n =_n; 00063 array =new comple[m*n]; 00064 darray =new comple*[n]; 00065 for(int i=0; i<n; i++){ darray[i] =&array[i*m]; } 00066 } 00067 00068 //============================================================================= 00069 /*! zgematrix constructor with filename */ 00070 inline zgematrix::zgematrix(const char* filename) 00071 {VERBOSE_REPORT; 00072 array =NULL; 00073 darray =NULL; 00074 00075 //// read //// 00076 read(filename); 00077 } 00078 00079 /////////////////////////////////////////////////////////////////////////////// 00080 /////////////////////////////////////////////////////////////////////////////// 00081 /////////////////////////////////////////////////////////////////////////////// 00082 00083 //============================================================================= 00084 /*! zgematrix destructor */ 00085 inline zgematrix::~zgematrix() 00086 {VERBOSE_REPORT; 00087 //////// delete array //////// 00088 delete [] array; 00089 delete [] darray; 00090 }