[OF miscellaneous] changes to hilbert curve and new functions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OF miscellaneous] changes to hilbert curve and new functions

JuanPi
Hi all,

* New functions:
- I added a new function to miscellaneous: idxmatrix.m[1]. It
generates a matrix with elements indicating their own position
(subindexes) in the matrix, i.e. M(i,j) = i * 10 + j
I use it quite a lot in preparing educational material, specially when
explaining functions like reshape, transpose, permute, etc.
Let me know if you have comments or suggestions for improvements.

- I added a function to convert a Hilbert curve to linear matrix
indexes: hc2ind.m [2]

- I added the usual Makefile to help with the maintenance.

* Changes to Hilbert curve:
I have improved the performance of the recursive function generating
pseudo Hilbert curves: hilbert_curve.m [3].
I encapsulated the recursion to avoid input checking at each level and
removed calls to helper functions. In my machine I got about 3x
speed-up
See mail "[OF miscellaneous] Hilbert curve: recursion faster than
loop?" for discussion.

I think it is time to make a new release of the package. 1.3.0?

[1]: https://sourceforge.net/p/octave/miscellaneous/ci/default/tree/inst/idxmatrix.m
[2]: https://sourceforge.net/p/octave/miscellaneous/ci/default/tree/inst/hc2ind.m
[3]: https://sourceforge.net/p/octave/miscellaneous/ci/default/tree/inst/hilbert_curve.m
--
JuanPi Carbajal
https://goo.gl/ayiJzi
Public GnuPG key: 9C5B72BF
-----
"Why is thought, being a secretion of the brain, more wonderful than
gravity, a property of matter?"
- C. Darwin