Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/controller/execute.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ julia> u = moveinput!(mpc, ry); round.(u, digits=3)
"""
function moveinput!(
mpc::PredictiveController,
ry::Vector = mpc.estim.model.yop,
d ::Vector = mpc.buffer.empty;
lastu::Vector = (mpc.buffer.u .= mpc.lastu0 .+ mpc.estim.model.uop),
Dhat ::Vector = repeat!(mpc.buffer.D̂, d, mpc.Hp),
Rhaty::Vector = repeat!(mpc.buffer.Ŷ, ry, mpc.Hp),
Rhatu::Vector = mpc.Uop,
ry::AbstractVector = mpc.estim.model.yop,
d ::AbstractVector = mpc.buffer.empty;
lastu::AbstractVector = (mpc.buffer.u .= mpc.lastu0 .+ mpc.estim.model.uop),
Dhat ::AbstractVector = repeat!(mpc.buffer.D̂, d, mpc.Hp),
Rhaty::AbstractVector = repeat!(mpc.buffer.Ŷ, ry, mpc.Hp),
Rhatu::AbstractVector = mpc.Uop,
D̂ = Dhat,
R̂y = Rhaty,
R̂u = Rhatu
Expand Down
2 changes: 1 addition & 1 deletion src/general.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function repeatdiag(A::Hermitian{NT, Diagonal{NT, Vector{NT}}}, n::Int) where {N
end

"In-place version of `repeat` but for vectors only."
function repeat!(Y::Vector, a::Vector, n::Int)
function repeat!(Y::AbstractVector, a::AbstractVector, n::Int)
na = length(a)
for i=0:n-1
# stop if Y is too short, another clearer error is thrown later in the code:
Expand Down
4 changes: 2 additions & 2 deletions src/predictive_control.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ print_backends(::IO, ::PredictiveController) = nothing

"Functor allowing callable `PredictiveController` object as an alias for `moveinput!`."
function (mpc::PredictiveController)(
ry::Vector = mpc.estim.model.yop,
d ::Vector = mpc.estim.buffer.empty;
ry::AbstractVector = mpc.estim.model.yop,
d ::AbstractVector = mpc.estim.buffer.empty;
kwargs...
)
return moveinput!(mpc, ry, d; kwargs...)
Expand Down