summaryrefslogtreecommitdiff
path: root/libm/double/mtransp.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-11-22 14:04:29 +0000
committerEric Andersen <andersen@codepoet.org>2001-11-22 14:04:29 +0000
commit7ce331c01ce6eb7b3f5c715a38a24359da9c6ee2 (patch)
tree3a7e8476e868ae15f4da1b7ce26b2db6f434468c /libm/double/mtransp.c
parentc117dd5fb183afb1a4790a6f6110d88704be6bf8 (diff)
Totally rework the math library, this time based on the MacOs X
math library (which is itself based on the math lib from FreeBSD). -Erik
Diffstat (limited to 'libm/double/mtransp.c')
-rw-r--r--libm/double/mtransp.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/libm/double/mtransp.c b/libm/double/mtransp.c
deleted file mode 100644
index b4a54dd0f..000000000
--- a/libm/double/mtransp.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* mtransp.c
- *
- * Matrix transpose
- *
- *
- *
- * SYNOPSIS:
- *
- * int n;
- * double A[n*n], T[n*n];
- *
- * mtransp( n, A, T );
- *
- *
- *
- * DESCRIPTION:
- *
- *
- * T[r][c] = A[c][r]
- *
- *
- * Transposes the n by n square matrix A and puts the result in T.
- * The output, T, may occupy the same storage as A.
- *
- *
- *
- */
-
-
-mtransp( n, A, T )
-int n;
-double *A, *T;
-{
-int i, j, np1;
-double *pAc, *pAr, *pTc, *pTr, *pA0, *pT0;
-double x, y;
-
-np1 = n+1;
-pA0 = A;
-pT0 = T;
-for( i=0; i<n-1; i++ ) /* row index */
- {
- pAc = pA0; /* next diagonal element of input */
- pAr = pAc + n; /* next row down underneath the diagonal element */
- pTc = pT0; /* next diagonal element of the output */
- pTr = pTc + n; /* next row underneath */
- *pTc++ = *pAc++; /* copy the diagonal element */
- for( j=i+1; j<n; j++ ) /* column index */
- {
- x = *pAr;
- *pTr = *pAc++;
- *pTc++ = x;
- pAr += n;
- pTr += n;
- }
- pA0 += np1; /* &A[n*i+i] for next i */
- pT0 += np1; /* &T[n*i+i] for next i */
- }
-*pT0 = *pA0; /* copy the diagonal element */
-}
-