Feature #10073
closed
[PATCH] Implement Laplace expansion for matrix.
Added by gogotanaka (Kazuki Tanaka) over 10 years ago.
Updated about 10 years ago.
Description
Laplace expansion has really important mathematical property.
We can handle many thing with this (determinant, cross product)
So I'm confident that this method is necessary.
But I recognize Ruby should be not for mathematician but rubyist.
Ruby doesn't need too academic method.
So If you think it is too academic you can ignore my patches.
gogo.
Files
For all n * n matrix m, k <- {1, 2, ..., n}.
m.laplace_expansion(k-1, :row) == m.laplace_expansion(k-1, :column) == m.det
It is important when we think about values contains not Scalar, like that.
Matrix[[Vector[1, 0], Vector[0, 1]], [2, 3]].laplace_expansion(0, :row)
=> Vector[3, -2]
And, this patch is needed in https://bugs.ruby-lang.org/issues/10074.
gogo.
- Category set to lib
- Assignee set to marcandre (Marc-Andre Lafortune)
- Target version set to 2.2.0
- Status changed from Open to Assigned
Looks good.
I'd change the interface slightly so we can call it with named parameters instead:
m.laplace_expansion(row: k-1) == m.laplace_expansion(column: k-1) == m.det
Of course, m.laplace_expansion or m.laplace_expansion(row: 0, column: 0) would raise errors.
@gogo tanaka: what do you think about this?
@Marc-Andre Lafortune
Thank you very much for responding.
m.laplace_expansion(row: k-1) == m.laplace_expansion(column: k-1) == m.det
The interface you suggested is really make sense for me.
OK, Let me handle this.
Just to be clear: you'd like me to wait for an updated patch, or should I make the small changes myself?
Sorry, I should make that be clear.
OK, I'll update patch. Please wait for some time.
@Marc-Andre Lafortune
Thank you for your great proposal.
- Status changed from Assigned to Closed
Great, thanks for the updated patch.
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0