Skip to content

Commit e2159bc

Browse files
committed
.inv. operator: error stop on issues
1 parent 47ee61a commit e2159bc

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

doc/specs/stdlib_linalg.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ This interface is equivalent to the function version of [[stdlib_linalg(module)
924924

925925
Returns a rank-2 square array with the same type, kind and rank as `a`, that contains the inverse of `a`.
926926

927-
If the matrix is singular or non-square, the operator returns zeros.
927+
Exceptions always trigger an `error stop`.
928928

929929
### Example
930930

src/stdlib_linalg_inverse.fypp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,8 @@ submodule (stdlib_linalg) stdlib_linalg_inverse
154154
!> Result matrix
155155
${rt}$, allocatable :: inva(:,:)
156156

157-
type(linalg_state_type) :: err0
158-
159-
inva = stdlib_linalg_inverse_${ri}$(a,err0)
160-
161-
! On error, return zeros
162-
if (err0%error()) inva = 0.0_${rk}$
157+
! Do not provide an error handler (error stop on issues)
158+
inva = stdlib_linalg_inverse_${ri}$(a)
163159

164160
end function stdlib_linalg_inverse_${ri}$_operator
165161

0 commit comments

Comments
 (0)