SCM

SCM Repository

[rmetrics] Diff of /pkg/randtoolbox/R/testRNG.R
ViewVC logotype

Diff of /pkg/randtoolbox/R/testRNG.R

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

revision 6135, Thu Nov 29 11:07:56 2018 UTC revision 6136, Tue Apr 30 12:56:05 2019 UTC
# Line 10  Line 10 
10  #  #
11  # The new BSD License is applied to this software.  # The new BSD License is applied to this software.
12  # Copyright (c) 2009 Christophe Dutang.  # Copyright (c) 2009 Christophe Dutang.
13    # Christophe Dutang, see http://dutangc.free.fr
14  # All rights reserved.  # All rights reserved.
15  #  #
16  #      Redistribution and use in source and binary forms, with or without  #      Redistribution and use in source and binary forms, with or without
# Line 700  Line 701 
701      if(n > 15)      if(n > 15)
702      cat("Warning in permut: it will take a long time to compute!")      cat("Warning in permut: it will take a long time to compute!")
703    
     nb <- 1:n  
     result <- matrix(1, 1, 1)  
   
704      if(n == 1)      if(n == 1)
705      return(result)      return(matrix(1, 1, 1))
706      else    if(n == 2)
707        return(rbind(1:2, 2:1))
708    
709      result <- rbind(1:2, 2:1)      result <- rbind(1:2, 2:1)
710    
711      if(n>2)      if(n>2)
# Line 715  Line 715 
715              tempagg <- NULL              tempagg <- NULL
716                          #add i on first column                          #add i on first column
717              temp <- cbind(i, result)              temp <- cbind(i, result)
718    
719              tempagg <- rbind(tempagg, temp)              tempagg <- rbind(tempagg, temp)
720    
721                          #add i on the jth column                          #add i on the jth column
# Line 726  Line 727 
727    
728                          #add i on the last column                          #add i on the last column
729              temp <- cbind(result, i)              temp <- cbind(result, i)
             tempagg <- rbind(tempagg, temp)  
730    
731              result <- tempagg        result <- rbind(tempagg, temp)
732          }          }
733      }      }
734      colnames(result) <- NULL
735      return(as.matrix(result))      return(as.matrix(result))
736  }  }
737    

Legend:
Removed from v.6135  
changed lines
  Added in v.6136

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