Skip to content

Commit

Permalink
abstract type definition update with apropriate requirement of compat.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
neveritt committed Jun 27, 2017
1 parent b53eeda commit 9ff11e8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 32 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Polynomials 0.1.0
Optim 0.6.0
LossFunctions 0.0.3
SystemsBase
Compat 0.9.0
Compat 0.26.0
ToeplitzMatrices 0.1.1
GeneralizedSchurAlgorithm 0.0.2
2 changes: 1 addition & 1 deletion src/types/idinfo.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
abstract IdInfo{S}
@compat abstract type IdInfo{S} end

immutable IterativeIdInfo{S} <: IdInfo{S} #{T<:IterativeIdMethod}
mse::Vector{Float64}
Expand Down
6 changes: 3 additions & 3 deletions src/types/idmethods.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
abstract AbstractIdMethod
@compat abstract type AbstractIdMethod end

abstract IterativeIdMethod <: AbstractIdMethod
@compat abstract type IterativeIdMethod <: AbstractIdMethod end

abstract OneStepIdMethod <: AbstractIdMethod
@compat abstract type OneStepIdMethod <: AbstractIdMethod end

function fval{T1<:Real, V1<:AbstractVector, V2<:AbstractVector, T2<:Real}(
method::IterativeIdMethod, data::IdDataObject{T1,V1,V2}, n::Vector{Int}, x::Vector{T2},
Expand Down
6 changes: 3 additions & 3 deletions src/types/idmodels.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
abstract AbstractModelOrder
@compat abstract type AbstractModelOrder end

immutable FullPolyOrder{S} <: AbstractModelOrder
na::Int
Expand Down Expand Up @@ -54,7 +54,7 @@ getindex{S}(p::FullPolyOrder{S}, ::Colon, ::Colon) = p
getindex{S}(p::FullPolyOrder{S}, ::Colon, idx::Int) = p[1,idx]
getindex{S}(p::FullPolyOrder{S}, idx::Int, ::Colon) = p

abstract IdModel{S}
@compat abstract type IdModel{S} end

immutable SSModel{S} <: IdModel{S}
order::Int
Expand All @@ -66,7 +66,7 @@ immutable SSModel{S} <: IdModel{S}
end
end

abstract PolyType
@compat abstract type PolyType end

immutable FIR <: PolyType end
immutable AR <: PolyType end
Expand Down
28 changes: 4 additions & 24 deletions src/types/idstatespace.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
immutable IdStateSpace{T,S,M,I<:IdInfo} <: SystemsBase.LtiSystem
immutable IdStateSpace{T,S,M,I} <: SystemsBase.LtiSystem{T,S}
A::M
B::M
C::M
Expand Down Expand Up @@ -35,26 +35,6 @@ ss(s::IdStateSpace{Val{:mimo},Val{:disc}}) = ss(s.A, s.B, s.C, s.D, s.Ts)
samplingtime(s::IdStateSpace) = s.Ts
isdiscrete(s::IdStateSpace) = true

summary(s::IdStateSpace) = string("ss(nx=", s.nx, ",nu=", s.nu, ",ny=", s.ny, ",Ts=",
s.Ts, ")")

showcompact(io::IO, s::IdStateSpace) = print(io, summary(s))

function show(io::IO, s::IdStateSpace)
println(io, "Discrete time state space model")
println(io, "\tx[k+1] = Ax[k] + Bu[k]")
println(io, "\ty[k] = Cx[k] + Du[k]")
print(io, "with nx=", s.nx, ", nu=", s.nu, ", ny=", s.ny, ", Ts=", s.Ts, ".")
end

function showall(io::IO, s::IdStateSpace)
show(io, s)
println(io, "System matrix (A):")
println(io, s.A)
println(io, "Input matrix (B):")
println(io, s.B)
println(io, "Output matrix (C):")
println(io, s.C)
println(io, "Feedforward matrix (D):")
print(io, s.D)
end
numstates(s::IdStateSpace) = s.nx
numinputs(s::IdStateSpace) = s.nu
numoutputs(s::IdStateSpace) = s.ny

0 comments on commit 9ff11e8

Please sign in to comment.