Skip to content

Commit a8acfe6

Browse files
Merge pull request #254 from araujoms/linearalgebra
more dead code removal
2 parents 31fd0c3 + 0699bef commit a8acfe6

4 files changed

Lines changed: 1 addition & 116 deletions

File tree

Project.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,21 @@ version = "1.6.0"
99
[deps]
1010
GenericLinearAlgebra = "14197337-ba66-59df-a3e3-ca00e7dcff7a"
1111
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
12-
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
1312
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1413
Quadmath = "be4d8f0f-7fa4-5f49-b795-2f01399ab2dd"
1514
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
16-
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1715
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
1816

1917
[compat]
2018
GenericLinearAlgebra = "0.2.5 - 0.3"
21-
Polynomials = "1 - 4"
2219
Quadmath = "0.5.10"
23-
Requires = "1"
2420
SpecialFunctions = "1 - 2"
2521
julia = "1.6"
2622

2723
[extras]
2824
GenericLinearAlgebra = "14197337-ba66-59df-a3e3-ca00e7dcff7a"
2925
GenericSchur = "c145ed77-6b09-5dd9-b285-bf645a82121e"
30-
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
3126
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3227

3328
[targets]
34-
test = ["Test", "SpecialFunctions", "GenericLinearAlgebra", "GenericSchur"]
29+
test = ["Test", "GenericLinearAlgebra", "GenericSchur"]

src/DoubleFloats.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export DoubleFloat,
3535

3636
using Base.MathConstants: pi, golden, ℯ, eulergamma, catalan
3737

38-
using Requires
3938
using Printf
4039
using Random
4140
import Random: rand, randn

src/math/linearalgebra/matmul.jl

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,3 @@
1-
"""
2-
*(a, b)
3-
4-
A more performant version of `a * b` where a, b are matrices
5-
"""
6-
function Base.:(*)(a::Array{DoubleFloat{T},2}, b::Array{DoubleFloat{T},2}) where {T<:IEEEFloat}
7-
arows, acols = size(a)
8-
brows, bcols = size(b)
9-
if acols != brows
10-
throw(DimensionMismatch(string("size(a,1) != size(b,2): ",size(a,1), " != ", size(b,2))))
11-
end
12-
13-
result_rows, result_cols = arows, bcols
14-
result = reshape(Array{DoubleFloat{T}, 1}(undef, result_rows*result_cols), (result_rows, result_cols))
15-
16-
for bcol = 1:bcols
17-
for arow=1:arows
18-
asum = zero(DoubleFloat{T})
19-
for acol=1:acols
20-
@inbounds asum = fma(a[arow,acol], b[acol,bcol], asum)
21-
end
22-
@inbounds result[arow,bcol] = asum
23-
end
24-
end
25-
26-
return result
27-
end
28-
29-
30-
function Base.:(*)(a::Array{DoubleFloat{T},2}, b::Array{T,2}) where {T<:IEEEFloat}
31-
arows, acols = size(a)
32-
brows, bcols = size(b)
33-
if acols != brows
34-
throw(DimensionMismatch(string("size(a,1) != size(b,2): ",size(a,1), " != ", size(b,2))))
35-
end
36-
37-
result_rows, result_cols = arows, bcols
38-
result = reshape(Array{DoubleFloat{T}, 1}(undef, result_rows*result_cols), (result_rows, result_cols))
39-
40-
for bcol = 1:bcols
41-
for arow=1:arows
42-
asum = zero(DoubleFloat{T})
43-
for acol=1:acols
44-
@inbounds asum = fma(a[arow,acol], b[acol,bcol], asum)
45-
end
46-
@inbounds result[arow,bcol] = asum
47-
end
48-
end
49-
50-
return result
51-
end
52-
53-
54-
function Base.:(*)(a::Array{T,2}, b::Array{DoubleFloat{T},2}) where {T<:IEEEFloat}
55-
arows, acols = size(a)
56-
brows, bcols = size(b)
57-
if acols != brows
58-
throw(DimensionMismatch(string("size(a,1) != size(b,2): ",size(a,1), " != ", size(b,2))))
59-
end
60-
61-
result_rows, result_cols = arows, bcols
62-
result = reshape(Array{DoubleFloat{T}, 1}(undef, result_rows*result_cols), (result_rows, result_cols))
63-
64-
for bcol = 1:bcols
65-
for arow=1:arows
66-
asum = zero(DoubleFloat{T})
67-
for acol=1:acols
68-
@inbounds asum = fma(a[arow,acol], b[acol,bcol], asum)
69-
end
70-
@inbounds result[arow,bcol] = asum
71-
end
72-
end
73-
74-
return result
75-
end
76-
771
"""
782
mul!(c, a, b)
793
A more performant version of `c = a * b` where a, b, c are matrices

src/math/linearalgebra/support.jl

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,3 @@
22
r, c = size(m)
33
return r === c
44
end
5-
6-
@inline function issquare(m::Array{DoubleFloat{T},2}) where {T<:IEEEFloat}
7-
r, c = size(m)
8-
return r === c
9-
end
10-
11-
function LinearAlgebra.norm(v::Array{DoubleFloat{T},N}, p::Real=2.0) where {N, T<:IEEEFloat}
12-
isempty(v) && return zero(DoubleFloat{T})
13-
14-
if isinf(p)
15-
return signbit(p) ? minimum(abs.(v)) : maximum(abs.(v))
16-
elseif p==2
17-
return vp = sqrt(sum(v .* v))
18-
else
19-
vp = sum(abs.(v).^(p))
20-
r = inv(DoubleFloat{T}(p))
21-
return vp^r
22-
end
23-
end
24-
25-
function LinearAlgebra.norm(v::Array{Complex{DoubleFloat{T}},N}, p::Real=2.0) where {N, T<:IEEEFloat}
26-
isempty(v) && return zero(DoubleFloat{T})
27-
28-
if isinf(p)
29-
return signbit(p) ? minimum(abs.(real.(v))) : maximum(abs.(real.(v)))
30-
elseif p==2
31-
return vp = sqrt(real(sum(conj.(v) .* v)))
32-
else
33-
vp = sum(abs.(v).^(p))
34-
r = inv(DoubleFloat{T}(p))
35-
return vp^r
36-
end
37-
end

0 commit comments

Comments
 (0)