Hi Andreas,

thanks for your response. I'd like to know, whether you are able to run the square.py example. I'm just wondering, because you told me, maybe I am not feeding hedge with the right date types. But I am not feeding anything, I am just trying to run the square.py example and then this error comes up.
I took your advice and debugged the square script and all arguments of arg were of type numpy array float 64, except the first two of them, which were something like uniform element or something.
I even reinstalled hedge and took another version of boost, but it still does't work out.
I'm stuck and I really need help to move on with my calculations. Thanks

regards,
Islam

PS: I think I might found a mistake in square.py. make_box returns 4 variables but there are only 3 given to accept the transferparameter in line 45. When I remove one return value in make_box, it works and no error message shows up.

-------- Original-Nachricht --------
Datum: Tue, 18 Jan 2011 13:04:21 -0500
Von: Andreas Kloeckner <kloeckner@cims.nyu.edu>
An: Islam El Salawi <islamelsalawi@gmx.de>, hedge@tiker.net
Betreff: Re: [Hedge] python c++ mismatch

Hi Islam,

apologies for the long wait.

On Wed, 12 Jan 2011 11:24:30 +0100, "Islam El Salawi" <islamelsalawi@gmx.de> wrote:
> first I wish you all a happy new year.
> I tried to run the square.py example and received the following error
> message:
>
> 4020 elements
> [snip]
>   File "/home/elsalawi/src/hedge/hedge/tools/flops.py", line 32, in
> wrapped_f
>     return func(*args, **kwargs)
> Boost.Python.ArgumentError: Python argument types in
>    
> codepy.temp.b7d05f40fbebe2e37390364ffd0cadd4.module.diff(UniformElementRanges,
> UniformElementRanges, numpy.ndarray, numpy.ndarray, numpy.ndarray,
> numpy.ndarray, numpy.ndarray)
> did not match C++ signature:
>     diff(hedge::uniform_element_ranges, hedge::uniform_element_ranges,
> pyublas::numpy_array<double>, boost::numeric::ublas::matrix<double,
> boost::numeric::ublas::basic_row_major<unsigned long, long>,
> boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >,
> boost::numeric::ublas::matrix<double,
> boost::numeric::ublas::basic_row_major<unsigned long, long>,
> boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >,
> pyublas::numpy_array<double>, pyublas::numpy_array<double>)

What the error means is that the arguments being passed to a
just-in-time compiled function don't have the right types. In this case,
it's pretty likely that it's a mismatch with respect to the floating
point type--say single vs. double precision.

Please check that all the data you are feeding hedge is in double
precision--in particular the initial conditions. Failing that, run the
code in a debugger and examine the 'args' array at the failing call
site. (flops.py: 32) You should check which of the 'args' is a numpy
array, and in turn which of the numpy arrays have a dtype that doesn't
match the function signature in the error message (look for float32
instead of float64, say).

If you need a Python debugger, I'd recommend PuDB [1].

Hope this helps,
Andreas

[1] http://pypi.python.org/pypi/pudb

--
Andreas Kloeckner
Room 1311 (Warren Weaver Hall), Courant Institute, NYU
http://www.cims.nyu.edu/~kloeckner/
+1-401-648-059



--
NEU: FreePhone - kostenlos mobil telefonieren und surfen!
Jetzt informieren: http://www.gmx.net/de/go/freephone