Skip to content

Commit 64c4c58

Browse files
authored
Add notes concerning input array validation (#302)
1 parent 8460552 commit 64c4c58

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

spec/extensions/linear_algebra_functions.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ Returns the lower (upper) Cholesky decomposition x = LLᵀ (x = UᵀU) of a symm
8282

8383
<!-- NOTE: once complex numbers are supported, each square matrix must be Hermitian. -->
8484

85+
```{note}
86+
Whether an array library explicitly checks whether an input array is a symmetric positive-definite matrix (or a stack of matrices) is implementation-defined.
87+
```
88+
8589
#### Parameters
8690

8791
- **x**: _&lt;array&gt;_
@@ -170,10 +174,18 @@ Returns the specified diagonals of a matrix (or a stack of matrices) `x`.
170174
(function-linalg-eigh)=
171175
### linalg.eigh(x, /)
172176

177+
```{note}
178+
The function `eig` will be added in a future version of the specification, as it requires complex number support.
179+
```
180+
173181
Returns an eigendecomposition x = QLQᵀ of a symmetric matrix (or a stack of symmetric matrices) `x`, where `Q` is an orthogonal matrix (or a stack of matrices) and `L` is a vector (or a stack of vectors).
174182

175183
<!-- NOTE: once complex number support, each matrix must be Hermitian and the returned Q unitary. We might also want to make the dtype of `eigenvalues` unconditionally real -->
176184

185+
```{note}
186+
Whether an array library explicitly checks whether an input array is a symmetric matrix (or a stack of symmetric matrices) is implementation-defined.
187+
```
188+
177189
#### Parameters
178190

179191
- **x**: _&lt;array&gt;_
@@ -195,18 +207,21 @@ Returns an eigendecomposition x = QLQᵀ of a symmetric matrix (or a stack of sy
195207
Eigenvalue sort order is left unspecified.
196208
```
197209

198-
```{note}
199-
The function `eig` will be added in a future version of the specification,
200-
as it requires complex number support.
201-
```
202-
203210
(function-linalg-eigvalsh)=
204211
### linalg.eigvalsh(x, /)
205212

213+
```{note}
214+
The function `eigvals` will be added in a future version of the specification, as it requires complex number support.
215+
```
216+
206217
Returns the eigenvalues of a symmetric matrix (or a stack of symmetric matrices) `x`.
207218

208219
<!-- NOTE: once complex number support, each matrix must be Hermitian -->
209220

221+
```{note}
222+
Whether an array library explicitly checks whether an input array is a symmetric matrix (or a stack of symmetric matrices) is implementation-defined.
223+
```
224+
210225
#### Parameters
211226

212227
- **x**: _&lt;array&gt;_
@@ -223,11 +238,6 @@ Returns the eigenvalues of a symmetric matrix (or a stack of symmetric matrices)
223238
Eigenvalue sort order is left unspecified.
224239
```
225240

226-
```{note}
227-
The function `eigvals` will be added in a future version of the specification,
228-
as it requires complex number support.
229-
```
230-
231241
(function-linalg-inv)=
232242
### linalg.inv(x, /)
233243

@@ -395,11 +405,15 @@ Returns the (Moore-Penrose) pseudo-inverse of a matrix (or a stack of matrices)
395405

396406
Returns the qr decomposition x = QR of a full column rank matrix (or a stack of matrices), where `Q` is an orthonormal matrix (or a stack of matrices) and `R` is an upper-triangular matrix (or a stack of matrices).
397407

408+
```{note}
409+
Whether an array library explicitly checks whether an input array is a full column rank matrix (or a stack of full column rank matrices) is implementation-defined.
410+
```
411+
398412
#### Parameters
399413

400414
- **x**: _&lt;array&gt;_
401415

402-
- input array having shape `(..., M, N)` and whose innermost two dimensions form `MxN` matrices of rank equal to `N`. Should have a floating-point data type.
416+
- input array having shape `(..., M, N)` and whose innermost two dimensions form `MxN` matrices of rank `N`. Should have a floating-point data type.
403417

404418
- **mode**: _Literal\[ 'reduced', 'complete' ]_
405419

@@ -454,6 +468,10 @@ The purpose of this function is to calculate the determinant more accurately whe
454468

455469
Returns the solution to the system of linear equations represented by the well-determined (i.e., full rank) linear matrix equation `AX = B`.
456470

471+
```{note}
472+
Whether an array library explicitly checks whether an input array is full rank is implementation-defined.
473+
```
474+
457475
#### Parameters
458476

459477
- **x1**: _&lt;array&gt;_

0 commit comments

Comments
 (0)