Handle INF and NAN in inputs
This commit is contained in:
parent
9e24121e7e
commit
c1019d5832
|
@ -48,7 +48,10 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da, FLOAT *x, BLAS
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( da == 0.0 )
|
if ( da == 0.0 )
|
||||||
x[i]=0.0;
|
if (isfinite(x[i]))
|
||||||
|
x[i]=0.0;
|
||||||
|
else
|
||||||
|
x[i]=NAN;
|
||||||
else
|
else
|
||||||
x[i] = da * x[i] ;
|
x[i] = da * x[i] ;
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da, FLOAT *x, BLAS
|
||||||
FLOAT_V_T v0, v1;
|
FLOAT_V_T v0, v1;
|
||||||
unsigned int gvl = 0;
|
unsigned int gvl = 0;
|
||||||
if(inc_x == 1){
|
if(inc_x == 1){
|
||||||
if(da == 0.0){
|
if (0){ //if(da == 0.0){
|
||||||
memset(&x[0], 0, n * sizeof(FLOAT));
|
memset(&x[0], 0, n * sizeof(FLOAT));
|
||||||
}else{
|
}else{
|
||||||
gvl = VSETVL(n);
|
gvl = VSETVL(n);
|
||||||
|
@ -96,7 +96,7 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da, FLOAT *x, BLAS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(da == 0.0){
|
if (0) { //if(da == 0.0){
|
||||||
BLASLONG stride_x = inc_x * sizeof(FLOAT);
|
BLASLONG stride_x = inc_x * sizeof(FLOAT);
|
||||||
BLASLONG ix = 0;
|
BLASLONG ix = 0;
|
||||||
gvl = VSETVL(n);
|
gvl = VSETVL(n);
|
||||||
|
|
|
@ -63,7 +63,7 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F
|
||||||
if (isnan(x[ip]) || isinf(x[ip])) temp = NAN;
|
if (isnan(x[ip]) || isinf(x[ip])) temp = NAN;
|
||||||
if (!isinf(x[ip+1]))
|
if (!isinf(x[ip+1]))
|
||||||
x[ip+1] = da_i * x[ip] ;
|
x[ip+1] = da_i * x[ip] ;
|
||||||
else x[ip+1] = NAN;
|
else x[ip+1] = NAN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue