id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
29257 use solve_left for division operation of matrices gh-mwageringel "This ticket improves the `__truediv__` division operation of matrices and vectors by implementing it using `solve_left` (the `_backslash_` operator is already implemented using `solve_right`).
Currently, `__truediv__` only works for square matrices with the same parent. The implementation naively computes the inverse of a matrix, which should be avoided, especially over inexact rings.
With the changes of this ticket (and #12406), the operation works over differing rings and even with non-square matrices.
{{{
sage: a = matrix(ZZ, [[1, 2], [0, 3]])
sage: b = matrix(ZZ, 3, 2, range(6))
sage: b / a == b * ~a
True
sage: a = matrix(ZZ, [[1, 2], [0, 3], [1, 5]])
sage: (b / a) * a == b
True
sage: b = vector(RDF, [1.5, 2.5])
sage: (b / a * a - b).norm() < 1e-14
True
}}}
" defect closed major sage-9.2 linear algebra fixed Markus Wageringel Jonathan Kliem N/A 653849a0ec393a672103560aae9cfc78d398e1d6 653849a0ec393a672103560aae9cfc78d398e1d6 #12406