Mercurial > octave-antonio
changeset 19080: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 | ba442cd7f7c3 |
children | d59d052c9858 |
files | libinterp/dldfcn/__ichol__.cc |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/dldfcn/__ichol__.cc Thu Sep 11 00:32:26 2014 -0400 +++ b/libinterp/dldfcn/__ichol__.cc Thu Sep 11 00:49:22 2014 -0400 @@ -31,7 +31,13 @@ // Secondary functions for complex and real case used in ichol algorithms. Complex ichol_mult_complex (Complex a, Complex b) { +#if defined (HAVE_CXX_COMPLEX_SETTERS) b.imag (-std::imag (b)); +#elif defined (HAVE_CXX_COMPLEX_REFERENCE_ACCESSORS) + b.imag () = -std::imag (b); +#else + b = std::conj (b); +#endif return a * b; }