Matrix-vector product: y := op(A)*x INPUT PARAMETERS: M - number of rows of op(A) N - number of columns of op(A) A - target matrix IA - submatrix offset (row index) JA - submatrix offset (column index) OpA - operation type: * OpA=0 => op(A) = A * OpA=1 => op(A) = A^T X - input vector IX - subvector offset
| 640 | Bochkanov Sergey |
| 641 | *************************************************************************/ |
| 642 | void rmatrixmv(int m, |
| 643 | int n, |
| 644 | ap::real_2d_array& a, |
| 645 | int ia, |
| 646 | int ja, |
| 647 | int opa, |
| 648 | ap::real_1d_array& x, |
| 649 | int ix, |
| 650 | ap::real_1d_array& y, |
| 651 | int iy) |
| 652 | { |
| 653 | int i; |
| 654 | double v; |
| 655 | |
| 656 | if( m==0 ) |
| 657 | { |
| 658 | return; |
| 659 | } |
| 660 | if( n==0 ) |
| 661 | { |
| 662 | for(i = 0; i <= m-1; i++) |
| 663 | { |
| 664 | y(iy+i) = 0; |
| 665 | } |
| 666 | return; |
| 667 | } |
| 668 | if( rmatrixmvf(m, n, a, ia, ja, opa, x, ix, y, iy) ) |
| 669 | { |
| 670 | return; |
| 671 | } |
| 672 | if( opa==0 ) |
| 673 | { |
| 674 | |
| 675 | // |
| 676 | // y = A*x |
| 677 | // |
| 678 | for(i = 0; i <= m-1; i++) |
| 679 | { |
| 680 | v = ap::vdotproduct(&a(ia+i, ja), 1, &x(ix), 1, ap::vlen(ja,ja+n-1)); |
| 681 | y(iy+i) = v; |
| 682 | } |
| 683 | return; |
| 684 | } |
| 685 | if( opa==1 ) |
| 686 | { |
| 687 | |
| 688 | // |
| 689 | // y = A^T*x |
| 690 | // |
| 691 | for(i = 0; i <= m-1; i++) |
| 692 | { |
| 693 | y(iy+i) = 0; |
| 694 | } |
| 695 | for(i = 0; i <= n-1; i++) |
| 696 | { |
| 697 | v = x(ix+i); |
| 698 | ap::vadd(&y(iy), 1, &a(ia+i, ja), 1, ap::vlen(iy,iy+m-1), v); |
| 699 | } |
nothing calls this directly
no test coverage detected