diff --git a/CXSparse/Source/cs_updown.c b/CXSparse/Source/cs_updown.c index f275f0530..a3fa1e459 100644 --- a/CXSparse/Source/cs_updown.c +++ b/CXSparse/Source/cs_updown.c @@ -25,7 +25,11 @@ CS_INT cs_updown (cs *L, CS_INT sigma, const cs *C, const CS_INT *parent) { p = Lp [j] ; alpha = w [j] / Lx [p] ; /* alpha = w(j) / L(j,j) */ - beta2 = beta*beta + sigma*((double) (alpha*CS_CONJ(alpha))) ; + #ifdef CS_COMPLEX + beta2 = beta*beta + sigma*creal(alpha*CS_CONJ(alpha)) ; + #else + beta2 = beta*beta + sigma*(alpha*alpha) ; + #endif if (beta2 <= 0) break ; /* not positive definite */ beta2 = sqrt (beta2) ; delta = (sigma > 0) ? (beta / beta2) : (beta2 / beta) ;