| 721 | |
| 722 | /* y[0:m,0:n] += diag(a[0:1,0:m]) * x[0:m,0:n] */ |
| 723 | template<typename T1, typename T2, typename T3> static void |
| 724 | MatrAXPY( int m, int n, const T1* x, int dx, |
| 725 | const T2* a, int inca, T3* y, int dy ) |
| 726 | { |
| 727 | int i, j; |
| 728 | for( i = 0; i < m; i++, x += dx, y += dy ) |
| 729 | { |
| 730 | T2 s = a[i*inca]; |
| 731 | j=0; |
| 732 | #if CV_ENABLE_UNROLLED |
| 733 | for(; j <= n - 4; j += 4 ) |
| 734 | { |
| 735 | T3 t0 = (T3)(y[j] + s*x[j]); |
| 736 | T3 t1 = (T3)(y[j+1] + s*x[j+1]); |
| 737 | y[j] = t0; |
| 738 | y[j+1] = t1; |
| 739 | t0 = (T3)(y[j+2] + s*x[j+2]); |
| 740 | t1 = (T3)(y[j+3] + s*x[j+3]); |
| 741 | y[j+2] = t0; |
| 742 | y[j+3] = t1; |
| 743 | } |
| 744 | #endif |
| 745 | for( ; j < n; j++ ) |
| 746 | y[j] = (T3)(y[j] + s*x[j]); |
| 747 | } |
| 748 | } |
| 749 | |
| 750 | template<typename T> static void |
| 751 | SVBkSbImpl_( int m, int n, const T* w, int incw, |