I'm probably misunderstanding what the values of the :order
keyword mean.
(def A (dge 3 2 [1 2 3 4 5 6] {:order :column}))
(def B (dge 3 2 [1 2 3 4 5 6] {:order :row}))
(= A B) => true
despite the :order
option being differently specified, A and B are the same? The doc string for ge
says that the "internal structure can be specified with a map of options: :layout (:column or :row)." How can they be equivalent if the internal structure is different?@aaelony:order was renamed to :layout several versions ago. Is there any place in the documentation or tutorials that I forgot to update?
I was rereading your blogs and saw it there
BTW even when you specify that with :layout, neanderthal checks for equality of all elements, taking layout into account. Matrices with same elements should be equal.
perhaps also https://neanderthal.uncomplicate.org/codox/uncomplicate.neanderthal.core.html#var-ge
That link says :layout if I see well
which is correct
you're correct. I think it was only the blog posts
Whenever you are unsure, tests are very detailed, so you can try there.
Please open issue if you see :order in the wild, so I can update the blog posts too.
understood. e.g. https://dragan.rocks/articles/17/Clojure-Numerics-1-Use-Matrices-Efficiently
This created a dense 3×2 column-oriented matrix. Notice how the 1-d Clojure sequence that we used as data source has been read column-by-column.
The other option is row orientation:
(dge 3 2 [1 2 3 4 5 6] {:order :row})
#RealGEMatrix[double, mxn:3x2, layout:column, offset:0]
▥ ↓ ↓ ┓
→ 1.00 4.00
→ 2.00 5.00
→ 3.00 6.00
┗ ┛
just the invocation
in any case, I'll use :layout
going forward. Thanks 🙂
Thank you. I updated the blog posts.
@aaelony Thank you. Please report any issues or improvement ideas that you might have.
@blueberry Will do. Thank-you for such an excellent library!