#
# Structure Extractors
#
SystemMatrix <- function (obj,noconst=FALSE,...) UseMethods("SystemMatrix")
SystemMatrix.TSestModel <- function (obj,noconst=FALSE,...) {return(SystemMatrix((TSmodel(obj))}
SystemMatrix.TSmodel <- function (obj,noconst=FALSE,...) {
F <- as.matrix(obj$F)
m <- dim(F)[1]
if (m == 1 ) return(F)
if (noconst) {
if (F[1,1] == 1) {
F <- F[2:m,2:m,drop=FALSE]
} else if (F[m,m] == 1) {
F <- F[1:(m-1),1:(m-1),drop=FALSE]
}
}
return(F)
}