kigubkur.dig.order

Dig into a kigubkur© matrix (or block) by getting its order (m × n).

(require '[kigubkur.dig [order :refer [order]]])

Examples

=> (def r [[1 2 3 4]])
=> (def c [[1][2][3][4]])
=> (def M [[1 2] [3 4]])
=> (def L [[1 2 3 4 5 6 7 8 9 10]
           [1 2 3 4 5 6 7 8 9 10]
           [1 2 3 4 5 6 7 8 9 10]
           [1 2 3 4 5 6 7 8 9 10]
           [1 2 3 4 5 6 7 8 9 10]
           [1 2 3 4 5 6 7 8 9 10]
           [1 2 3 4 5 6 7 8 9 10]])
=> (def B (block L 5))
=> (order r)
[1 4]
=> (order c)
[4 1]
=> (order M]
[2 2]
=> (order L)
[7 10]
=> (order B)
[[2 2][7 10]]

Note that order of a block always returns a matrix of 2 × 2 such that the first row represents the order of the block (number of row blocks × number of keys in a row i.e. no. of column blocks) while the second row is the order of the mother (unblocked) matrix. Also, note that the order of a single element matrix is always 1 × 1.

=> (order [[47]])
[1 1]

order

(order X)

Order function returns a clojure vector of two elements.

Syntax return for matrix X return for block X
(order X) [m n] [[m_block n_block] [m n]]