Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 21b9712

Browse files
committed
Trac #4932: remove solve_left_LU for matrices
1 parent a4ea588 commit 21b9712

File tree

1 file changed

+0
-64
lines changed

1 file changed

+0
-64
lines changed

src/sage/matrix/matrix_double_dense.pyx

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,70 +1619,6 @@ cdef class Matrix_double_dense(matrix_dense.Matrix_dense):
16191619

16201620
eigenvectors_right = right_eigenvectors
16211621

1622-
def solve_left_LU(self, b):
1623-
"""
1624-
Solve the equation `A x = b` using LU decomposition.
1625-
1626-
.. WARNING::
1627-
1628-
This function is broken. See trac 4932.
1629-
1630-
INPUT:
1631-
1632-
- self -- an invertible matrix
1633-
- b -- a vector
1634-
1635-
.. NOTE::
1636-
1637-
This method precomputes and stores the LU decomposition
1638-
before solving. If many equations of the form Ax=b need to be
1639-
solved for a singe matrix A, then this method should be used
1640-
instead of solve. The first time this method is called it will
1641-
compute the LU decomposition. If the matrix has not changed
1642-
then subsequent calls will be very fast as the precomputed LU
1643-
decomposition will be reused.
1644-
1645-
EXAMPLES::
1646-
1647-
sage: A = matrix(RDF, 3,3, [1,2,5,7.6,2.3,1,1,2,-1]); A
1648-
[ 1.0 2.0 5.0]
1649-
[ 7.6 2.3 1.0]
1650-
[ 1.0 2.0 -1.0]
1651-
sage: b = vector(RDF,[1,2,3])
1652-
sage: x = A.solve_left_LU(b); x
1653-
Traceback (most recent call last):
1654-
...
1655-
NotImplementedError: this function is not finished (see trac 4932)
1656-
1657-
1658-
TESTS:
1659-
1660-
We test two degenerate cases::
1661-
1662-
sage: A = matrix(RDF, 0, 3, [])
1663-
sage: A.solve_left_LU(vector(RDF,[]))
1664-
(0.0, 0.0, 0.0)
1665-
sage: A = matrix(RDF, 3, 0, [])
1666-
sage: A.solve_left_LU(vector(RDF,3, [1,2,3]))
1667-
()
1668-
1669-
"""
1670-
if self._nrows != b.degree():
1671-
raise ValueError("number of rows of self must equal degree of b")
1672-
if self._nrows == 0 or self._ncols == 0:
1673-
return self._row_ambient_module().zero_vector()
1674-
1675-
raise NotImplementedError("this function is not finished (see trac 4932)")
1676-
self._c_compute_LU() # so self._L_M and self._U_M are defined below.
1677-
cdef Matrix_double_dense M = self._new()
1678-
lu = self._L_M*self._U_M
1679-
global scipy
1680-
if scipy is None:
1681-
import scipy
1682-
import scipy.linalg
1683-
M._matrix_numpy = scipy.linalg.lu_solve((lu, self._P_M), b)
1684-
return M
1685-
16861622
def solve_right(self, b):
16871623
r"""
16881624
Solve the vector equation ``A*x = b`` for a nonsingular ``A``.

0 commit comments

Comments
 (0)