This subroutine copies matrix from aligned contigous storage to non- aligned non-contigous storage A: * MxN * aligned * contigous * stride is alglib_r_block * may be transformed during copying (as prescribed by op) B: * alglib_r_block*alglib_r_block (only MxN/NxM submatrix is used) * non-aligned, non-contigous Transformation types: * 0 - no transform * 1 - transposition ***********************
| 535 | * 1 - transposition |
| 536 | ********************************************************************/ |
| 537 | void ialglib::mcopyunblock(int m, int n, const double *a, int op, double *b, int stride) |
| 538 | { |
| 539 | int i, j, n2; |
| 540 | const double *psrc; |
| 541 | double *pdst; |
| 542 | if( op==0 ) |
| 543 | { |
| 544 | n2 = n/2; |
| 545 | for(i=0,psrc=a; i<m; i++,a+=alglib_r_block,b+=stride,psrc=a) |
| 546 | { |
| 547 | for(j=0,pdst=b; j<n2; j++,pdst+=2,psrc+=2) |
| 548 | { |
| 549 | pdst[0] = psrc[0]; |
| 550 | pdst[1] = psrc[1]; |
| 551 | } |
| 552 | if( n%2!=0 ) |
| 553 | pdst[0] = psrc[0]; |
| 554 | } |
| 555 | } |
| 556 | else |
| 557 | { |
| 558 | n2 = n/2; |
| 559 | for(i=0,psrc=a; i<m; i++,a++,b+=stride,psrc=a) |
| 560 | { |
| 561 | for(j=0,pdst=b; j<n2; j++,pdst+=2,psrc+=alglib_twice_r_block) |
| 562 | { |
| 563 | pdst[0] = psrc[0]; |
| 564 | pdst[1] = psrc[alglib_r_block]; |
| 565 | } |
| 566 | if( n%2!=0 ) |
| 567 | pdst[0] = psrc[0]; |
| 568 | } |
| 569 | } |
| 570 | } |
| 571 | |
| 572 | |
| 573 | /******************************************************************** |
nothing calls this directly
no outgoing calls
no test coverage detected