diff liboctave/dNDArray.cc @ 15212:4bbd3bbb8912

reduce code duplication in too_large_for_float array functions * lo-utils.h (any_all_test): New function. * lo-utils.h, lo-utils.cc (xtoo_large_for_float (const Complex&)): New function. * Array.h (Array<T>::test): Call any_all_test. * Sparse.h (Sparse<T>::test, Sparse<T>::test_any, Sparse<T>::test_all, Sparse<T>::test_any, Sparse<T>::test_any, Sparse<T>::test_all, Sparse<T>::test_all): New functions. * CMatrix.cc (ComplexMatrix::too_large_for_float): Simplify with test_any and xtoo_large_for_float. * CNDArray.cc (ComplexNDArray::too_large_for_float): Likewise. * CSparse.cc (SparseComplexMatrix::too_large_for_float): Likewise. * dSparse.cc (SparseMatrix::too_large_for_float): Likewise. * dMatrix.cc (Matrix::too_large_for_float): Use test_any, not test_all. * dNDArray.cc (NDArray::too_large_for_float): Likewise. * fCMatrix.cc (FloatComplexMatrix::too_large_for_float): Unconditionlly return false. * fCNDArray.cc (FloatComplexNDArray::too_large_for_float): Likewise.
author John W. Eaton <jwe@octave.org>
date Wed, 22 Aug 2012 16:16:31 -0400
parents 3d8ace26c5b4
children 9020dddc925a
line wrap: on
line diff
--- a/liboctave/dNDArray.cc	Tue Aug 21 17:48:19 2012 -0400
+++ b/liboctave/dNDArray.cc	Wed Aug 22 16:16:31 2012 -0400
@@ -632,7 +632,7 @@
 bool
 NDArray::too_large_for_float (void) const
 {
-  return test_all (xtoo_large_for_float);
+  return test_any (xtoo_large_for_float);
 }
 
 // FIXME -- this is not quite the right thing.