Thanks for the advice Dirk,
Kaveh,
If you are having problems with things like matrix indexing I would recommend
a somewhat more incremental approach:
pass a matrix from R, find the maximum element and return it
pass a matrix from R, find the min and maximum elements and return both
multiply two (small) matrices by doing the looping yourself and return
the new matrix
etc pp before trying to port code.
Cheers, Dirk
--
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com