# HG changeset patch # User Jaroslav Hajek # Date 1235992349 -3600 # Node ID 4ab9654eceac5aee9c3d1b7837825d651865e8eb # Parent ca032de5fbf295013457db5722b8e5788e2645b6 update comment diff -r ca032de5fbf2 -r 4ab9654eceac liboctave/mx-inlines.cc --- a/liboctave/mx-inlines.cc Mon Mar 02 10:22:17 2009 +0100 +++ b/liboctave/mx-inlines.cc Mon Mar 02 12:12:29 2009 +0100 @@ -286,7 +286,9 @@ OP_DUP_FCN (imag, mx_inline_imag_dup, float, FloatComplex) OP_DUP_FCN (conj, mx_inline_conj_dup, FloatComplex, FloatComplex) -// NOTE: std::norm is NOT equivalent +// FIXME: Due to a performance defect in g++ (<= 4.3), std::norm is slow unless +// ffast-math is on (not by default even with -O3). The following helper function +// gives the expected straightforward implementation of std::norm. template inline T cabsq (const std::complex& c) { return c.real () * c.real () + c.imag () * c.imag (); }