Opened 7 years ago

Closed 6 years ago

#21 closed enhancement (fixed)

Nicer syntax for taking subarrays

Reported by: benl 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 7 years ago by benl

  • Type changed from defect to enhancement

comment:2 Changed 6 years ago by benl

  • Milestone set to 3.0.0

comment:3 Changed 6 years ago by benl

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.