This subroutine calculates X*op(A^-1) where: * X is MxN general matrix * A is NxN upper/lower triangular/unitriangular matrix * "op" may be identity transformation, transposition, conjugate transposition Multiplication result replaces X. Cache-oblivious algorithm is used. INPUT PARAMETERS N - matrix size, N>=0 M - matrix size, N>=0 A - matrix, actial matrix is stored
| 732 | Bochkanov Sergey |
| 733 | *************************************************************************/ |
| 734 | void cmatrixrighttrsm(int m, |
| 735 | int n, |
| 736 | const ap::complex_2d_array& a, |
| 737 | int i1, |
| 738 | int j1, |
| 739 | bool isupper, |
| 740 | bool isunit, |
| 741 | int optype, |
| 742 | ap::complex_2d_array& x, |
| 743 | int i2, |
| 744 | int j2) |
| 745 | { |
| 746 | int s1; |
| 747 | int s2; |
| 748 | int bs; |
| 749 | |
| 750 | bs = ablascomplexblocksize(a); |
| 751 | if( m<=bs&&n<=bs ) |
| 752 | { |
| 753 | cmatrixrighttrsm2(m, n, a, i1, j1, isupper, isunit, optype, x, i2, j2); |
| 754 | return; |
| 755 | } |
| 756 | if( m>=n ) |
| 757 | { |
| 758 | |
| 759 | // |
| 760 | // Split X: X*A = (X1 X2)^T*A |
| 761 | // |
| 762 | ablascomplexsplitlength(a, m, s1, s2); |
| 763 | cmatrixrighttrsm(s1, n, a, i1, j1, isupper, isunit, optype, x, i2, j2); |
| 764 | cmatrixrighttrsm(s2, n, a, i1, j1, isupper, isunit, optype, x, i2+s1, j2); |
| 765 | } |
| 766 | else |
| 767 | { |
| 768 | |
| 769 | // |
| 770 | // Split A: |
| 771 | // (A1 A12) |
| 772 | // X*op(A) = X*op( ) |
| 773 | // ( A2) |
| 774 | // |
| 775 | // Different variants depending on |
| 776 | // IsUpper/OpType combinations |
| 777 | // |
| 778 | ablascomplexsplitlength(a, n, s1, s2); |
| 779 | if( isupper&&optype==0 ) |
| 780 | { |
| 781 | |
| 782 | // |
| 783 | // (A1 A12)-1 |
| 784 | // X*A^-1 = (X1 X2)*( ) |
| 785 | // ( A2) |
| 786 | // |
| 787 | cmatrixrighttrsm(m, s1, a, i1, j1, isupper, isunit, optype, x, i2, j2); |
| 788 | cmatrixgemm(m, s2, s1, -1.0, x, i2, j2, 0, a, i1, j1+s1, 0, 1.0, x, i2, j2+s1); |
| 789 | cmatrixrighttrsm(m, s2, a, i1+s1, j1+s1, isupper, isunit, optype, x, i2, j2+s1); |
| 790 | return; |
| 791 | } |
nothing calls this directly
no test coverage detected