Closed gilgamec closed 4 years ago
@gilgamec what do you suggest then ? Would it be more convenient for the end user if we force her user to specify everything in column-major order ?
I think it might be good to support both, tbh. Row / Column-oriented interfaces for all of the smart constructors, that is.
https://github.com/arrayfire/arrayfire-haskell/pull/37
@gilgamec this should provide a fix so that matrix
can be used correctly.
example shown below:
> A.matrix (3,2) [[1,2,3],[4,5,6]]
ArrayFire Array
[3 2 1 1]
1.0000 4.0000
2.0000 5.0000
3.0000 6.0000
@gilgamec this should be fixed, please re-open if you think otherwise.
we're converging upon Array perfection.
This was mentioned in #22, but I'll make an Issue for it here. The data provided to the smart constructors
matrix
,cube
, andtensor
is validated (in terms of row and column sizes) in row-major order, but the constructors all flatten the input lists and usemkArray
, which enters the data in the column-major order. This leads to, first, properly arranged rows and columns being invalid:and, second, if the input lists are transposed so they validate OK, the data in the Array doesn't even follow the rows and columns provided: