Skip to content

Commit 049bbc7

Browse files
committed
Merge remote-tracking branch 'origin/main' into extension
2 parents f420bdf + e210402 commit 049bbc7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/controller/execute.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ julia> u = moveinput!(mpc, ry); round.(u, digits=3)
5858
"""
5959
function moveinput!(
6060
mpc::PredictiveController,
61-
ry::Vector = mpc.estim.model.yop,
62-
d ::Vector = mpc.buffer.empty;
63-
lastu::Vector = (mpc.buffer.u .= mpc.lastu0 .+ mpc.estim.model.uop),
64-
Dhat ::Vector = repeat!(mpc.buffer.D̂, d, mpc.Hp),
65-
Rhaty::Vector = repeat!(mpc.buffer.Ŷ, ry, mpc.Hp),
66-
Rhatu::Vector = mpc.Uop,
61+
ry::AbstractVector = mpc.estim.model.yop,
62+
d ::AbstractVector = mpc.buffer.empty;
63+
lastu::AbstractVector = (mpc.buffer.u .= mpc.lastu0 .+ mpc.estim.model.uop),
64+
Dhat ::AbstractVector = repeat!(mpc.buffer.D̂, d, mpc.Hp),
65+
Rhaty::AbstractVector = repeat!(mpc.buffer.Ŷ, ry, mpc.Hp),
66+
Rhatu::AbstractVector = mpc.Uop,
6767
= Dhat,
6868
R̂y = Rhaty,
6969
R̂u = Rhatu

src/general.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ function isblockdiag(A::AbstractMatrix, n::Int, m::Int)
182182
end
183183

184184
"In-place version of `repeat` but for vectors only."
185-
function repeat!(Y::Vector, a::Vector, n::Int)
185+
function repeat!(Y::AbstractVector, a::AbstractVector, n::Int)
186186
na = length(a)
187187
for i=0:n-1
188188
# stop if Y is too short, another clearer error is thrown later in the code:

src/predictive_control.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ print_backends(::IO, ::PredictiveController) = nothing
5151

5252
"Functor allowing callable `PredictiveController` object as an alias for `moveinput!`."
5353
function (mpc::PredictiveController)(
54-
ry::Vector = mpc.estim.model.yop,
55-
d ::Vector = mpc.estim.buffer.empty;
54+
ry::AbstractVector = mpc.estim.model.yop,
55+
d ::AbstractVector = mpc.estim.buffer.empty;
5656
kwargs...
5757
)
5858
return moveinput!(mpc, ry, d; kwargs...)

0 commit comments

Comments
 (0)