Go to the documentation of this file.00001
00002
00003 inline _zgbmatrix t(const zgbmatrix& mat)
00004 {VERBOSE_REPORT;
00005 zgbmatrix newmat(mat.n, mat.m, mat.ku, mat.kl);
00006 for(long i=0; i<newmat.m; i++){
00007 for(long j=std::max(long(0),i-newmat.kl); j<std::min(newmat.n,i+newmat.ku+1); j++){
00008 newmat(i,j) =mat(j,i);
00009 }
00010 }
00011
00012 return _(newmat);
00013 }
00014
00015
00016
00017 inline _zgematrix i(const zgbmatrix& mat)
00018 {VERBOSE_REPORT;
00019 #ifdef CPPL_DEBUG
00020 if(mat.m!=mat.n){
00021 ERROR_REPORT;
00022 std::cerr << "This matrix is not square and has no inverse matrix." << std::endl
00023 << "Your input was (" << mat.m << "x" << mat.n << ")." << std::endl;
00024 exit(1);
00025 }
00026 #endif//CPPL_DEBUG
00027
00028 zgbmatrix mat_cp(mat);
00029 zgematrix mat_inv(mat.m,mat.n);
00030 mat_inv.identity();
00031 mat_cp.zgbsv(mat_inv);
00032
00033 return _(mat_inv);
00034 }
00035
00036
00037
00038
00039
00040
00041
00042 inline _zgbmatrix conj(const zgbmatrix& mat)
00043 {VERBOSE_REPORT;
00044 zgbmatrix newmat(mat.m, mat.n, mat.kl, mat.ku);
00045 for(long i=0; i<mat.m; i++){
00046 for(long j=std::max(long(0),i-mat.kl); j<std::min(mat.n,i+mat.ku+1); j++){
00047 newmat(i,j) =std::conj(mat(i,j));
00048 }
00049 }
00050 return _(newmat);
00051 }
00052
00053
00054
00055 inline _zgbmatrix conjt(const zgbmatrix& mat)
00056 {VERBOSE_REPORT;
00057 zgbmatrix newmat(mat.n, mat.m, mat.ku, mat.kl);
00058 for(long i=0; i<newmat.m; i++){
00059 for(long j=std::max(long(0),i-newmat.kl); j<std::min(newmat.n,i+newmat.ku+1); j++){
00060 newmat(i,j) =std::conj(mat(j,i));
00061 }
00062 }
00063 return _(newmat);
00064 }