00001
00003 inline zssmatrix::zssmatrix()
00004 : m(M), n(N), cap(CAP), vol(VOL), array(Array), indx(Indx), jndx(Jndx)
00005 {
00006 #ifdef CPPL_VERBOSE
00007 std::cerr << "# [MARK] zssmatrix::zssmatrix()"
00008 << std::endl;
00009 #endif//CPPL_VERBOSE
00010
00012 M =N =0;
00013 CAP =VOL =0;
00014 Array =NULL;
00015 Indx =Jndx =NULL;
00016
00017 #ifdef CPPL_DEBUG
00018 std::cerr << "# [NOTE] zssmatrix::zssmatrix() "
00019 << "A new 0x0 matrix at " << Array
00020 << " has been made." << std::endl;
00021 #endif//CPPL_DEBUG
00022 }
00023
00024
00026 inline zssmatrix::zssmatrix(const zssmatrix& mat)
00027 : m(M), n(N), cap(CAP), vol(VOL), array(Array), indx(Indx), jndx(Jndx)
00028 {
00029 #ifdef CPPL_VERBOSE
00030 std::cerr << "# [MARK] zssmatrix::zssmatrix(const zssmatrix&)"
00031 << std::endl;
00032 #endif//CPPL_VERBOSE
00033
00035 M =mat.M; N =mat.N;
00036 CAP =mat.CAP;
00037 VOL =mat.VOL;
00038 Array =new std::complex<double>[CAP];
00039 Indx =new long[CAP];
00040 Jndx =new long[CAP];
00041
00043 zcopy_(VOL, mat.Array, 1, Array, 1);
00044 for(long i=0; i<VOL; i++){
00045 Indx[i] =mat.Indx[i];
00046 Jndx[i] =mat.Jndx[i];
00047 }
00048
00049 #ifdef CPPL_DEBUG
00050 std::cerr << "# [NOTE] zssmatrix::zssmatrix(const zssmatrix&) "
00051 << "A new matrix at " << Array << " has been made." << std::endl;
00052 #endif//CPPL_DEBUG
00053 }
00054
00055
00057 inline zssmatrix::zssmatrix(const _zssmatrix& mat)
00058 : m(M), n(N), cap(CAP), vol(VOL), array(Array), indx(Indx), jndx(Jndx)
00059 {
00060 #ifdef CPPL_VERBOSE
00061 std::cerr << "# [MARK] zssmatrix::zssmatrix(const _zssmatrix&)"
00062 << std::endl;
00063 #endif//CPPL_VERBOSE
00064
00065 M =mat.M; N =mat.N;
00066 CAP =mat.CAP;
00067 VOL =mat.VOL;
00068 Array =mat.Array;
00069 Indx =mat.Indx;
00070 Jndx =mat.Jndx;
00071
00072 #ifdef CPPL_DEBUG
00073 std::cerr << "# [NOTE] zssmatrix::zssmatrix(const _zssmatrix&) "
00074 << "A new matrix pointing at " << Array << " has been made."
00075 << std::endl;
00076 #endif//CPPL_DEBUG
00077 }
00078
00079
00081 inline zssmatrix::zssmatrix(const long& _m, const long& _n, const long& _c)
00082 : m(M), n(N), cap(CAP), vol(VOL), array(Array), indx(Indx), jndx(Jndx)
00083 {
00084 #ifdef CPPL_VERBOSE
00085 std::cerr << "# [MARK] zssmatrix::zssmatrix(const long&, const long&, const long&)"
00086 << std::endl;
00087 #endif//CPPL_VERBOSE
00088
00089 #ifdef CPPL_DEBUG
00090 if( _m<0 || _n<0 || _c<0 ){
00091 std::cerr << "[ERROR] zssmatrix::zssmatrix"
00092 << "(const long&, const long&, const long&)" << std::endl
00093 << "Matrix sizes and the length of arrays "
00094 << "must be positive integers. " << std::endl
00095 << "Your input was (" << _m << "," << _n << "," << _c << ")."
00096 << std::endl;
00097 exit(1);
00098 }
00099 #endif//CPPL_DEBUG
00100
00102 M =_m; N =_n;
00103 CAP =_c;
00104 VOL =0;
00105 Array =new std::complex<double>[CAP];
00106 Indx =new long[CAP];
00107 Jndx =new long[CAP];
00108
00109 #ifdef CPPL_DEBUG
00110 std::cerr << "# [NOTE] zssmatrix(const long&, const long&, const long&) "
00111 << "A new matrix at " << Array << " has been made." << std::endl;
00112 #endif//CPPL_DEBUG
00113 }
00114
00115
00117 inline zssmatrix::zssmatrix(const char* filename)
00118 : m(M), n(N), cap(CAP), vol(VOL), array(Array), indx(Indx), jndx(Jndx)
00119 {
00120 #ifdef CPPL_VERBOSE
00121 std::cerr << "# [MARK] zssmatrix::zssmatrix(const char*)"
00122 << std::endl;
00123 #endif//CPPL_VERBOSE
00124
00125 Array =NULL;
00126
00128 read(filename);
00129
00130 #ifdef CPPL_DEBUG
00131 std::cerr << "# [NOTE] zssmatrix::zssmatrix(const char*) "
00132 << "A new matrix at " << Array << " has been made." << std::endl;
00133 #endif//CPPL_DEBUG
00134 }
00135
00139
00140
00142 inline zssmatrix::~zssmatrix()
00143 {
00144 #ifdef CPPL_VERBOSE
00145 std::cerr << "# [MARK] zssmatrix::~zssmatrix()"
00146 << std::endl;
00147 #endif//CPPL_VERBOSE
00148
00149 #ifdef CPPL_DEBUG
00150 std::cerr << "# [NOTE] zssmatrix::~zssmatrix() "
00151 << "A matrix at " << Array << " is going to be deleted."
00152 << std::endl;
00153 #endif//CPPL_DEBUG
00154
00156 delete [] Array;
00157 delete [] Indx;
00158 delete [] Jndx;
00159 }