Skip to content

Commit 5677c24

Browse files
authored
Add linalg solve function specification (#115)
* Add solve specification * Remove statement * Update to return an array, rather than a single-element tuple * Update language * Update copy * Update description * Add note regarding broadcast compatibility * Add support for providing an ordinate vector * Update dtype requirements * Update copy * Move API to submodule
1 parent 0768fc8 commit 5677c24

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

spec/API_specification/linear_algebra_functions.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,26 @@ The purpose of this function is to calculate the determinant more accurately whe
322322

323323
Each returned array must have shape `shape(x)[:-2]` and a floating-point data type determined by {ref}`type-promotion`.
324324

325-
(function-solve)=
326-
### solve()
325+
(function-linalg-solve)=
326+
### linalg.solve(x1, x2, /)
327327

328-
TODO
328+
Returns the solution to the system of linear equations represented by the well-determined (i.e., full rank) linear matrix equation `AX = B`.
329+
330+
#### Parameters
331+
332+
- **x1**: _<array>_
333+
334+
- 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.
335+
336+
- **x2**: _<array>_
337+
338+
- ordinate (or "dependent variable") array `B`. If `x2` has shape `(..., M)`, `x2` is equivalent to an array having shape `(..., M, 1)`, and `shape(x2)` must be compatible with `shape(x1)[:-1]` (see {ref}`broadcasting`). If `x2` has shape `(..., M, K)`, each column `k` defines a set of ordinate values for which to compute a solution, and `shape(x2)[:-1]` must be compatible with `shape(x1)[:-1]` (see {ref}`broadcasting`). Should have a floating-point data type.
339+
340+
#### Returns
341+
342+
- **out**: _<array>_
343+
344+
- an array containing the solution to the system `AX = B` for each square matrix. The returned array must have the same shape as `x2` (i.e., the array corresponding to `B`) and must have a floating-point data type determined by {ref}`type-promotion`.
329345

330346
(function-svd)=
331347
### svd()

0 commit comments

Comments
 (0)