[Robkalman-commits] r67 - branches/robKalman_2012/pkg/robKalman/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jul 16 09:44:59 CEST 2013


Author: ruckdeschel
Date: 2013-07-16 09:44:58 +0200 (Tue, 16 Jul 2013)
New Revision: 67

Modified:
   branches/robKalman_2012/pkg/robKalman/R/allClass.R
Log:
Smoother FilterList committed

Modified: branches/robKalman_2012/pkg/robKalman/R/allClass.R
===================================================================
--- branches/robKalman_2012/pkg/robKalman/R/allClass.R	2013-05-18 12:53:49 UTC (rev 66)
+++ branches/robKalman_2012/pkg/robKalman/R/allClass.R	2013-07-16 07:44:58 UTC (rev 67)
@@ -105,27 +105,37 @@
                                          predStep = "FunctionWithControl",
                                          corrStep = "FunctionWithControl")
          )
-setClassUnion("OptionalSSFilter",
-              c("SSFilter","NULL")
-              )
-setClass("SSRobFilter",
-         representation = representation(classFilter = "SSFilter",
-                                         robFilter = "OptionalSSFilter")
-         )
 setClass("SSSmoother",
          representation = representation(smoothStep = "FunctionWithControl",
                                          smoothCov = "FunctionWithControl",
                                          lagoneCov = "FunctionWithControl"),
          contains = "SSFilter"
          )
-setClassUnion("OptionalSSSmoother",
-              c("SSSmoother","NULL")
-              )
-setClass("SSRobSmoother",
-         representation = representation(classSmoother = "SSSmoother",
-                                         robSmoother = "OptionalSSSmoother")
-         )
 
+### ---- List of Filters/Smoothers similar to DistrList ---- ###
+
+setClass(Class = "SSFilterList",
+            prototype = prototype(list(new("SSFilter"))),
+            contains = "list",
+            validity = function(object){
+                nrvalues <- length(object)
+                for(i in 1:nrvalues)
+                    if(!is(object[[i]], "SSFilter"))
+                        stop("element ", i, " is no 'SSFilter'")
+                return(TRUE)
+            })
+
+setClass(Class = "SSSmootherList",
+            prototype = prototype(list(new("SSSmoother"))),
+            contains = "list",
+            validity = function(object){
+                nrvalues <- length(object)
+                for(i in 1:nrvalues)
+                    if(!is(object[[i]], "SSSmoother"))
+                        stop("element ", i, " is no 'SSSmoother'")
+                return(TRUE)
+            })
+
 ## setClassUnion("SSClassOrRobFilter",
 ##               c("SSFilter", "SSrobFilter")
 ##               )



More information about the Robkalman-commits mailing list