From: Peter Vanroose <Peter.V<anroose@es...> - 2002-03-08 20:26:02
> I have that included, as you need it for complex
No, for complex you only need vcl_complex.h
vnl/vnl_complex.h is specifically for this inline function.
Peter.
From: Bill Hoffman <bill.hoffman@ki...> - 2002-03-08 19:18:09
The following always aborts with a vnl_matrix<std::complex<float>>:
//: Return false if any element of (*this) is inf or nan
template <class T>
bool vnl_matrix<T>::is_finite() const
{
for (unsigned int i = 0; i < this->rows(); ++i)
for (unsigned int j = 0; j < this->columns(); ++j)
if (!vnl_math_isfinite((*this)(i,j)))
return false;
return true;
}
There is no overload for vnl_math_isfinite for complex types....
-Bill
From: Peter Vanroose <Peter.V<anroose@es...> - 2002-03-08 20:10:34
> There is no overload for vnl_math_isfinite for complex types....
vnl/vnl_complex.h has the following:
inline bool
vnl_math_isfinite(vcl_complex<float>const& z){return vnl_math_isfinite(vcl_real(z)) && vnl_math_isfinite(vcl_imag(z));}
so you just need to #include it...
Peter.
From: Bill Hoffman <bill.hoffman@ki...> - 2002-03-08 21:12:38
I have that included, as you need it for complex, but it does
not seem to work....
At 09:10 PM 3/8/2002 +0100, Peter Vanroose wrote:
>> There is no overload for vnl_math_isfinite for complex types....
>
>vnl/vnl_complex.h has the following:
>inline bool
>vnl_math_isfinite(vcl_complex<float>const& z){return vnl_math_isfinite(vcl_real(z)) && vnl_math_isfinite(vcl_imag(z));}
>
>so you just need to #include it...
>
>
> Peter.
From: Peter Vanroose <Peter.V<anroose@es...> - 2002-03-08 20:26:02
> I have that included, as you need it for complex
No, for complex you only need vcl_complex.h
vnl/vnl_complex.h is specifically for this inline function.
Peter.
From: Bill Hoffman <bill.hoffman@ki...> - 2002-03-08 20:35:54
Well, test_svd.cxx has the problem. This is a bit tricky to get
right.
At 09:25 PM 3/8/2002 +0100, Peter Vanroose wrote:
>> I have that included, as you need it for complex
>
>No, for complex you only need vcl_complex.h
>vnl/vnl_complex.h is specifically for this inline function.
>
>
> Peter.
From: Peter Vanroose <Peter.V<anroose@es...> - 2002-03-08 20:45:59
> Well, test_svd.cxx has the problem. This is a bit tricky to get right.
Strange.. I've never had (or seen) any problems with test_svd.
What happens if you add #include <vnl/vnl_complex.h> ?
Peter.