From 7cc0e37ae19d976ca28b14c812ebc0818b10b1bf Mon Sep 17 00:00:00 2001 From: baggepinnen <cont-frb@ulund.org> Date: Tue, 9 Jan 2018 09:05:02 +0100 Subject: [PATCH] update constructor --- src/LTVModelsBase.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/LTVModelsBase.jl b/src/LTVModelsBase.jl index 950dcbe..c41b2de 100644 --- a/src/LTVModelsBase.jl +++ b/src/LTVModelsBase.jl @@ -37,13 +37,13 @@ mutable struct SimpleLTVModel{T} <: LTVStateSpaceModel At::Array{T,3} Bt::Array{T,3} extended::Bool - function SimpleLTVModel{T}(At::Array{T,3},Bt::Array{T,3},extend::Bool) - if extend - At = cat(3,At,At[:,:,end]) - Bt = cat(3,Bt,Bt[:,:,end]) - end - return new(At,Bt,extend) +end +function SimpleLTVModel{T}(At::Array{T,3},Bt::Array{T,3},extend::Bool) + if extend + At = cat(3,At,At[:,:,end]) + Bt = cat(3,Bt,Bt[:,:,end]) end + return SimpleLTVModel{T}(At,Bt,extend) end SimpleLTVModel(At,Bt,extend::Bool) = SimpleLTVModel{eltype(At)}(At,Bt,extend) -- GitLab