[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
proposed implementation of interpn
From: |
Alexander Barth |
Subject: |
proposed implementation of interpn |
Date: |
Thu, 8 Feb 2007 18:19:07 -0500 |
Hi all,
I wrote an implementation of interpn for n-dimensional interpolation.
It supports only linear interpolation. I tweaked the C/C++ code to
optimize the speed and it runs now pretty fast.
For large problems (see benchmark_interpn.m) it is about 9 - 10 times
faster than matlab R2006a (on an AMD opteron; both binaries are
64-bit). OK, I didn't check if matlab's interpn is implemented as a
script. This is probably the case and explains the difference in
speed.
$ octave -q benchmark_interpn.m
Elapsed time is 0.523849 seconds.
ans = 0.25853
$ matlab64 < benchmark_interpn.m
Elapsed time is 5.527463 seconds.
ans =
0.2585
I noticed also that C-arrays can be significantly faster than octave's
NDArray. Does NDArray performs bound-checking per default?
Cheers,
Alex
benchmark_interpn.m
Description: Text Data
interpn.cc
Description: Text Data
- proposed implementation of interpn,
Alexander Barth <=