This subroutine copies matrix from non-aligned non-contigous storage to aligned contigous storage A: * MxN * non-aligned * non-contigous * may be transformed during copying (as prescribed by op) * pointer to ap::complex is passed B: * 2*alglib_c_block*alglib_c_block doubles (only MxN/NxM submatrix is used) * aligned * stride is alglib_c_block * pointer to double is passed Transformation types:
| 594 | * 3 - conjugate, but no transposition |
| 595 | ********************************************************************/ |
| 596 | void ialglib::mcopyblock_complex(int m, int n, const ap::complex *a, int op, int stride, double *b) |
| 597 | { |
| 598 | int i, j; |
| 599 | const ap::complex *psrc; |
| 600 | double *pdst; |
| 601 | if( op==0 ) |
| 602 | { |
| 603 | for(i=0,psrc=a; i<m; i++,a+=stride,b+=alglib_twice_c_block,psrc=a) |
| 604 | for(j=0,pdst=b; j<n; j++,pdst+=2,psrc++) |
| 605 | { |
| 606 | pdst[0] = psrc->x; |
| 607 | pdst[1] = psrc->y; |
| 608 | } |
| 609 | } |
| 610 | if( op==1 ) |
| 611 | { |
| 612 | for(i=0,psrc=a; i<m; i++,a+=stride,b+=2,psrc=a) |
| 613 | for(j=0,pdst=b; j<n; j++,pdst+=alglib_twice_c_block,psrc++) |
| 614 | { |
| 615 | pdst[0] = psrc->x; |
| 616 | pdst[1] = psrc->y; |
| 617 | } |
| 618 | } |
| 619 | if( op==2 ) |
| 620 | { |
| 621 | for(i=0,psrc=a; i<m; i++,a+=stride,b+=2,psrc=a) |
| 622 | for(j=0,pdst=b; j<n; j++,pdst+=alglib_twice_c_block,psrc++) |
| 623 | { |
| 624 | pdst[0] = psrc->x; |
| 625 | pdst[1] = -psrc->y; |
| 626 | } |
| 627 | } |
| 628 | if( op==3 ) |
| 629 | { |
| 630 | for(i=0,psrc=a; i<m; i++,a+=stride,b+=alglib_twice_c_block,psrc=a) |
| 631 | for(j=0,pdst=b; j<n; j++,pdst+=2,psrc++) |
| 632 | { |
| 633 | pdst[0] = psrc->x; |
| 634 | pdst[1] = -psrc->y; |
| 635 | } |
| 636 | } |
| 637 | } |
| 638 | |
| 639 | |
| 640 | /******************************************************************** |
nothing calls this directly
no outgoing calls
no test coverage detected