Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use hcat in tests #3653

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/test-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
- name: Run tests
uses: julia-actions/julia-runtest@v1
timeout-minutes: 30 # kill stale process earlier
continue-on-error: ${{ matrix.version == '1.6' }}
- name: Process coverage
uses: julia-actions/julia-processcoverage@v1
- name: Upload coverage
Expand Down
4 changes: 2 additions & 2 deletions test/ConcreteOperations/isequivalent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ for N in [Float64, Float32, Rational{Int}]
Z = Zonotope(N[1, 2], Matrix{N}(undef, 2, 0))
@test isequivalent(S, Z) && isequivalent(Z, S)
# zero generators
Z = Zonotope(N[1, 2], N[0; 0;;])
Z = Zonotope(N[1, 2], hcat(N[0, 0]))
@test isequivalent(S, Z) && isequivalent(Z, S)
# wrong center
Z = Zonotope(N[2, 1], Matrix{N}(undef, 2, 0))
@test !isequivalent(S, Z) && !isequivalent(Z, S)
# nonzero generators
Z = Zonotope(N[1, 2], N[1; 0;;])
Z = Zonotope(N[1, 2], hcat(N[1, 0]))
@test !isequivalent(S, Z) && !isequivalent(Z, S)
end
2 changes: 1 addition & 1 deletion test/Sets/Interval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ for N in [Float64, Float32, Rational{Int}]
M = hcat(N[2])
v = N[-3]
@test affine_map(M, I1, v) == Interval(N(-3), N(-1))
M2 = N[2; -2;;]
M2 = hcat(N[2, -2])
v = N[-1, -1]
H = affine_map(M2, I1, v)
@test H isa Zonotope && isequivalent(H, LineSegment(N[-1, -1], N[1, -3]))
Expand Down
3 changes: 2 additions & 1 deletion test/Sets/SparsePolynomialZonotope.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ for N in [Float64, Float32, Rational{Int}]
@test expmat(PZreduced) == [1 2; 0 1]
# also removes almost-zero columns
if N <: AbstractFloat
PZ = SparsePolynomialZonotope(N[-1, 2], N[1e-16; -1e-16;;], N[1e-16; -1e-16;;], [1; 1;;])
PZ = SparsePolynomialZonotope(N[-1, 2], hcat(N[1e-16, -1e-16]),
hcat(N[1e-16, -1e-16]), hcat([1, 1]))
PZreduced = remove_redundant_generators(PZ)
@test center(PZreduced) == N[-1, 2]
@test size(genmat_dep(PZreduced)) == (2, 0)
Expand Down
Loading