00001
00003 inline _dgbmatrix t(const dgbmatrix& mat)
00004 {
00005 #ifdef CPPL_VERBOSE
00006 std::cerr << "# [MARK] t(const dgbmatrix&)"
00007 << std::endl;
00008 #endif//CPPL_VERBOSE
00009
00010 dgbmatrix 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 return _(newmat);
00018 }
00019
00020
00022 inline _dgematrix i(const dgbmatrix& mat)
00023 {
00024 #ifdef CPPL_VERBOSE
00025 std::cerr << "# [MARK] i(const dgbmatrix&)"
00026 << std::endl;
00027 #endif//CPPL_VERBOSE
00028
00029 #ifdef CPPL_DEBUG
00030 if(mat.M!=mat.N){
00031 std::cerr << "[ERROR] i(dgbmatrix&) " << std::endl
00032 << "This matrix is not square and has no inverse matrix."
00033 << std::endl
00034 << "Your input was (" << mat.M << "x" << mat.N << ")."
00035 << std::endl;
00036 exit(1);
00037 }
00038 #endif//CPPL_DEBUG
00039
00040 dgbmatrix mat_cp(mat);
00041 dgematrix mat_inv(mat.M,mat.N);
00042 mat_inv.identity();
00043 mat_cp.dgbsv(mat_inv);
00044
00045 return _(mat_inv);
00046 }