[Distr-commits] r823 - branches/distr-2.4/pkg/distr/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 12 00:07:24 CEST 2012


Author: ruckdeschel
Date: 2012-06-12 00:07:23 +0200 (Tue, 12 Jun 2012)
New Revision: 823

Modified:
   branches/distr-2.4/pkg/distr/R/internalUtils.R
Log:
[distr] tried to fix gaps issue as mentioned by Dirk Surmann

Modified: branches/distr-2.4/pkg/distr/R/internalUtils.R
===================================================================
--- branches/distr-2.4/pkg/distr/R/internalUtils.R	2012-06-09 02:49:22 UTC (rev 822)
+++ branches/distr-2.4/pkg/distr/R/internalUtils.R	2012-06-11 22:07:23 UTC (rev 823)
@@ -630,8 +630,9 @@
                  trY <- try(
                  if(is.null(e1 at gaps))
                     gapsnew <- NULL
-                 else {gapsnew <- e1 at gaps * e2
-                       if (e2 < 0) gapsnew <- 
+                 else {gapsnew <- e1 at gaps
+                       if(is.numeric(gapsold)) gapsnew <- matrix(gapsnew * e2, ncol=2)
+                       if (e2 < 0) gapsnew <-
                              gapsnew[rev(seq(nrow(gapsnew))),c(2,1),drop = FALSE] }
                  , silent=TRUE)
                  if(is(trY,"try-error")) gapsnew <- NULL
@@ -653,9 +654,10 @@
                  trY <- try(
                  if(is.null(e1 at gaps))
                     gapsnew <- NULL
-                 else {gapsnew <- e1 at gaps * e2
-                       if (e2 < 0) gapsnew <- 
-                            gapsnew[rev(seq(nrow(gapsnew))),c(2,1), drop = FALSE] }
+                 else {gapsold <- e1 at gaps
+                       if(is.numeric(gapsold)) gapsnew <- matrix(gapsnew * e2, ncol=2)
+                       if (e2 < 0) gapsnew <-
+                             gapsnew[rev(seq(nrow(gapsnew))),c(2,1),drop = FALSE] }
                  , silent=TRUE)
                  if(is(trY,"try-error")) gapsnew <- NULL
 
@@ -1005,7 +1007,7 @@
                            q = qnew, gaps = gapsnew,
                           .withSim = FALSE, .withArith = TRUE,
                     .logExact = .logExact(e1), .lowerExact = .lowerExact(e1))
-            rm(gapsnew)
+            if(exists("gapsnew")) rm(gapsnew)
             rm(pnew, qnew, dnew, rnew)
             object
           }



More information about the Distr-commits mailing list