> 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.
So, the comment is correct, but the usage is wrong. If we need another
sort of real_t, then we should add it. But the existing one has
a welldefined meaning, and is used in contexts like
T t;
traits<T>::real_t product = 1.0 * t;
Now, maybe it should be renamed to double_product_t, but it does have
a meaning and use at the moment.
> 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.
So that function should be fixed. Where did the double come
from? acos? In which case either the float>float acos should be used,
or we must narrow to complex<float>
>
> 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.
>
>
> 
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Vxlmaintainers mailing list
> Vxlmaintainers@...
> https://lists.sourceforge.net/lists/listinfo/vxlmaintainers
>
