[Distr-commits] r89 - pkg/distrMod/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 26 08:47:29 CET 2008


Author: stamats
Date: 2008-02-26 08:47:29 +0100 (Tue, 26 Feb 2008)
New Revision: 89

Modified:
   pkg/distrMod/R/AllClass.R
Log:
modified validity check in class "ParamFamParameter" due to new class "MatrixorFunction"

Modified: pkg/distrMod/R/AllClass.R
===================================================================
--- pkg/distrMod/R/AllClass.R	2008-02-26 06:05:45 UTC (rev 88)
+++ pkg/distrMod/R/AllClass.R	2008-02-26 07:47:29 UTC (rev 89)
@@ -140,17 +140,19 @@
             validity = function(object){
                 if(is.matrix(object at trafo)){
                 dimension <- length(object at main) + length(object at nuisance)
-                
-                if(ncol(object at trafo) != dimension)
-                    stop("invalid transformation:\n",
-                         "number of columns of 'trafo' not equal to ",
-                         "dimension of the parameter")
-                if(nrow(object at trafo) > dimension)
-                    stop("invalid transformation:\n",
-                         "number of rows of 'trafo' larger than ",
-                         "dimension of the parameter")
-                if(any(!is.finite(object at trafo)))
-                    stop("infinite or missing values in 'trafo'")}
+
+                if(is.matrix(object at trafo)){
+                    if(ncol(object at trafo) != dimension)
+                        stop("invalid transformation:\n",
+                             "number of columns of 'trafo' not equal to ",
+                             "dimension of the parameter")
+                    if(nrow(object at trafo) > dimension)
+                        stop("invalid transformation:\n",
+                             "number of rows of 'trafo' larger than ",
+                             "dimension of the parameter")
+                    if(any(!is.finite(object at trafo)))
+                        stop("infinite or missing values in 'trafo'")}
+                }
                 return(TRUE)
             })
 



More information about the Distr-commits mailing list