Opened 13 years ago

Closed 12 years ago

#21 closed enhancement (fixed)

Nicer syntax for taking subarrays

Reported by: Ben Lippmeier Owned by:
Priority: blocker Milestone: 3.0.0
Component: algorithms Version: 2.0.0.3
Keywords: Cc:

Description

A few people have asked how to take sub-matrices. This is an index transformation that's easy to specify, but there should be a nice wrapper for it. We could make a shape polymorphic version using addIndex to add the starting offset.

let arr = fromList (Z :. (5 :: Int)) [1, 2, 3, 4, 5 :: Int] 
in  fromFunction (Z :. 3) (\(Z :. ix) -> arr ! (Z :. ix + 1))

Change History (3)

comment:1 Changed 13 years ago by Ben Lippmeier

Type: defectenhancement

comment:2 Changed 13 years ago by Ben Lippmeier

Milestone: 3.0.0

comment:3 Changed 12 years ago by Ben Lippmeier

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.