Skip to content

Commit e806b2e

Browse files
committed
cblas domino check NaN
1 parent 0940666 commit e806b2e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

jsrc/vd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ static A jtlq(J jt,A w,D *det){A l;D c=inf,d=0,x;I n1,n,*s,wr;
216216
if(hascblas&&(wr==2)&&(s[0]==s[1])&&(AT(w)&FL)&&(s[0]>1)){
217217
int info; int m1=s[0]; int *ipiv;
218218
D worksize; D *work; int nn=-1;
219+
NAN0;
219220
ipiv=MALLOC(m1*sizeof(int));
220221
w=cant1(w);
221222
jdgetrf_(&m1,&m1,DAV(w),&m1,ipiv,&info);
@@ -226,11 +227,13 @@ static A jtlq(J jt,A w,D *det){A l;D c=inf,d=0,x;I n1,n,*s,wr;
226227
jdgetri_(&m1,DAV(w),&m1,ipiv,work,&nn,&info);
227228
if(info){FREE(ipiv); FREE(work); ASSERT(!info,EVDOMAIN);}
228229
FREE(ipiv); FREE(work);
230+
NAN1;
229231
*det=0.0;
230232
RETF(cant1(w));
231233
}else if(hascblas&&(wr==2)&&(s[0]==s[1])&&(AT(w)&CMPX)&&(s[0]>1)){
232234
int info; int m1=s[0]; int *ipiv;
233235
dcomplex worksize; dcomplex *work; int nn=-1;
236+
NAN0;
234237
ipiv=MALLOC(m1*sizeof(int));
235238
w=cant1(w);
236239
jzgetrf_(&m1,&m1,(dcomplex*)ZAV(w),&m1,ipiv,&info);
@@ -241,6 +244,7 @@ static A jtlq(J jt,A w,D *det){A l;D c=inf,d=0,x;I n1,n,*s,wr;
241244
jzgetri_(&m1,(dcomplex*)ZAV(w),&m1,ipiv,work,&nn,&info);
242245
if(info){FREE(ipiv); FREE(work); ASSERT(!info,EVDOMAIN);}
243246
FREE(ipiv); FREE(work);
247+
NAN1;
244248
*det=0.0;
245249
RETF(cant1(w));
246250
#if 0 // slow

test/g131.ijs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ assert. 1e_8>e
188188
0 -: %.~$~0x
189189
0 -: %.~$~0r4
190190

191+
'NaN error' -: %. etx 2 2 $ 0 1 2 _
192+
'NaN error' -: %. etx 2 2$0 1e_309 10 10
191193

192194
'domain error' -: %. etx 4 4$'abc'
193195
'domain error' -: %. etx 4 4$u:'abc'

0 commit comments

Comments
 (0)