rulinalg icon indicating copy to clipboard operation
rulinalg copied to clipboard

Adding a slice equivalent for `Vector`.

Open AtheMathmo opened this issue 9 years ago • 0 comments
trafficstars

It would be good to add a slicing equivalent for Vector (similar to MatrixSlice for Matrix).

For Vector we can probably do this in a nicer way than Matrix. We can implement a fat pointer type to represent the underlying data in a Vector - and then implement the relevant methods on a reference to this type (similar to the Vec - &[T] relationship in std).

Using Deref/Borrow/AsRef we can cut down on code by implementing all functions taking &self on the VectorSlice type.

It would be acceptable to simply mirror the current behaviour for matrices - but we should try to get the above working.

AtheMathmo avatar Aug 04 '16 00:08 AtheMathmo