Blitz logo

Blitz Devel :

From: Todd Veldhuizen (tveldhui_at_[hidden])
Date: 1998-07-26 10:02:27


> I would appreciate a lot if someone could give a hint in
> how to solve the following problem. In the example I give
> below I succeded to compile the program till I got the
> expression ["a= sum(A(Range(0, 5))*A(Range(10,15)));"] and
> put it in a function then I couldn't compile any more my
> example.
> Am I forgetting anything?

It's a const problem. Blitz++ is a little brain dead about
const right now. Try omitting the const from the frame
parameter of autoCorr.

I'll put this on my todo.

Cheers,
Todd

> void autoCorr(const blitz::Array<float, 1>& frame,
> int n_point, blitz::Array<float, 1>& coef)
> {
> using namespace blitz;
>
> coef.resize(n_point);
> for(int n= 0, l= frame.size() - 1; n < n_point; ++n)
> coef(n)= sum(frame(Range(0, l-n)) * frame(Range(n, l)));
> }

>
>
> /* ----------------------------- Compile Error Message ----------
>
> "teste.cc", line 32: error: no instance of overloaded function
> "blitz::Array<float, 1>::operator()" matches the argument list
> argument types are: (blitz::Range)
> coef(n)= sum(frame(Range(0, l-n)) * frame(Range(n, l)));

--------------------- blitz-dev list --------------------------------
* To subscribe/unsubscribe: mail to majordomo_at_[hidden], with
"subscribe blitz-dev" or "unsubscribe blitz-dev" in the body of the message
* Blitz++ web page: http://oonumerics.org/blitz/