arrayfire / arrayfire-haskell

Haskell bindings to ArrayFire
http://hackage.haskell.org/package/arrayfire
BSD 3-Clause "New" or "Revised" License
59 stars 5 forks source link

How to generate an array according to the rules defined by oneself? #53

Open wujilingfeng opened 1 year ago

wujilingfeng commented 1 year ago

How to generate an array according to the rules defined by oneself? I have a function like func:: Int->Int->Float, which represents calculating values based on index

chessai commented 1 year ago

Right now, I think you would need to combine Data.Vector.generate, Data.Vector.toList, and eg ArrayFire.Array.matrix.

The construction API could definitely be expanded