Same as CMatrixRightTRSM, but for real matrices OpType may be only 0 or 1. -- ALGLIB routine -- 15.12.2009 Bochkanov Sergey *************************************************************************/
| 966 | Bochkanov Sergey |
| 967 | *************************************************************************/ |
| 968 | void rmatrixrighttrsm(int m, |
| 969 | int n, |
| 970 | const ap::real_2d_array& a, |
| 971 | int i1, |
| 972 | int j1, |
| 973 | bool isupper, |
| 974 | bool isunit, |
| 975 | int optype, |
| 976 | ap::real_2d_array& x, |
| 977 | int i2, |
| 978 | int j2) |
| 979 | { |
| 980 | int s1; |
| 981 | int s2; |
| 982 | int bs; |
| 983 | |
| 984 | bs = ablasblocksize(a); |
| 985 | if( m<=bs&&n<=bs ) |
| 986 | { |
| 987 | rmatrixrighttrsm2(m, n, a, i1, j1, isupper, isunit, optype, x, i2, j2); |
| 988 | return; |
| 989 | } |
| 990 | if( m>=n ) |
| 991 | { |
| 992 | |
| 993 | // |
| 994 | // Split X: X*A = (X1 X2)^T*A |
| 995 | // |
| 996 | ablassplitlength(a, m, s1, s2); |
| 997 | rmatrixrighttrsm(s1, n, a, i1, j1, isupper, isunit, optype, x, i2, j2); |
| 998 | rmatrixrighttrsm(s2, n, a, i1, j1, isupper, isunit, optype, x, i2+s1, j2); |
| 999 | } |
| 1000 | else |
| 1001 | { |
| 1002 | |
| 1003 | // |
| 1004 | // Split A: |
| 1005 | // (A1 A12) |
| 1006 | // X*op(A) = X*op( ) |
| 1007 | // ( A2) |
| 1008 | // |
| 1009 | // Different variants depending on |
| 1010 | // IsUpper/OpType combinations |
| 1011 | // |
| 1012 | ablassplitlength(a, n, s1, s2); |
| 1013 | if( isupper&&optype==0 ) |
| 1014 | { |
| 1015 | |
| 1016 | // |
| 1017 | // (A1 A12)-1 |
| 1018 | // X*A^-1 = (X1 X2)*( ) |
| 1019 | // ( A2) |
| 1020 | // |
| 1021 | rmatrixrighttrsm(m, s1, a, i1, j1, isupper, isunit, optype, x, i2, j2); |
| 1022 | rmatrixgemm(m, s2, s1, -1.0, x, i2, j2, 0, a, i1, j1+s1, 0, 1.0, x, i2, j2+s1); |
| 1023 | rmatrixrighttrsm(m, s2, a, i1+s1, j1+s1, isupper, isunit, optype, x, i2, j2+s1); |
| 1024 | return; |
| 1025 | } |
nothing calls this directly
no test coverage detected