[#688] mkmf.rb - add files to clean and distclean targets — Michal Rokos <michal@...>

Hi,

25 messages 2003/01/15
[#722] Re: [RFC] mkmf.rb - add files to clean and distclean targets — Mathieu Bouchard <matju@...> 2003/01/20

On Thu, 16 Jan 2003, Michal Rokos wrote:

[#740] Re: [RFC] mkmf.rb - add files to clean and distclean targets — matz@... (Yukihiro Matsumoto) 2003/01/21

Hi,

[#724] Symbols: More Functionality Wanted — Ryan Pavlik <rpav@...>

I've been discussing this for a bit on #ruby-lang on OPN (or freenode or

23 messages 2003/01/20
[#728] Re: Symbols: More Functionality Wanted — matz@... (Yukihiro Matsumoto) 2003/01/20

Hi,

[#743] Re: Symbols: More Functionality Wanted — "Pit Capitain" <pit@...> 2003/01/21

On 20 Jan 2003 at 15:49, Yukihiro Matsumoto wrote:

[#767] Re: Symbols: More Functionality Wanted — Mathieu Bouchard <matju@...> 2003/01/22

[#768] Re: Symbols: More Functionality Wanted — dblack@... 2003/01/22

Hi --

[#779] Re: Symbols: More Functionality Wanted — Gavin Sinclair <gsinclair@...> 2003/01/23

On Thursday, January 23, 2003, 6:28:04 AM, dblack wrote:

Re: Comments on matrix.rb

From: Mathieu Bouchard <matju@...>
Date: 2003-01-20 22:47:51 UTC
List: ruby-core #736
On Mon, 20 Jan 2003, Gavin Sinclair wrote:
>  - #slice would be a good alias for #minor

The problem with #minor is that it's not a minor, it's a slice.

A minor is a submatrix such that only one row and one column are missing.
The #minor operation allows only 4 possible minors, out of 2*N, and allows
lots of things that are not minors.

>  - Matrix#diagonalize() should return a [M:Matrix,D:Matrix] pair such that
>    M*D*M.inverse == self
>  - ** is too slow.  Using matrix diagonalisation is a more efficient algorithm
>    and works for all exponents, not just positive integers.  Here is a more
>    efficient **
>            def ** n
>                 m, d = diagonalize
>                 (0...d.row_size).each { |i| d[i,i] **= n }
>                 (m * d * m).inverse
>            end

This is not the code I gave you. I wrote m*d*m.inverse, not
(m*d*m).inverse; the parentheses make a big difference.

Also: I made a mistake. Some matrices are not diagonalizable, so there
should be a fallback to another algorithm. That one can be the existing
one, running in O(k*n**3), or it can be a new one, running in
O(log(k)*n**3), following the same pattern as the implementation of
Bignum#**.

(of course those O() marks are slightly wrong, as they depend on the speed
of a lot of other methods that may or may not run in their assumed times)

>  - #r should be something more normal, like #modulus (with #r an alias)

#abs is good, especially because (x-y).abs on vectors is a metric.
(see http://mathworld.wolfram.com/Metric.html)

However it wouldn't be good to think of a matrix determinant as an
absolute value, despite mathematicians using the same notation... one
reason is that a det can be negative, while abs's are expected not to.

________________________________________________________________
Mathieu Bouchard                       http://artengine.ca/matju


In This Thread