solve¶
- solve(x1: array, x2: array, /) array ¶
Returns the solution to the system of linear equations represented by the well-determined (i.e., full rank) linear matrix equation
AX = B
.Note
Whether an array library explicitly checks whether an input array is full rank is implementation-defined.
- Parameters:
x1 (array) – coefficient array
A
having shape(..., M, M)
and whose innermost two dimensions form square matrices. Must be of full rank (i.e., all rows or, equivalently, columns must be linearly independent). Should have a floating-point data type.x2 (array) – ordinate (or “dependent variable”) array
B
. Ifx2
has shape(M,)
,x2
is equivalent to an array having shape(..., M, 1)
. Ifx2
has shape(..., M, K)
, each columnk
defines a set of ordinate values for which to compute a solution, andshape(x2)[:-1]
must be compatible withshape(x1)[:-1]
(see Broadcasting). Should have a floating-point data type.
- Returns:
out (array) – an array containing the solution to the system
AX = B
for each square matrix. The returned array must have the same shape asx2
(i.e., the array corresponding toB
) and must have a floating-point data type determined by Type Promotion Rules.