Fork me on GitHub
#uncomplicate
<
2018-07-02
>
aaelony17:07:19

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?

blueberry19:07:29

@aaelony:order was renamed to :layout several versions ago. Is there any place in the documentation or tutorials that I forgot to update?

aaelony19:07:45

I was rereading your blogs and saw it there

blueberry20:07:00

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.

blueberry20:07:40

That link says :layout if I see well

blueberry20:07:45

which is correct

aaelony20:07:19

you're correct. I think it was only the blog posts

blueberry20:07:28

Whenever you are unsure, tests are very detailed, so you can try there.

blueberry20:07:58

Please open issue if you see :order in the wild, so I can update the blog posts too.

aaelony20:07:02

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
   ┗                       ┛

aaelony20:07:29

just the invocation

aaelony20:07:06

in any case, I'll use :layout going forward. Thanks 🙂

blueberry20:07:09

Thank you. I updated the blog posts.

blueberry20:07:35

@aaelony Thank you. Please report any issues or improvement ideas that you might have.

aaelony20:07:46

@blueberry Will do. Thank-you for such an excellent library!