Skip to content

Commit 51a261e

Browse files
committed
implement feedback from code review
1 parent 2462e38 commit 51a261e

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

src/systems.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3537,10 +3537,6 @@ for (Z, AZ) in
35373537
end
35383538
end
35393539

3540-
function $(Z)(AS::Number, BS::Number, U)
3541-
return $(Z)(hcat(AS), hcat(BS), U)
3542-
end
3543-
35443540
function statedim(s::$Z)
35453541
return size(s.AS, 1)
35463542
end

test/continuous.jl

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ end
793793

794794
@testset "Linear parametric continuous systems" begin
795795
@static if isdefined(@__MODULE__, :LazySets)
796-
using LazySets: MatrixZonotope
796+
using LazySets: MatrixZonotope, Zonotope
797797

798798
Ac = [1.0 0.0; 0.0 1.0]
799799
A1 = [0.1 0.0; 0.0 0.0]
@@ -840,5 +840,25 @@ end
840840
@test iscontrolled(sc)
841841
@test !isnoisy(sc)
842842
@test !isconstrained(sc)
843+
844+
X = Zonotope([0.0, 0.0], Matrix{Float64}(I, 2, 2))
845+
U = Zonotope([0.0], Matrix{Float64}(I, 1, 1))
846+
847+
scc = ConstrainedLinearControlParametricContinuousSystem(A, B, X, U)
848+
@test scc isa ConstrainedLinearControlParametricContinuousSystem
849+
850+
@test statedim(scc) == 2
851+
@test inputdim(scc) == 1
852+
@test noisedim(scc) == 0
853+
@test state_matrix(scc) === A
854+
@test input_matrix(scc) === B
855+
@test stateset(scc) === X
856+
@test inputset(scc) === U
857+
@test islinear(scc)
858+
@test isparametric(scc)
859+
@test isaffine(scc)
860+
@test iscontrolled(scc)
861+
@test isconstrained(scc)
862+
@test !isnoisy(scc)
843863
end
844864
end

test/discrete.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,5 +561,25 @@ end
561561
@test iscontrolled(sc)
562562
@test !isnoisy(sc)
563563
@test !isconstrained(sc)
564+
565+
X = Zonotope([0.0, 0.0], Matrix{Float64}(I, 2, 2))
566+
U = Zonotope([0.0], Matrix{Float64}(I, 1, 1))
567+
568+
scd = ConstrainedLinearControlParametricDiscreteSystem(A, B, X, U)
569+
@test scd isa ConstrainedLinearControlParametricDiscreteSystem
570+
571+
@test statedim(scd) == 2
572+
@test inputdim(scd) == 1
573+
@test noisedim(scd) == 0
574+
@test state_matrix(scd) === A
575+
@test input_matrix(scd) === B
576+
@test stateset(scd) === X
577+
@test inputset(scd) === U
578+
@test islinear(scd)
579+
@test isparametric(scd)
580+
@test isaffine(scd)
581+
@test iscontrolled(scd)
582+
@test isconstrained(scd)
583+
@test !isnoisy(scd)
564584
end
565585
end

0 commit comments

Comments
 (0)