OllieB
OllieB

Reputation: 1431

Yarr slice usage

I've been exploring the Data.Yarr Array library, as a possible replacement for some code I have in Repa. It seems fully featured, and the benchmarks - if correct suggest a performance improvement may be had.

I'm interested in the correct use of the slices function.

Say I had a 2D ForeignPtr backed matrix of Complex Floats, in row-major format

matrix2D :: UArray F L DIM2 (Complex Float)

How would I go about extracting a vector of slices of columns, and / or rows?

A motivating example? Lets say I wish to permute the columns, multiply each element wise with another set of slices, then perform a 1D FFT on each slice.

This seems a very common thing to want to do (in my world of signal processing). What is the idiomatic way of doing this?

Edited: to reduce scope of question.

Upvotes: 1

Views: 55

Answers (1)

idontgetoutmuch
idontgetoutmuch

Reputation: 1621

I maintain yarr but sadly I only have intermittent access to the Internet for the next few weeks. I did write this comparison of yarr and repa some time ago: https://idontgetoutmuch.wordpress.com/2013/08/06/planetary-simulation-with-excursions-in-symplectic-manifolds-6/. I am surprised that you can't do slices with yarr without type coercion. I will try and take a look over the next few days.

Upvotes: 1

Related Questions