Marc-Andre Lafortune wrote: > Hi, sorry I missed your proposal until now, and thanks for the patch. > ... No worries! Thanks for taking a look. Matrix#zip is useful for simply implementing any binary (or n-ary) operation on matrices...LitoNico (Lito Nicolai)
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 =...LitoNico (Lito Nicolai)
Hello! Are there any further thoughts or consensus on which path to take with this? Here are the options: 1. When dividing matrices, if the resulting matrix has any rational numbers in it, it is entirely rational numbers-- even if ...LitoNico (Lito Nicolai)
Marc-Andre Lafortune wrote: > Interesting. > ... In the Matrix class, scalar divison is implemented by using the usual `/` operation, which loses precision on `Integer`s but not on `Rational`s. If the Matrix is a mix of the two, some...LitoNico (Lito Nicolai)
Currently, Matrix#inverse returns a matrix of Rationals, even when each element has a denominator of 1. This leads to > x = Matrix.identity 3 => Matrix[[1, 0, 0], [0, 1, 0], [0, 0, 1]] > ...LitoNico (Lito Nicolai)