Convergence problems with Intel's 8.0 C++ compiler

Décio Luiz Gazzoni Filho decio at decpp.net
Thu Feb 26 19:17:42 CET 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 26 February 2004 18:28, Felix E. Klee wrote:
> Now, how can I circumvent the problem if I don't want the outcome of the
> simulation to be dependent on the implemenation of the complex class?
> Three possibilities come into my mind:
> 1. Specialize the complex class for MPF types (probably too much
>    trouble).
> 2. Build a simple complex_MPF implementation (seems to be feasible).
> 3. Eliminate all complex number arithmetics (also feasible).

I've been confronted with a similar problem (regarding initialization of 
std::complex<mpf_class> arrays), and I was playing with a possible solution, 
although in the end I just replaced my arrays with std::vector<>'s and was 
done with it.

The idea is to create a derived class of mpf_class and reimplement the 
constructor only. For instance, for my problem a reimplementation of the 
default constructor would suffice. Something like:

class my_mpf_class : public mpf_class {
	public:
		my_mpf_class() : mpf_class(0,YOUR_PRECISION) { };
};

I think the code as is written failed. But maybe with a little poking around 
this may work. You may also need an explicit operator mpf_class() { return 
*this }; but I'm not sure.

Hope that helps.

Décio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAPnCVFXvAfvngkOIRAkjFAJkBUQa7fBE/A5iy5utH+E66NJVBmgCfcQxt
qjvdmHm5mTqlxc/DhDV6nSQ=
=guGI
-----END PGP SIGNATURE-----


More information about the gmp-discuss mailing list