1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-22 08:00:28 +01:00

include tests for constraint Matrices

This commit is contained in:
Marek Kaluba 2022-11-08 10:02:21 +01:00
parent 518c661dc8
commit b2b08e68c1
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
2 changed files with 22 additions and 0 deletions

View 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

View File

@ -17,6 +17,7 @@ include("optimizers.jl")
@testset "PropertyT" begin
include("constratint_matrices.jl")
include("actions.jl")
include("1703.09680.jl")