Skip to content

Commit 7bf7141

Browse files
committed
Merge branch 'determinant' of github.com:perazz/stdlib into determinant
2 parents 13bd98a + ab030c5 commit 7bf7141

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/stdlib_linalg.fypp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ module stdlib_linalg
229229
!!### Description
230230
!!
231231
!! This interface provides methods for computing the determinant of a matrix.
232-
!! Supported data types include real and complex.
232+
!! Supported data types include `real` and `complex`.
233233
!!
234-
!!@note The provided functions are intended for square matrices.
234+
!!@note The provided functions are intended for square matrices only.
235235
!!
236236
!!### Example
237237
!!

src/stdlib_linalg_determinant.fypp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ submodule (stdlib_linalg) stdlib_linalg_determinant
5454
if (m/=n .or. .not.min(m,n)>=0) then
5555
err0 = linalg_state_type(this,LINALG_VALUE_ERROR,'invalid or non-square matrix: a=[',m,',',n,']')
5656
det = 0.0_${rk}$
57-
goto 1
57+
! Process output and return
58+
call linalg_error_handling(err0)
59+
return
5860
end if
5961

6062
select case (m)
@@ -159,7 +161,9 @@ submodule (stdlib_linalg) stdlib_linalg_determinant
159161
if (m/=n .or. .not.min(m,n)>=0) then
160162
err0 = linalg_state_type(this,LINALG_VALUE_ERROR,'invalid or non-square matrix: a=[',m,',',n,']')
161163
det = 0.0_${rk}$
162-
goto 1
164+
! Process output and return
165+
call linalg_error_handling(err0)
166+
return
163167
end if
164168

165169
! Can A be overwritten? By default, do not overwrite
@@ -186,7 +190,7 @@ submodule (stdlib_linalg) stdlib_linalg_determinant
186190

187191
! Initialize a matrix temporary
188192
if (copy_a) then
189-
allocate(amat(m,n),source=a)
193+
allocate(amat, source=a)
190194
else
191195
amat => a
192196
endif

0 commit comments

Comments
 (0)