Skip to content

Commit

Permalink
Minor correction
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasvarga committed Dec 14, 2023
1 parent b09a42e commit 85088e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/pmops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ end
(-)(A::PeriodicArray, J::UniformScaling{<:Real}) = +(A,-J)
(-)(J::UniformScaling{<:Real}, A::PeriodicArray) = +(-A,J)
function pmsymadd!(A::PeriodicArray, scal = 1)
# compute the symmetric matrix scal*(A+transpose(A))
m, n = size(A)
m == n || throw(ArgumentError("matrix A must be square"))
if scal == 1
Expand Down Expand Up @@ -336,6 +337,7 @@ end
(-)(A::PeriodicMatrix, J::UniformScaling{<:Real}) = +(A,-J)
(-)(J::UniformScaling{<:Real}, A::PeriodicMatrix) = +(-A,J)
function pmsymadd!(A::PeriodicMatrix, α = 1)
# compute the symmetric matrix scal*(A+transpose(A))
m, n = size(A)
m == n || throw(ArgumentError("matrix A must be square"))
if α == 1
Expand Down Expand Up @@ -399,6 +401,7 @@ end
for (PMF, MF) in ((:pmmuladdsym, :muladdsym!), (:pmmultraddsym, :multraddsym!), (:pmmuladdtrsym,:muladdtrsym!) )
@eval begin
function $PMF(A::PeriodicMatrix,B::PeriodicMatrix,C::PeriodicMatrix, (α,β) = (true, true))
# compute the symmetric results αA + βB*C, αA + βB'*C, and αA + βB*C'.
if isconstant(A)
isconstant(B) || isconstant(C) || B.Ts C.Ts || error("B and C must have the same sampling time")
elseif isconstant(B)
Expand Down
2 changes: 1 addition & 1 deletion test/test_pscric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ end
psysc = ps(a,convert(PM,PeriodicFunctionMatrix(b,period)),c,d);

X1, EVALS, F = prcric(psysc.A, psysc.B, r, q; K = 100, solver = "symplectic", reltol = 1.e-10, abstol = 1.e-10, fast = false, PSD_SLICOT = true);
Xts, ev = pgcric(psysc.A, psysc.B*inv(r)*psysc.B', HarmonicArray(q,2pi), 100; adj = true);
Xts, ev = pgcric(psysc.A, psysc.B*inv(r)*psysc.B', HarmonicArray(q,psysc.period), 100; adj = true);
@test X1(0) Xts(0) && EVALS ev

T = psysc.period/100
Expand Down

0 comments on commit 85088e5

Please sign in to comment.