![](https://secure.gravatar.com/avatar/af6c39d6943bd4b0e1fde23161e7bb8c.jpg?s=120&d=mm&r=g)
17 Nov
2007
17 Nov
'07
6:13 p.m.
On Sat, Nov 17, 2007 at 04:44:52PM -0600, Alan Jackson wrote:
On Sat, 17 Nov 2007 22:46:59 +0100 Well, with my *real* code, blitz gave me several pages of errors - I tried treating the 2D arrays as a 1D array, doing all the index arithmetic myself, and that seems to work. Which strikes me as odd...
With Blitz, you are allowed M(i,j) indexing. Otherwise, only the memory address of the data is passed and, as you noticed, you must calculate the offset yourself, i.e. M[i*nr_cols + j]. I modified your code to work with ctypes, which you may find interesting. Use python setup.py build_ext -i to build the C file. Then run alan.py. Cheers Stéfan