From: Todd V. <tve...@ex...> - 2000-10-30 20:44:16
|
These changes should become part of libstdc++, could you forward them to the gcc maintainers if this hasn't been fixed yet. http://sources.redhat.com/libstdc++/mail.html Thanks, Todd Doug Warner wrote: > > On Sat, 20 May 2000, Todd Veldhuizen wrote: > > You are getting this error because BZ_HAVE_COMPLEX_MATH is #undef'ed > > in <blitz/config.h>. This is because compiler/compmath.cpp fails to > > compile with gcc. The gcc library is missing log10, tan and tanh > > for complex numbers as required by the standard. > > > > You may be able to work around this by manually #def'ing > > BZ_HAVE_COMPLEX_MATH in <blitz/config.h>. > > > > Cheers, > > Todd > > That didn't work for me. I ended up having to define the missing > functions and put my own <complex> header (below) with my source files > to get the needed functionality. Then you either make the modification to > <blitz/config.h> as you suggest, or configure blitz with this header in the > include path before the standard includes. > > Best regards, > > Doug Warner > > ==================================================== > Doug Warner, PhD Research Scientist > Vexcel Corporation - Image Information Engineering > 4909 Nautilus Court voice: (303) 583-0218 > Boulder CO 80301, USA fax: (303) 444-0470 > http://www.vexcel.com > ==================================================== > > > #ifndef dww_complex_hack > # define dww_complex_hack 1 > > # ifndef __COMPLEX__ > # define __COMPLEX__ > > # include <std/complext.h> > > extern "C++" { > # define __STD_COMPLEX > > // ANSI complex types > typedef complex<float> float_complex; > typedef complex<double> double_complex; > typedef complex<long double> long_double_complex; > } > > # endif // __COMPLEX__ > > extern "C++" { > > template <class FLOAT> complex<FLOAT> > log10 (const complex<FLOAT>& x) > { > return complex<FLOAT> (log10 (abs (x)), arg (x)); > } > > template <class FLOAT> complex<FLOAT> > tan (const complex<FLOAT>& x) > { > FLOAT re = real (x), im = imag (x); > FLOAT d = 2 / (cos (2 * re) + cosh (2 * im)); > return complex<FLOAT> (d * sin (re) * cos (re), d * sinh (im) * cosh (im)); > } > > template <class FLOAT> complex<FLOAT> > tanh (const complex<FLOAT>& x) > { // tanh z = -i tan iz > complex<FLOAT> t = tan (complex<FLOAT> (-imag (x), real (x))); > return complex<FLOAT> (imag (t), -real (t)); > } > > } > > #endif // dww_complex_hack > > --------------------- blitz-support list -------------------------------- > * To subscribe/unsubscribe: use the handy web form at > http://oonumerics.org/blitz/lists.html > > -- Todd Veldhuizen tve...@ac... Indiana Univ. Comp. Sci. http://extreme.indiana.edu/~tveldhui/ --------------------- blitz-support list -------------------------------- * To subscribe/unsubscribe: use the handy web form at http://oonumerics.org/blitz/lists.html |