mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-26 00:55:27 +01:00
include tests for constraint Matrices
This commit is contained in:
parent
518c661dc8
commit
b2b08e68c1
21
test/constratint_matrices.jl
Normal file
21
test/constratint_matrices.jl
Normal file
@ -0,0 +1,21 @@
|
||||
@testset "ConstraintMatrix" begin
|
||||
@test PropertyT.ConstraintMatrix{Float64}([-1, 2, -1, 1, 4, 2, 6], 3, 2, π) isa AbstractMatrix
|
||||
|
||||
cm = PropertyT.ConstraintMatrix{Float64}([-1, 2, -1, 1, 4, 2, 6], 3, 2, π)
|
||||
|
||||
@test cm == Float64[
|
||||
-π π
|
||||
2π 0.0
|
||||
0.0 π
|
||||
]
|
||||
|
||||
@test collect(PropertyT.nzpairs(cm)) == [
|
||||
1 => 3.141592653589793
|
||||
2 => 3.141592653589793
|
||||
2 => 3.141592653589793
|
||||
4 => 3.141592653589793
|
||||
6 => 3.141592653589793
|
||||
1 => -3.141592653589793
|
||||
1 => -3.141592653589793
|
||||
]
|
||||
end
|
@ -17,6 +17,7 @@ include("optimizers.jl")
|
||||
|
||||
@testset "PropertyT" begin
|
||||
|
||||
include("constratint_matrices.jl")
|
||||
include("actions.jl")
|
||||
|
||||
include("1703.09680.jl")
|
||||
|
Loading…
Reference in New Issue
Block a user