Skip to content

Commit c633027

Browse files
authored
Merge branch 'main' into ksh/cuda6
2 parents 023ddcb + 03d21cf commit c633027

4 files changed

Lines changed: 33 additions & 52 deletions

File tree

.github/dependabot.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
21
version: 2
32
updates:
43
- package-ecosystem: "github-actions"
5-
directory: "/" # Location of package manifests
4+
directory: "/"
65
schedule:
76
interval: "weekly"
7+
- package-ecosystem: "julia"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
groups: # uncomment to group all julia package updates into a single PR
12+
all-julia-packages:
13+
patterns:
14+
- "*"

.github/workflows/CompatHelper.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/algorithms.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,3 +539,7 @@ macro check_size(x, sz, size = :size)
539539
end
540540
)
541541
end
542+
543+
# Check equality of two `TruncationStrategy`s
544+
Base.:(==)(t1::T, t2::T) where {T <: TruncationStrategy} = all(getfield(t1, f) == getfield(t2, f) for f in fieldnames(T))
545+
Base.:(==)(t1::T1, t2::T2) where {T1 <: TruncationStrategy, T2 <: TruncationStrategy} = false

test/algorithms.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,23 @@ end
6060
@test @constinferred(select_algorithm(svd_compact!, A, $alg)) === QRIteration()
6161
end
6262
end
63+
64+
@testset "Truncation equivalencies" begin
65+
truncs = [
66+
notrunc(),
67+
truncrank(4),
68+
truncrank(5),
69+
truncfilter(x -> x > 0),
70+
truncfilter(x -> x > 1.0e-4),
71+
trunctol(; atol = 0),
72+
trunctol(; atol = 1.0e-4),
73+
truncerror(; atol = 0),
74+
truncerror(; atol = 1.0e-4),
75+
truncrank(4) & truncfilter(x -> x > 0),
76+
truncrank(4) & truncrank(5),
77+
]
78+
79+
for (i1, t1) in enumerate(truncs), (i2, t2) in enumerate(truncs)
80+
@test (i1 == i2) ? t1 == t2 : t1 != t2
81+
end
82+
end

0 commit comments

Comments
 (0)