I can not understand the manual about the following parameters of the function.
rows The number of rows in matrix B (the destination matrix).
cols The number of columns in matrix B (the destination matrix).
ldb If ordering = 'R' or 'r' , ldb represents the number of elements in array
b between adjacent rows of matrix B.
•If trans = 'T' or 't' or 'C' or 'c' , ldb must be at least equal to rows .
•If trans = 'N' or 'n' or 'R' or 'r' , ldb must be at least equal to cols .
If ordering = 'C' or 'c' , ldb represents the number of elements in array
b between adjacent columns of matrix B.
•If trans = 'T' or 't' or 'C' or 'c' , ldb must be at least equal to cols .
•If trans = 'N' or 'n' or 'R' or 'r' , ldb must be at least equal to rows.
Please see the code in MKL official examples.
int main(int argc, char *argv[])
{
size_t n=3, m=5;
double src[] = {
1., 2., 3., 4., 5.,
6., 7., 8., 9., 10.,
11., 12., 13., 14., 15.
}; /* source matrix */
double dst[8]; /* destination matrix */
size_t src_stride = 5;
size_t dst_stride = 2;
printf("\nThis is example of using mkl_domatcopy\n");
printf("INPUT DATA:\nSource matrix:\n");
print_matrix(n, m, 'd', src);
/*
** Source submatrix(2,4) a will be transposed
*/
mkl_domatcopy('R' /* row-major ordering */,
'T' /* A will be transposed */,
2 /* rows */,
4 /* cols */,
1. /* scales the input matrix */,
src /* source matrix */,
src_stride /* src_stride */,
dst /* destination matrix */,
dst_stride /* dst_stride */);
/* New matrix: src = {
** 1, 6,
** 2, 7,
** 3, 8,
** 4, 9,
** }
*/
printf("OUTPUT DATA:\nDestination matrix:\n");
print_matrix(4, 2, 'd', dst);
return 0;
}
The new matrix should be 4 rows and 2 cols, but in the code are 2 and 4.
If the code is correct, the rows should be explained as the rows of destination matrix without "operation".
Would you please look into the manual and give me some advice?
Thanks.