Mercurial > hg > octave-nkf
comparison liboctave/fCDiagMatrix.cc @ 9825:7483fe200fab
narrow complex values with negative zero imaginary parts
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 13 Nov 2009 12:34:46 +0100 |
parents | f80c566bc751 |
children | 4c0cdbe0acca |
comparison
equal
deleted
inserted
replaced
9824:6631c61a4a4e | 9825:7483fe200fab |
---|---|
410 } | 410 } |
411 | 411 |
412 bool | 412 bool |
413 FloatComplexDiagMatrix::all_elements_are_real (void) const | 413 FloatComplexDiagMatrix::all_elements_are_real (void) const |
414 { | 414 { |
415 octave_idx_type len = length (); | 415 return mx_inline_all_real (length (), data ()); |
416 for (octave_idx_type i = 0; i < len; i++) | |
417 { | |
418 float ip = std::imag (elem (i, i)); | |
419 | |
420 if (ip != 0.0 || lo_ieee_signbit (ip)) | |
421 return false; | |
422 } | |
423 | |
424 return true; | |
425 } | 416 } |
426 | 417 |
427 // diagonal matrix by diagonal matrix -> diagonal matrix operations | 418 // diagonal matrix by diagonal matrix -> diagonal matrix operations |
428 | 419 |
429 FloatComplexDiagMatrix& | 420 FloatComplexDiagMatrix& |