Level 2 subroutine -- ALGLIB routine -- 15.12.2009 Bochkanov Sergey *************************************************************************/
| 2094 | Bochkanov Sergey |
| 2095 | *************************************************************************/ |
| 2096 | static void rmatrixrighttrsm2(int m, |
| 2097 | int n, |
| 2098 | const ap::real_2d_array& a, |
| 2099 | int i1, |
| 2100 | int j1, |
| 2101 | bool isupper, |
| 2102 | bool isunit, |
| 2103 | int optype, |
| 2104 | ap::real_2d_array& x, |
| 2105 | int i2, |
| 2106 | int j2) |
| 2107 | { |
| 2108 | int i; |
| 2109 | int j; |
| 2110 | double vr; |
| 2111 | double vd; |
| 2112 | |
| 2113 | |
| 2114 | // |
| 2115 | // Special case |
| 2116 | // |
| 2117 | if( n*m==0 ) |
| 2118 | { |
| 2119 | return; |
| 2120 | } |
| 2121 | |
| 2122 | // |
| 2123 | // Try to use "fast" code |
| 2124 | // |
| 2125 | if( rmatrixrighttrsmf(m, n, a, i1, j1, isupper, isunit, optype, x, i2, j2) ) |
| 2126 | { |
| 2127 | return; |
| 2128 | } |
| 2129 | |
| 2130 | // |
| 2131 | // General case |
| 2132 | // |
| 2133 | if( isupper ) |
| 2134 | { |
| 2135 | |
| 2136 | // |
| 2137 | // Upper triangular matrix |
| 2138 | // |
| 2139 | if( optype==0 ) |
| 2140 | { |
| 2141 | |
| 2142 | // |
| 2143 | // X*A^(-1) |
| 2144 | // |
| 2145 | for(i = 0; i <= m-1; i++) |
| 2146 | { |
| 2147 | for(j = 0; j <= n-1; j++) |
| 2148 | { |
| 2149 | if( isunit ) |
| 2150 | { |
| 2151 | vd = 1; |
| 2152 | } |
| 2153 | else |
no test coverage detected