File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change 24
24
return vecdot (x0, cross (x1, x2))
25
25
end
26
26
27
- @generated function _det {S,T } (:: Size{S} , A:: StaticMatrix{T} )
27
+ @generated function _det {S} (:: Size{S} , A:: StaticMatrix )
28
28
if S[1 ] != S[2 ]
29
29
throw (DimensionMismatch (" matrix is not square" ))
30
30
end
31
31
return quote # Implementation from Base
32
32
@_inline_meta
33
+ T = eltype (A)
33
34
T2 = typeof ((one (T)* zero (T) + zero (T))/ one (T))
34
35
if istriu (A) || istril (A)
35
36
return convert (T2, det (UpperTriangular (A))) # Is this a Julia bug that a convert is not type stable??
Original file line number Diff line number Diff line change 7
7
# triu/tril
8
8
@test det (@SMatrix [1 2 ; 0 3 ]) === 3
9
9
@test det (@SMatrix [1 2 3 4 ; 0 5 6 7 ; 0 0 8 9 ; 0 0 0 10 ]) === 400.0
10
+ @test @inferred (det (ones (SMatrix{10 ,10 ,Complex{Float64}}))) == 0
10
11
11
12
# Unsigned specializations
12
13
@test det (@SMatrix [0x00 0x01 ; 0x01 0x00 ]):: Int8 == - 1
You can’t perform that action at this time.
0 commit comments