Implementing kernel
C++ engine symbols that back this Python API.Solve a square linear system .
Returns the unique solution of the system
where is a non-singular square matrix. The system is solved by LU decomposition with partial pivoting, which is both faster and more accurate than forming explicitly.
Parameters
Returns
TensorSolution with the same shape as b.
Notes
Algorithm: factor , then perform forward-substitution followed by back-substitution . Total cost is .
Examples
>>> import lucid
>>> from lucid.linalg import solve
>>> A = lucid.tensor([[3.0, 1.0], [1.0, 2.0]])
>>> b = lucid.tensor([9.0, 8.0])
>>> solve(A, b)
Tensor([2.0000, 3.0000])