10
* double A[n*n], T[n*n];
22
* Transposes the n by n square matrix A and puts the result in T.
23
* The output, T, may occupy the same storage as A.
32
void mtransp( int,double*,double* );
41
double *pAc, *pAr, *pTc, *pTr, *pA0, *pT0;
47
for( i=0; i<n-1; i++ ) /* row index */
49
pAc = pA0; /* next diagonal element of input */
50
pAr = pAc + n; /* next row down underneath the diagonal element */
51
pTc = pT0; /* next diagonal element of the output */
52
pTr = pTc + n; /* next row underneath */
53
*pTc++ = *pAc++; /* copy the diagonal element */
54
for( j=i+1; j<n; j++ ) /* column index */
62
pA0 += np1; /* &A[n*i+i] for next i */
63
pT0 += np1; /* &T[n*i+i] for next i */
65
*pT0 = *pA0; /* copy the diagonal element */