00001
00003 inline _zgbmatrix t(const _zgbmatrix& mat)
00004 {
00005 #ifdef CPPL_VERBOSE
00006 std::cerr << "# [MARK] t(const _zgbmatrix&)"
00007 << std::endl;
00008 #endif//CPPL_VERBOSE
00009
00010 zgbmatrix newmat(mat.N, mat.M, mat.KU, mat.KL);
00011 for(long i=0; i<newmat.m; i++){
00012 for(long j=max(0,i-newmat.kl); j<min(newmat.n,i+newmat.ku+1); j++){
00013 newmat(i,j) =mat(j,i);
00014 }
00015 }
00016
00017 mat.destroy();
00018 return _(newmat);
00019 }
00020
00021
00023 inline _zgematrix i(const _zgbmatrix& mat)
00024 {
00025 #ifdef CPPL_VERBOSE
00026 std::cerr << "# [MARK] i(const _zgbmatrix&)"
00027 << std::endl;
00028 #endif//CPPL_VERBOSE
00029
00030 #ifdef CPPL_DEBUG
00031 if(mat.M!=mat.N){
00032 std::cerr << "[ERROR] i(_zgbmatrix&) " << std::endl
00033 << "This matrix is not square and has no inverse matrix."
00034 << std::endl
00035 << "Your input was (" << mat.M << "x" << mat.N << ")."
00036 << std::endl;
00037 exit(1);
00038 }
00039 #endif//CPPL_DEBUG
00040
00041 zgbmatrix mat_cp;
00042 mat_cp.shallow_copy(mat);
00043
00044 zgematrix mat_inv(mat.M,mat.N);
00045 mat_inv.identity();
00046
00047 mat_cp.zgbsv(mat_inv);
00048
00049 return _(mat_inv);
00050 }
00051
00055
00056
00058 inline _zgbmatrix conj(const _zgbmatrix& mat)
00059 {
00060 #ifdef CPPL_VERBOSE
00061 std::cerr << "# [MARK] conj(const _zgbmatrix&)"
00062 << std::endl;
00063 #endif//CPPL_VERBOSE
00064
00065 for(long i=0; i<mat.M; i++){
00066 for(long j=max(0,i-mat.KL); j<min(mat.N,i+mat.KU+1); j++){
00067 mat(i,j) =std::conj(mat(i,j));
00068 }
00069 }
00070
00071 return mat;
00072 }
00073
00074
00076 inline _zgbmatrix conjt(const _zgbmatrix& mat)
00077 {
00078 #ifdef CPPL_VERBOSE
00079 std::cerr << "# [MARK] conjt(const _zgbmatrix&)"
00080 << std::endl;
00081 #endif//CPPL_VERBOSE
00082
00083 zgbmatrix newmat(mat.N, mat.M, mat.KU, mat.KL);
00084 for(long i=0; i<newmat.m; i++){
00085 for(long j=max(0,i-newmat.kl); j<min(newmat.n,i+newmat.ku+1); j++){
00086 newmat(i,j) =std::conj(mat(j,i));
00087 }
00088 }
00089
00090 mat.destroy();
00091 return _(newmat);
00092 }