see i look online and all i find are programs using this type of transpose, which i dnt know if its the same
insert
Code:
int main()
{
int i,j;
double a[4][5] = {{ 1.00, 2.00, 3.00, 4.00, 5.00},
{ 1.00, 4.00, 9.00, 16.00, 25.00},
{ 1.00, 8.00, 27.00, 64.00,125.00},
{ 1.00, 16.00, 81.00,256.00,625.00}};
double b[5][4];
transpose_matrix(&a[0][0], &b[0][0], 4, 5);
for(j=0;j<4;j++)
{
for(i=0;i<5;i++)
{
printf("%6.2lf ", a[j][i]);
}
printf("\n");
}
printf("--\n");
for(j=0;j<5;j++)
{
for(i=0;i<4;i++)
{
printf("%6.2lf ", b[j][i]);
}
printf("\n");
}
}