more general cumsum and a 'tile' (repmat) method #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've added two NArray methods that might be of interest:
'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: 99b798d
a 'tile' method that behaves mostly like matlab's 'repmat,' which is useful for creating block matrices.
Commits: ea8c7f0, cbdcdc3
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 4e3f8da and b4e2798 are my mistakes, and they can be ignored; they are undone by 435ba76.
If you have any questions, don't hesitate to ask. Comments very welcome.
And thanks for putting together this great library!