From 5c494684ab116abc5c9c9ca9bb7dcff11f305e46 Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Mon, 15 May 2023 15:47:33 +0200 Subject: [PATCH] added debug testing ipiv in linear_solve_do --- nonclass.cc | 11 ++++++++--- t.cc | 10 ++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/nonclass.cc b/nonclass.cc index 14690ca..0a38db7 100644 --- a/nonclass.cc +++ b/nonclass.cc @@ -26,6 +26,8 @@ #include "qsort.h" #include "fortran.h" +#define IPIV_DEBUG + namespace LA { @@ -154,17 +156,20 @@ static void linear_solve_do(NRMat &A, double *B, const int nrhs, const i //find out whether ipiv are numbered from 0 or from 1 int shift=1; for (int i=0; i0 && B) laerror("singular matrix in lapack_gesv"); diff --git a/t.cc b/t.cc index 525164d..b6214bf 100644 --- a/t.cc +++ b/t.cc @@ -1237,7 +1237,7 @@ cout <>n >>m; @@ -1254,10 +1254,12 @@ for(int i=0;i bb=b; -//cout <aa=a; -linear_solve(aa,bb); +double d; +linear_solve(aa,bb,&d); +cout <<"det = "<