Phil Austin wrote:
> TV> I'm guessing that finite and trunc are only available under
> TV> AIX, then. I've removed finite and trunc; thanks for noticing
> TV> this.
>
> TV> This change will appear in the next snapshot.
>
> Hi Todd--would it be possible to separate isnan() and isnanf() from
> BZ_HAVE_IEEE_MATH? These are available on KCC/egcs/linux even though
> the rest of the math functions don't appear to be.
Hi Phil, math functions are a headache. Every compiler has a
different subset of non-ansi math functions.
In the new version there is the ability to define your own expression-
template functions. So you will be able to do
BZ_DECLARE_FUNCTION_RET(isnan, bool)
BZ_DECLARE_FUNCTION_RET(isnanf, bool)
and everything will work as expected (not entirely sure of the
syntax on this one yet). Could you be content with this?
I'm appending the current "useret" example and its output.
Cheers,
Todd
double myFunction(double x)
{ return 1.0 / (1 + x); }
double foobar(double x, double y)
{
return x*y;
}
BZ_DECLARE_FUNCTION(myFunction)
BZ_DECLARE_FUNCTION2(foobar)
int main()
{
Array<double,2> A(4,4), B(4,4), C(4,4);
A = 0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
12, 13, 14, 15;
C = 3;
cout << "A = " << A << endl
<< "C = " << C << endl;
B = myFunction(A);
cout << "B = myFunction(A) = " << B << endl;
B = foobar(A,C);
cout << "B = foobar(A,C) = " << B << endl;
B = foobar(tensor::i, tensor::j);
cout << "B = foobar(tensor::i, tensor::j) = " << B << endl;
}
Output:
A = 4 x 4
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
C = 4 x 4
3 3 3 3
3 3 3 3
3 3 3 3
3 3 3 3
B = myFunction(A) = 4 x 4
1 0.5 0.333333 0.25
0.2 0.166667 0.142857 0.125
0.111111 0.1 0.0909091 0.0833333
0.0769231 0.0714286 0.0666667 0.0625
B = foobar(A,C) = 4 x 4
0 3 6 9
12 15 18 21
24 27 30 33
36 39 42 45
B = foobar(tensor::i, tensor::j) = 4 x 4
0 0 0 0
0 1 2 3
0 2 4 6
0 3 6 9
--------------------- blitz-dev list --------------------------------
* To subscribe/unsubscribe: mail to majordomo@oonumerics.org, with
"subscribe blitz-dev" or "unsubscribe blitz-dev" in the body of the message
* Blitz++ web page: http://oonumerics.org/blitz/
This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 04:30:07 EST