SciRuby / nmatrix

Dense and sparse linear algebra library for Ruby via SciRuby
Other
469 stars 133 forks source link

Concatenate matrices by specifying them in an Array #611

Open v0dro opened 6 years ago

v0dro commented 6 years ago

Something like this:

NMatrix.concat([
  [a_nm, b_nm],
  [c_nm, d_nm]
])
translunar commented 6 years ago

So, like hstack/vstack in Numpy? I'm shocked we don't have this, but I can't find it in the code. It ought to be a pretty easy addition.

v0dro commented 6 years ago

We have hconcat and vconcat but its kind of counter intuitive to concatenate when you think of it that way. The easiest way I've come across is the Matlab notation which I think would reflect in nmatrix via this feature.

translunar commented 6 years ago

We should probably also see about aliasing the concat functions to hstack and vstack.