
Markus Neher wrote:
- namespace errors whereby some std:: qualifications were missing;
- namespace errors when compiling (as we have to) with FILIB_NAMESPACES defined;
- incorrect uses of abs() (an int -> int function) instead of fabs() (double -> double);
- unused variables (causing annoying warnings).
Thank you for the information and for the elimnation of the unused variables. Our compiler (gcc 2.95) did not show us any errors. Which compiler are you using? It seems to be better than ours.
Hi Markus and Ingo,
I am using gcc 3.2.1. Other members of the team use other versions, but all above version 3.0 (which is the first one implementing enough standard C++ for our purposes).
- undefined type `Complex';
This error is puzzling. The Complex data type is contained in the C++ standard (see File Complex.h). It is simply the double version of the complex data type: typedef complex<double> Complex;
The header `Complex.h' is not part of the C++ standard. And, as far as I can tell, it is not part of CoStLy 0.3 beta. Perhaps a packaging problem? Or else, do you mean that `Complex.h' is part of the GCC 2.95 distribution? If so it was a non-standard feature that has been removed. Maybe the solution is simply to
1) #include <complex> in the appropriate CoStLy sources; and 2) use std::complex<double> instead of Complex.
We are now using the revised beta version. However, we could not disable our wrapper around the pow() function, since CoStLy still throws an exception for invocations like, e.g., pow(([-0.5, -0.5],[0, 0]), ([-1, -1],[0, 0])).
In CoStLy 0.3, we have several power functions (see documentation) which perform differently. There is a special function for integer exponents, namely
power(Z,n) (Z: cinterval, n: integer)
Here, the logarithm is not used. power( ([-0.5, -0.5],[0, 0]), -1 ) is well defined. There are also new root functions that compute all roots, even for intervals that intersect the negative real axis.
Do you have a priori information on the type of exponents that occur in your computations? For example, if you knew that only integer exponents occurred then you could replace all calls of pow(Z,P) (Z,P: cintervals) by calls of power(Z,n) (Z: cinterval; n:integer).
No, we do not have this knowledge a priori. Of course we can test the type of the exponent at run-time and then invoke the appropriate function.
Or, for real or complex interval exponents, you could use pow_all instead of pow. pow_all computes an enclosure of all solutions of Z^P. pow_all never throws an exception, but sometimes a list of intervals (which cover the solution set) and sometimes the whole complex plane is returned.
The pow function is implemented as pow(Z,P) = e^(P*ln(Z)) with the principal branch of the logarithm. For our applications, we need this function to be analytic on its domain. That's why Z must not intersect the negative real axis.
Thanks a lot. Please let us know when it is time to beta-test a new version of CoStLy. Cheers
Roberto