From d1bb7ae144d499d9db554c51926e52aebb332228 Mon Sep 17 00:00:00 2001 From: ultramn Date: Sat, 17 Dec 2016 21:32:47 -0800 Subject: Fixed a bug with dclapack. --- dave/dclapack.h | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'dave/dclapack.h') diff --git a/dave/dclapack.h b/dave/dclapack.h index 36fad53..4e209d3 100644 --- a/dave/dclapack.h +++ b/dave/dclapack.h @@ -11,6 +11,8 @@ #include +#define _ABS(a) ( (a)<=0 ? 0-(a) : (a) ) + /* * Prints a matrix A (n by m) */ @@ -38,6 +40,20 @@ } \ } +/* + * B = Transpose(A) + * A is (n by m) + * B is (m by n) + */ +#define TRANSP(A,B,n,m) { \ + int i,j; \ + for (i=0; i U[max][i]) { max = j; } \ + if (_ABS(U[j][i]) > _ABS(U[max][i])) { max = j; } \ } \ _tempi=Piv[i]; Piv[i]=Piv[max]; Piv[max]=_tempi; \ for (k=i; k