Blitz logo

Blitz Bugs :

From: Gerry Wiener (gerry_at_[hidden])
Date: 2003-01-22 12:28:29


The following code compiles and runs correctly when using
gcc2.95. Under gcc3.0.4 the following compilation errors are
generated:

g++-3.0 -c -g -I/home/gerry/include -ftemplate-depth-30 sqrttest.cpp
sqrttest.cpp: In function `int main()':
sqrttest.cpp:18: conversion from
   `blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<double,
   1>, blitz::_bz_sqrt<double> > >' to non-scalar type `blitz::Array<double,
   1>' requested
make: *** [sqrttest.o] Error 1
make: Target `sqrttest' not remade because of errors.

Is there a workaround? (Note: the other unary math functions such as
sin(), etc. produce the same problem.)

Thanks,

        Gerry Wiener Email: gerry_at_[hidden]

------------------------------------------------------------

#include <blitz/array.h>
#include <math.h>

BZ_USING_NAMESPACE(blitz)

int main()
{
    Array<double, 1> var(10);

    var = 0, 1, 2,
        3, 4, 5,
        6, 7, 8,
        9;

    cout << var << endl;

    Array<double, 1> sq = sqrt(var);

    cout << sq << endl;

    return 0;
}