Project

General

Profile

Actions

Feature #10077

closed

[PATCH] Implement Matrix#row_merge and Matrix#column_merge

Added by gogotanaka (Kazuki Tanaka) over 10 years ago. Updated about 10 years ago.

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

Description

Merge matrices horizontally and vertically.

It is useful and important when we handle linear equations, statistics and so on.

Matrix[[1, 2], [3, 4]].row_merge(Matrix[[5], [6]])

  => 1 2 5
     3 4 6

Matrix[[1, 2], [3, 4]].column_merge(Matrix[[5, 6]])

  => 1 2
     3 4
     5 6

# accept more than two matrices as an argument.

Matrix[[1, 2], [3, 4]].column_merge(Matrix[[5, 6]], Matrix[[7, 8]])

  => 1 2
     3 4
     5 6
     7 8
  • Matrix#row_merge needs Matrix#column

Files

Implement_Matrix#column_merge.patch (863 Bytes) Implement_Matrix#column_merge.patch gogotanaka (Kazuki Tanaka), 07/21/2014 02:51 AM
Add_test_for_Matrix#column_merge.patch (1.36 KB) Add_test_for_Matrix#column_merge.patch gogotanaka (Kazuki Tanaka), 07/21/2014 02:51 AM
Add_Matrix#column_merge_to_NEWS.patch (452 Bytes) Add_Matrix#column_merge_to_NEWS.patch gogotanaka (Kazuki Tanaka), 07/21/2014 02:51 AM
Implement_Matrix#row_merge.patch (899 Bytes) Implement_Matrix#row_merge.patch gogotanaka (Kazuki Tanaka), 07/21/2014 02:52 AM
Add_test_for_Matrix#row_merge.patch (1.4 KB) Add_test_for_Matrix#row_merge.patch gogotanaka (Kazuki Tanaka), 07/21/2014 02:52 AM
Add_Matrix#row_merge_to_NEWS.patch (523 Bytes) Add_Matrix#row_merge_to_NEWS.patch gogotanaka (Kazuki Tanaka), 07/21/2014 02:52 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0