comparison libinterp/dldfcn/__ichol__.cc @ 19114:af9c22e20a57

Apply std::complex feature tests to ichol helper function * __ichol__.cc (ichol_mult_complex): Apply existing std::complex feature tests for element setters or reference accessors, use std::conj as a fallback.
author Mike Miller <mtmiller@ieee.org>
date Thu, 11 Sep 2014 00:49:22 -0400
parents 38937efbee21
children 65554f5847ac
comparison
equal deleted inserted replaced
19113:ba442cd7f7c3 19114:af9c22e20a57
29 #include "parse.h" 29 #include "parse.h"
30 30
31 // Secondary functions for complex and real case used in ichol algorithms. 31 // Secondary functions for complex and real case used in ichol algorithms.
32 Complex ichol_mult_complex (Complex a, Complex b) 32 Complex ichol_mult_complex (Complex a, Complex b)
33 { 33 {
34 #if defined (HAVE_CXX_COMPLEX_SETTERS)
34 b.imag (-std::imag (b)); 35 b.imag (-std::imag (b));
36 #elif defined (HAVE_CXX_COMPLEX_REFERENCE_ACCESSORS)
37 b.imag () = -std::imag (b);
38 #else
39 b = std::conj (b);
40 #endif
35 return a * b; 41 return a * b;
36 } 42 }
37 43
38 double ichol_mult_real (double a, double b) 44 double ichol_mult_real (double a, double b)
39 { 45 {