SCM

SCM Repository

[matrix] Diff of /pkg/Matrix/tests/abIndex-tsts.R
ViewVC logotype

Diff of /pkg/Matrix/tests/abIndex-tsts.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2902, Tue Sep 10 10:56:46 2013 UTC revision 2903, Tue Sep 10 16:21:29 2013 UTC
# Line 90  Line 90 
90      for(ng in getGroupMembers(grMeth)) {      for(ng in getGroupMembers(grMeth)) {
91          cat(ng, ": ")          cat(ng, ": ")
92          G <- get(ng)          G <- get(ng)
93          t.tol <- if(ng == "/") 8e-16 else 0          t.tol <- if(ng == "/") 1e-12 else 0
94          ## now using special all.equal() method!          ## "/" with no long double (e.g. on Sparc Solaris): 1.125e-14
95          AEq <- function(a,b, ...) all.equal(a, b, tol=t.tol)          AEq <- function(a,b, ...) assert.EQ(a, b, tol=t.tol, giveRE=TRUE)
96          for(v in ex.) {          for(v in ex.) {
97              va <- as(v, "abIndex")              va <- as(v, "abIndex")
98              for(s in list(-1, 17L, TRUE, FALSE)) {# numeric *and* logical              for(s in list(-1, 17L, TRUE, FALSE)) # numeric *and* logical
99                  if(!((identical(s, FALSE) && ng == "/")) && ## division by 0 often "fails"                  if(!((identical(s, FALSE) && ng == "/"))) { ## division by 0 may "fail"
100                     (Sys.info()[["sysname"]] == "Linux" || .Platform$OS.type == "windows"))# not Solaris  
101                  stopifnot(AEq(as(G(v, s), "abIndex"), G(va, s)),                      AEq(as(G(v, s), "abIndex"), G(va, s))
102                            AEq(as(G(s, v), "abIndex"), G(s, va)))                      AEq(as(G(s, v), "abIndex"), G(s, va))
103              }              }
104              cat(".")              cat(".")
105          }          }

Legend:
Removed from v.2902  
changed lines
  Added in v.2903

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge