From: Amitha Perera <perera@cs...>  20030121 04:01:18

Hi Why is vnl_numeric_traits<float>::real_t a double instead of a float? The comment says "result when multiplied by double", but that's not quite how it is used. It generates a warning is vnl_vector::cos_angle when instantiated with complex<float> because there is an attempt to create a complex<float> from a double, which implies a loss of precision. Changing the real_t to float would also fix things like vnl_matrix.txx:834: // FIXME need correct rounding here // There is e.g. no *standard* operator*=(complex<float>, double), hence the T() cast. this>data[i][j] *= T(scale); Here, scale has type real_t, which means double, and therefore the problem. I think we should have typedef vnl_numeric_traits<float>::real_t float; typedef vnl_numeric_traits<double>::real_t double; typedef vnl_numeric_traits< complex<float> >::real_t complex<float>; typedef vnl_numeric_traits< complex<double> >::real_t complex<double>; The comment could be from //: Name of type which results from multiplying this type with a double to //: Name of type which results from multiplying this type with a float However, I have no experience in using vnl except with doubles, so I don't know what would break from this change. Can someone who knows better comment? Thanks, Amitha. 