Project

General

Profile

Actions

Feature #10903

closed

[PATCH] Matrix#zip returns a matrix

Added by LitoNico (Lito Nicolai) almost 10 years ago. Updated about 7 years ago.

Status:
Closed
Target version:
-
[ruby-core:68293]

Description

Currently:
> x = Matrix.I 2
> x.zip x
=> [[1, 1], [0, 0], [0, 0], [1, 1]] # It's an array!

With the patch:
> x.zip x
=> Matrix[[1, 1], [0, 0], [0, 0], [1, 1]]

And also:
> x.zip x, x # and so on
=> Matrix[[1, 1, 1], [0, 0, 0], [0, 0, 0], [1, 1, 1]]


Files

matrix_zip.patch (1.42 KB) matrix_zip.patch LitoNico (Lito Nicolai), 02/25/2015 04:43 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0