narray icon indicating copy to clipboard operation
narray copied to clipboard

more general cumsum and a 'tile' (repmat) method

Open jdleesmiller opened this issue 14 years ago • 0 comments

I've added two NArray methods that might be of interest:

  1. 'cumsum' for arrays with more than one dimension; the existing version only works for vectors. The new cumsum! calls the old cumsum! if dim is 1, so there should be minimal impact. Commit: 99b798d1

  2. a 'tile' method that behaves mostly like matlab's 'repmat,' which is useful for creating block matrices. Commits: ea8c7f04, cbdcdc3e

The methods are written in Ruby (not C yet). Unit tests are included; they use the standard Test::Unit, which the existing tests don't use, so I've added test/unit_tests to run just the new tests. I'm not sure what the best way to set this up is.

Commits 4e3f8da3 and b4e27983 are my mistakes, and they can be ignored; they are undone by 435ba766.

If you have any questions, don't hesitate to ask. Comments very welcome.

And thanks for putting together this great library!

jdleesmiller avatar Apr 25 '11 22:04 jdleesmiller