Back to Multiple platform build/check report for BioC 3.22:   simplified   long
A[B]CDEFGHIJKLMNOPQRSTUVWXYZ

This page was generated on 2025-09-20 12:03 -0400 (Sat, 20 Sep 2025).

HostnameOSArch (*)R versionInstalled pkgs
nebbiolo2Linux (Ubuntu 24.04.3 LTS)x86_644.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" 4814
lconwaymacOS 12.7.1 Montereyx86_644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4603
kjohnson3macOS 13.7.7 Venturaarm644.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" 4547
taishanLinux (openEuler 24.03 LTS)aarch644.5.0 (2025-04-11) -- "How About a Twenty-Six" 4553
Click on any hostname to see more info about the system (e.g. compilers)      (*) as reported by 'uname -p', except on Windows and Mac OS X

Package 253/2333HostnameOS / ArchINSTALLBUILDCHECKBUILD BIN
BufferedMatrix 1.73.0  (landing page)
Ben Bolstad
Snapshot Date: 2025-09-19 13:45 -0400 (Fri, 19 Sep 2025)
git_url: https://git.bioconductor.org/packages/BufferedMatrix
git_branch: devel
git_last_commit: 0147962
git_last_commit_date: 2025-04-15 09:39:39 -0400 (Tue, 15 Apr 2025)
nebbiolo2Linux (Ubuntu 24.04.3 LTS) / x86_64  OK    OK    OK  UNNEEDED, same version is already published
lconwaymacOS 12.7.1 Monterey / x86_64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
kjohnson3macOS 13.7.7 Ventura / arm64  OK    OK    WARNINGS    OK  UNNEEDED, same version is already published
taishanLinux (openEuler 24.03 LTS) / aarch64  OK    OK    OK  


CHECK results for BufferedMatrix on nebbiolo2

To the developers/maintainers of the BufferedMatrix package:
- Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information.
- Use the following Renviron settings to reproduce errors and warnings.
- If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information.

raw results


Summary

Package: BufferedMatrix
Version: 1.73.0
Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.73.0.tar.gz
StartedAt: 2025-09-19 21:43:51 -0400 (Fri, 19 Sep 2025)
EndedAt: 2025-09-19 21:44:26 -0400 (Fri, 19 Sep 2025)
EllapsedTime: 35.1 seconds
RetCode: 0
Status:   OK  
CheckDir: BufferedMatrix.Rcheck
Warnings: 0

Command output

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.73.0.tar.gz
###
##############################################################################
##############################################################################


* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-08-23 r88802)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
    GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.73.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
   209 |     $x^{power}$ elementwise of the matrix
       |        ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... NOTE
Note: information on .o files is not available
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘Rcodetesting.R’
  Running ‘c_code_level_tests.R’
  Running ‘objectTesting.R’
  Running ‘rawCalltesting.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE

Status: 2 NOTEs
See
  ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.


Installation output

BufferedMatrix.Rcheck/00install.out

##############################################################################
##############################################################################
###
### Running command:
###
###   /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################


* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.73.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
 1580 |   if (!(Matrix->readonly) & setting){
      |       ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
 3327 | static int sort_double(const double *a1,const double *a2){
      |            ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.22-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)

Tests output

BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 

Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 

Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 

Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068 
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 

Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 

Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 

[[1]]
[1] 0

> 
> proc.time()
   user  system elapsed 
  0.381   0.049   0.516 

BufferedMatrix.Rcheck/tests/objectTesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> 
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
> 
> 
> ## test creation and some simple assignments and subsetting operations
> 
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
> 
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
> 
> 
> 
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
> 
> 
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[,-(3:20)]
       [,1]    [,2]
 [1,]  0.00 0.00000
 [2,]  0.00 0.00000
 [3,] 51.34 0.00000
 [4,]  0.00 0.00000
 [5,]  0.00 0.00000
 [6,]  0.00 0.00000
 [7,]  0.00 0.00000
 [8,]  0.00 0.00000
 [9,]  0.00 9.87654
[10,]  0.00 0.00000
> tmp2[3,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34    0    0    0    0    0    0    0    0     0     0     0     0
     [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,]     0     0     0     0     0     0     0
> tmp2[-3,]
      [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]    0 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]    0 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19] [,20]
 [1,]     0     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0     0
> tmp2[2,1:3]
     [,1] [,2] [,3]
[1,]    0    0    0
> tmp2[3:9,1:3]
      [,1]    [,2] [,3]
[1,] 51.34 0.00000    0
[2,]  0.00 0.00000    0
[3,]  0.00 0.00000    0
[4,]  0.00 0.00000    0
[5,]  0.00 0.00000    0
[6,]  0.00 0.00000    0
[7,]  0.00 9.87654    0
> tmp2[-4,-4]
       [,1]    [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [2,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [3,] 51.34 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [4,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [5,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [6,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [7,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
 [8,]  0.00 9.87654    0    0    0    0    0    0    0     0     0     0     0
 [9,]  0.00 0.00000    0    0    0    0    0    0    0     0     0     0     0
      [,14] [,15] [,16] [,17] [,18] [,19]
 [1,]     0     0     0     0     0     0
 [2,]     0     0     0     0     0     0
 [3,]     0     0     0     0     0     0
 [4,]     0     0     0     0     0     0
 [5,]     0     0     0     0     0     0
 [6,]     0     0     0     0     0     0
 [7,]     0     0     0     0     0     0
 [8,]     0     0     0     0     0     0
 [9,]     0     0     0     0     0     0
> 
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
> 
> for (i in 1:10){
+   for (j in 1:10){
+     tmp3[i,j] <- (j-1)*10 + i
+   }
+ }
> 
> tmp3[2:4,2:4]
     [,1] [,2] [,3]
[1,]   12   22   32
[2,]   13   23   33
[3,]   14   24   34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]   11   21   31   11   21   31   91    1   11     1    11    21    31
 [2,]   12   22   32   12   22   32   92    2   12     2    12    22    32
 [3,]   13   23   33   13   23   33   93    3   13     3    13    23    33
 [4,]   14   24   34   14   24   34   94    4   14     4    14    24    34
 [5,]   15   25   35   15   25   35   95    5   15     5    15    25    35
 [6,]   16   26   36   16   26   36   96    6   16     6    16    26    36
 [7,]   17   27   37   17   27   37   97    7   17     7    17    27    37
 [8,]   18   28   38   18   28   38   98    8   18     8    18    28    38
 [9,]   19   29   39   19   29   39   99    9   19     9    19    29    39
      [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
 [1,]    41    51    61    71    81    91    91    81    71    61    51    41
 [2,]    42    52    62    72    82    92    92    82    72    62    52    42
 [3,]    43    53    63    73    83    93    93    83    73    63    53    43
 [4,]    44    54    64    74    84    94    94    84    74    64    54    44
 [5,]    45    55    65    75    85    95    95    85    75    65    55    45
 [6,]    46    56    66    76    86    96    96    86    76    66    56    46
 [7,]    47    57    67    77    87    97    97    87    77    67    57    47
 [8,]    48    58    68    78    88    98    98    88    78    68    58    48
 [9,]    49    59    69    79    89    99    99    89    79    69    59    49
      [,26] [,27] [,28] [,29]
 [1,]    31    21    11     1
 [2,]    32    22    12     2
 [3,]    33    23    13     3
 [4,]    34    24    14     4
 [5,]    35    25    15     5
 [6,]    36    26    16     6
 [7,]    37    27    17     7
 [8,]    38    28    18     8
 [9,]    39    29    19     9
> tmp3[-c(1:5),-c(6:10)]
     [,1] [,2] [,3] [,4] [,5]
[1,]    6   16   26   36   46
[2,]    7   17   27   37   47
[3,]    8   18   28   38   48
[4,]    9   19   29   39   49
[5,]   10   20   30   40   50
> 
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
      [,1]  [,2]
 [1,] 1100 1e+04
 [2,] 1200 2e+04
 [3,] 1300 3e+04
 [4,] 1400 4e+04
 [5,] 1500 5e+04
 [6,] 1600 6e+04
 [7,] 1700 7e+04
 [8,] 1800 8e+04
 [9,] 1900 9e+04
[10,] 2000 1e+05
> 
> 
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
      [,1] [,2]  [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,] 1100 1100 1e+04   21   31   41   51   61   71    81
 [2,] 1200 1200 2e+04   22   32   42   52   62   72    82
 [3,] 1300 1300 3e+04   23   33   43   53   63   73    83
 [4,] 1400 1400 4e+04   24   34   44   54   64   74    84
 [5,] 1500 1500 5e+04   25   35   45   55   65   75    85
 [6,] 1600 1600 6e+04   26   36   46   56   66   76    86
 [7,] 1700 1700 7e+04   27   37   47   57   67   77    87
 [8,] 1800 1800 8e+04   28   38   48   58   68   78    88
 [9,] 1900 1900 9e+04   29   39   49   59   69   79    89
[10,] 2000 2000 1e+05   30   40   50   60   70   80    90
> 
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
> 
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
> 
> tmp3[1,] <- 1:10
> tmp3[1,]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    2    3    4    5    6    7    8    9    10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    2    1    2    1    2    1    2    1    2     1
[10,]    1    2    1    2    1    2    1    2    1     2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    1    2    3    4    5    6    7    8    9    10
 [2,]    1    2    1    2    1    2    1    2    1     2
 [3,]    2    1    2    1    2    1    2    1    2     1
 [4,]    1    2    1    2    1    2    1    2    1     2
 [5,]    2    1    2    1    2    1    2    1    2     1
 [6,]    1    2    1    2    1    2    1    2    1     2
 [7,]    2    1    2    1    2    1    2    1    2     1
 [8,]    1    2    1    2    1    2    1    2    1     2
 [9,]    1    3    5    2    4    1    3    5    2     4
[10,]    2    4    1    3    5    2    4    1    3     5
> 
> 
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
> 
> 
> 
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
> 
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478419 25.6    1047111   56   639600 34.2
Vcells 885237  6.8    8388608   64  2081604 15.9
> 
> 
> 
> 
> ##
> ## checking reads
> ##
> 
> tmp2 <- createBufferedMatrix(10,20)
> 
> test.sample <- rnorm(10*20)
> 
> tmp2[1:10,1:20] <- test.sample
> 
> test.matrix <- matrix(test.sample,10,20)
> 
> ## testing reads
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Sep 19 21:44:14 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Sep 19 21:44:14 2025"
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> 
> 
> RowMode(tmp2)
<pointer: 0x5ab7b582dc80>
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   which.col <- sample(1:20,1)
+   if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> 
> 
> date()
[1] "Fri Sep 19 21:44:14 2025"
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col <- sample(1:20,5,replace=TRUE)
+   if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+     cat("incorrect agreement")
+     break;
+   }
+ }
> date()
[1] "Fri Sep 19 21:44:14 2025"
> 
> ColMode(tmp2)
<pointer: 0x5ab7b582dc80>
> 
> 
> 
> ### Now testing assignments
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,1)
+ 
+   new.data <- rnorm(20)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,] <- new.data
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,1)
+   new.data <- rnorm(10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+ 
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.col <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[,which.col] <- new.data
+   test.matrix[,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.col <- which.col
+ }
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   new.data <- matrix(rnorm(50),5,10)
+   tmp2[which.row,] <- new.data
+   test.matrix[which.row,]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+ }
> 
> 
> 
> 
> 
> for (rep in 1:nreps){
+   which.row <- sample(1:10,5,replace=TRUE)
+   which.col  <- sample(1:20,5,replace=TRUE)
+   new.data <- matrix(rnorm(25),5,5)
+   tmp2[which.row,which.col] <- new.data
+   test.matrix[which.row,which.col]<- new.data
+   
+   if (rep > 1){
+     if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+       cat("incorrect agreement")
+       break;
+     }
+   }
+   prev.row <- which.row
+   prev.col <- which.col
+ }
> 
> 
> 
> 
> ###
> ###
> ### testing some more functions
> ###
> 
> 
> 
> ## duplication function
> tmp5 <- duplicate(tmp2)
> 
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
> 
> if (tmp5[1,1] == tmp2[1,1]){
+   stop("Problem with duplication")
+ }
> 
> 
> 
> 
> ### testing elementwise applying of functions
> 
> tmp5[1:4,1:4]
           [,1]       [,2]       [,3]      [,4]
[1,] 98.7326315  1.1105519 -0.4721793 0.7611570
[2,]  0.5873730  0.9457347 -2.2454939 0.8199447
[3,]  0.3075487 -0.9163238 -2.0309370 0.6465458
[4,] -0.4364891  0.4239940 -1.0382069 0.4614980
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
           [,1]      [,2]      [,3]      [,4]
[1,] 98.7326315 1.1105519 0.4721793 0.7611570
[2,]  0.5873730 0.9457347 2.2454939 0.8199447
[3,]  0.3075487 0.9163238 2.0309370 0.6465458
[4,]  0.4364891 0.4239940 1.0382069 0.4614980
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]      [,2]     [,3]      [,4]
[1,] 9.9364295 1.0538273 0.687153 0.8724431
[2,] 0.7664026 0.9724889 1.498497 0.9055080
[3,] 0.5545708 0.9572480 1.425109 0.8040807
[4,] 0.6606732 0.6511482 1.018924 0.6793364
> 
> my.function <- function(x,power){
+   (x+5)^power
+ }
> 
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size:  10 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  1.6  Kilobytes.
> tmp5[1:4,1:4]
          [,1]     [,2]     [,3]     [,4]
[1,] 223.09693 36.64882 32.34371 34.48559
[2,]  33.25140 35.67062 42.23047 34.87502
[3,]  30.85326 35.48880 41.28203 33.68735
[4,]  32.04322 31.93548 36.22745 32.25486
> 
> 
> 
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5ab7b7a063a0>
> exp(tmp5)
<pointer: 0x5ab7b7a063a0>
> log(tmp5,2)
<pointer: 0x5ab7b7a063a0>
> pow(tmp5,2)
> 
> 
> 
> 
> 
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.347
> Min(tmp5)
[1] 54.05447
> mean(tmp5)
[1] 72.79453
> Sum(tmp5)
[1] 14558.91
> Var(tmp5)
[1] 841.0103
> 
> 
> ## testing functions applied to rows or columns
> 
> rowMeans(tmp5)
 [1] 91.36539 70.13398 71.08437 71.07895 71.39432 70.39145 68.43489 70.11810
 [9] 72.30568 71.63817
> rowSums(tmp5)
 [1] 1827.308 1402.680 1421.687 1421.579 1427.886 1407.829 1368.698 1402.362
 [9] 1446.114 1432.763
> rowVars(tmp5)
 [1] 7768.82680   82.61319  104.81410   58.90668   68.07827   72.58365
 [7]   57.93677   59.49015   75.91115   45.31091
> rowSd(tmp5)
 [1] 88.140948  9.089180 10.237876  7.675069  8.250955  8.519604  7.611621
 [8]  7.712986  8.712701  6.731338
> rowMax(tmp5)
 [1] 464.34702  87.89718  88.75825  83.67524  90.87141  86.93286  81.30415
 [8]  84.68732  86.69583  88.69827
> rowMin(tmp5)
 [1] 54.79606 54.05447 55.89786 56.30328 58.12405 54.47849 55.96996 55.91503
 [9] 60.49822 61.94852
> 
> colMeans(tmp5)
 [1] 110.24236  70.93357  72.36805  69.76689  67.87902  71.43429  72.13215
 [8]  68.97265  69.49851  74.58319  69.92836  67.54115  71.08247  73.68958
[15]  71.97338  68.94915  68.26119  70.66470  73.48261  72.50733
> colSums(tmp5)
 [1] 1102.4236  709.3357  723.6805  697.6689  678.7902  714.3429  721.3215
 [8]  689.7265  694.9851  745.8319  699.2836  675.4115  710.8247  736.8958
[15]  719.7338  689.4915  682.6119  706.6470  734.8261  725.0733
> colVars(tmp5)
 [1] 15507.40990    37.89299    87.83929    64.89381    56.38343    79.44920
 [7]    65.70311   111.39910    91.04898    63.53503    84.36196    58.88267
[13]   125.53834    65.22367   117.24802    96.26133    35.56202    51.41245
[19]    46.69111    25.68837
> colSd(tmp5)
 [1] 124.528751   6.155728   9.372261   8.055669   7.508890   8.913428
 [7]   8.105745  10.554577   9.541959   7.970886   9.184877   7.673505
[13]  11.204389   8.076117  10.828112   9.811286   5.963390   7.170248
[19]   6.833089   5.068370
> colMax(tmp5)
 [1] 464.34702  79.37061  87.89718  83.56636  78.70786  82.21385  86.93286
 [8]  88.69827  84.68732  86.15303  88.75825  77.16229  90.87141  83.94293
[15]  86.69583  87.50287  78.96075  84.01942  81.39327  78.83089
> colMin(tmp5)
 [1] 64.21701 60.26852 59.17136 55.91503 58.03564 54.05447 62.70877 56.02754
 [9] 56.20140 57.93377 60.67902 54.47849 54.79606 57.18692 55.89786 55.96996
[17] 60.60588 60.12819 58.96501 64.58590
> 
> 
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
> 
> 
> which.row <- sample(1:10,1,replace=TRUE)
> which.col  <- sample(1:20,1,replace=TRUE)
> 
> tmp5[which.row,which.col] <- NA
> 
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
> 
> rowMeans(tmp5)
 [1] 91.36539 70.13398 71.08437       NA 71.39432 70.39145 68.43489 70.11810
 [9] 72.30568 71.63817
> rowSums(tmp5)
 [1] 1827.308 1402.680 1421.687       NA 1427.886 1407.829 1368.698 1402.362
 [9] 1446.114 1432.763
> rowVars(tmp5)
 [1] 7768.82680   82.61319  104.81410   61.08601   68.07827   72.58365
 [7]   57.93677   59.49015   75.91115   45.31091
> rowSd(tmp5)
 [1] 88.140948  9.089180 10.237876  7.815754  8.250955  8.519604  7.611621
 [8]  7.712986  8.712701  6.731338
> rowMax(tmp5)
 [1] 464.34702  87.89718  88.75825        NA  90.87141  86.93286  81.30415
 [8]  84.68732  86.69583  88.69827
> rowMin(tmp5)
 [1] 54.79606 54.05447 55.89786       NA 58.12405 54.47849 55.96996 55.91503
 [9] 60.49822 61.94852
> 
> colMeans(tmp5)
 [1] 110.24236  70.93357        NA  69.76689  67.87902  71.43429  72.13215
 [8]  68.97265  69.49851  74.58319  69.92836  67.54115  71.08247  73.68958
[15]  71.97338  68.94915  68.26119  70.66470  73.48261  72.50733
> colSums(tmp5)
 [1] 1102.4236  709.3357        NA  697.6689  678.7902  714.3429  721.3215
 [8]  689.7265  694.9851  745.8319  699.2836  675.4115  710.8247  736.8958
[15]  719.7338  689.4915  682.6119  706.6470  734.8261  725.0733
> colVars(tmp5)
 [1] 15507.40990    37.89299          NA    64.89381    56.38343    79.44920
 [7]    65.70311   111.39910    91.04898    63.53503    84.36196    58.88267
[13]   125.53834    65.22367   117.24802    96.26133    35.56202    51.41245
[19]    46.69111    25.68837
> colSd(tmp5)
 [1] 124.528751   6.155728         NA   8.055669   7.508890   8.913428
 [7]   8.105745  10.554577   9.541959   7.970886   9.184877   7.673505
[13]  11.204389   8.076117  10.828112   9.811286   5.963390   7.170248
[19]   6.833089   5.068370
> colMax(tmp5)
 [1] 464.34702  79.37061        NA  83.56636  78.70786  82.21385  86.93286
 [8]  88.69827  84.68732  86.15303  88.75825  77.16229  90.87141  83.94293
[15]  86.69583  87.50287  78.96075  84.01942  81.39327  78.83089
> colMin(tmp5)
 [1] 64.21701 60.26852       NA 55.91503 58.03564 54.05447 62.70877 56.02754
 [9] 56.20140 57.93377 60.67902 54.47849 54.79606 57.18692 55.89786 55.96996
[17] 60.60588 60.12819 58.96501 64.58590
> 
> Max(tmp5,na.rm=TRUE)
[1] 464.347
> Min(tmp5,na.rm=TRUE)
[1] 54.05447
> mean(tmp5,na.rm=TRUE)
[1] 72.78142
> Sum(tmp5,na.rm=TRUE)
[1] 14483.5
> Var(tmp5,na.rm=TRUE)
[1] 845.2233
> 
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.36539 70.13398 71.08437 70.85138 71.39432 70.39145 68.43489 70.11810
 [9] 72.30568 71.63817
> rowSums(tmp5,na.rm=TRUE)
 [1] 1827.308 1402.680 1421.687 1346.176 1427.886 1407.829 1368.698 1402.362
 [9] 1446.114 1432.763
> rowVars(tmp5,na.rm=TRUE)
 [1] 7768.82680   82.61319  104.81410   61.08601   68.07827   72.58365
 [7]   57.93677   59.49015   75.91115   45.31091
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.140948  9.089180 10.237876  7.815754  8.250955  8.519604  7.611621
 [8]  7.712986  8.712701  6.731338
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.34702  87.89718  88.75825  83.67524  90.87141  86.93286  81.30415
 [8]  84.68732  86.69583  88.69827
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.79606 54.05447 55.89786 56.30328 58.12405 54.47849 55.96996 55.91503
 [9] 60.49822 61.94852
> 
> colMeans(tmp5,na.rm=TRUE)
 [1] 110.24236  70.93357  72.03087  69.76689  67.87902  71.43429  72.13215
 [8]  68.97265  69.49851  74.58319  69.92836  67.54115  71.08247  73.68958
[15]  71.97338  68.94915  68.26119  70.66470  73.48261  72.50733
> colSums(tmp5,na.rm=TRUE)
 [1] 1102.4236  709.3357  648.2778  697.6689  678.7902  714.3429  721.3215
 [8]  689.7265  694.9851  745.8319  699.2836  675.4115  710.8247  736.8958
[15]  719.7338  689.4915  682.6119  706.6470  734.8261  725.0733
> colVars(tmp5,na.rm=TRUE)
 [1] 15507.40990    37.89299    97.54016    64.89381    56.38343    79.44920
 [7]    65.70311   111.39910    91.04898    63.53503    84.36196    58.88267
[13]   125.53834    65.22367   117.24802    96.26133    35.56202    51.41245
[19]    46.69111    25.68837
> colSd(tmp5,na.rm=TRUE)
 [1] 124.528751   6.155728   9.876242   8.055669   7.508890   8.913428
 [7]   8.105745  10.554577   9.541959   7.970886   9.184877   7.673505
[13]  11.204389   8.076117  10.828112   9.811286   5.963390   7.170248
[19]   6.833089   5.068370
> colMax(tmp5,na.rm=TRUE)
 [1] 464.34702  79.37061  87.89718  83.56636  78.70786  82.21385  86.93286
 [8]  88.69827  84.68732  86.15303  88.75825  77.16229  90.87141  83.94293
[15]  86.69583  87.50287  78.96075  84.01942  81.39327  78.83089
> colMin(tmp5,na.rm=TRUE)
 [1] 64.21701 60.26852 59.17136 55.91503 58.03564 54.05447 62.70877 56.02754
 [9] 56.20140 57.93377 60.67902 54.47849 54.79606 57.18692 55.89786 55.96996
[17] 60.60588 60.12819 58.96501 64.58590
> 
> # now set an entire row to NA
> 
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
 [1] 91.36539 70.13398 71.08437      NaN 71.39432 70.39145 68.43489 70.11810
 [9] 72.30568 71.63817
> rowSums(tmp5,na.rm=TRUE)
 [1] 1827.308 1402.680 1421.687    0.000 1427.886 1407.829 1368.698 1402.362
 [9] 1446.114 1432.763
> rowVars(tmp5,na.rm=TRUE)
 [1] 7768.82680   82.61319  104.81410         NA   68.07827   72.58365
 [7]   57.93677   59.49015   75.91115   45.31091
> rowSd(tmp5,na.rm=TRUE)
 [1] 88.140948  9.089180 10.237876        NA  8.250955  8.519604  7.611621
 [8]  7.712986  8.712701  6.731338
> rowMax(tmp5,na.rm=TRUE)
 [1] 464.34702  87.89718  88.75825        NA  90.87141  86.93286  81.30415
 [8]  84.68732  86.69583  88.69827
> rowMin(tmp5,na.rm=TRUE)
 [1] 54.79606 54.05447 55.89786       NA 58.12405 54.47849 55.96996 55.91503
 [9] 60.49822 61.94852
> 
> 
> # now set an entire col to NA
> 
> 
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
 [1] 115.08110  71.42957       NaN  70.05940  67.47244  71.32052  71.25884
 [8]  67.54611  69.70410  74.43230  68.57029  68.02370  71.64869  72.58006
[15]  72.11915  70.35425  67.97674  71.83542  72.87194  73.38749
> colSums(tmp5,na.rm=TRUE)
 [1] 1035.7299  642.8662    0.0000  630.5346  607.2520  641.8846  641.3296
 [8]  607.9150  627.3369  669.8907  617.1326  612.2133  644.8382  653.2206
[15]  649.0724  633.1882  611.7907  646.5188  655.8475  660.4874
> colVars(tmp5,na.rm=TRUE)
 [1] 17182.43611    39.86186          NA    72.04294    61.57170    89.23473
 [7]    65.33596   102.43007   101.95460    71.22077    74.15828    63.62333
[13]   137.62377    59.52755   131.66496    86.08315    39.09702    42.41983
[19]    48.33223    20.18427
> colSd(tmp5,na.rm=TRUE)
 [1] 131.081792   6.313625         NA   8.487811   7.846763   9.446414
 [7]   8.083066  10.120774  10.097257   8.439240   8.611520   7.976424
[13]  11.731316   7.715410  11.474535   9.278101   6.252761   6.513051
[19]   6.952139   4.492691
> colMax(tmp5,na.rm=TRUE)
 [1] 464.34702  79.37061      -Inf  83.56636  78.70786  82.21385  86.93286
 [8]  88.69827  84.68732  86.15303  88.75825  77.16229  90.87141  83.94293
[15]  86.69583  87.50287  78.96075  84.01942  81.39327  78.83089
> colMin(tmp5,na.rm=TRUE)
 [1] 64.21701 60.26852      Inf 55.91503 58.03564 54.05447 62.70877 56.02754
 [9] 56.20140 57.93377 60.67902 54.47849 54.79606 57.18692 55.89786 55.96996
[17] 60.60588 62.20560 58.96501 66.64893
> 
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 3
> which.col  <- 1
> cat(which.row," ",which.col,"\n")
3   1 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> rowVars(tmp5,na.rm=TRUE)
 [1] 222.4127 166.2816 238.2791 257.3970 203.0452 244.5632 256.9660 280.7123
 [9] 248.9325 247.5318
> apply(copymatrix,1,var,na.rm=TRUE)
 [1] 222.4127 166.2816 238.2791 257.3970 203.0452 244.5632 256.9660 280.7123
 [9] 248.9325 247.5318
> 
> 
> 
> copymatrix <- matrix(rnorm(200,150,15),10,20)
> 
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col  <- 3
> cat(which.row," ",which.col,"\n")
1   3 
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
> 
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
 [1] -1.705303e-13  0.000000e+00 -4.263256e-14  1.421085e-13  1.136868e-13
 [6] -1.421085e-13  5.684342e-14 -2.557954e-13  0.000000e+00  0.000000e+00
[11]  1.136868e-13  0.000000e+00  2.842171e-14 -5.684342e-14  2.842171e-14
[16] -5.684342e-14  8.526513e-14  3.410605e-13  2.842171e-14 -1.421085e-14
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ## making sure these things agree
> ##
> ## first when there is no NA
> 
> 
> 
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+ 
+   if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Max")
+   }
+   
+ 
+   if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+     stop("No agreement in Min")
+   }
+ 
+ 
+   if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+ 
+     cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+     cat(sum(r.matrix,na.rm=TRUE),"\n")
+     cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+     
+     stop("No agreement in Sum")
+   }
+   
+   if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+     stop("No agreement in mean")
+   }
+   
+   
+   if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+     stop("No agreement in Var")
+   }
+   
+   
+ 
+   if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowMeans")
+   }
+   
+   
+   if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colMeans")
+   }
+   
+   
+   if(any(abs(rowSums(buff.matrix,na.rm=TRUE)  -  apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in rowSums")
+   }
+   
+   
+   if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+     stop("No agreement in colSums")
+   }
+   
+   ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when 
+   ### computing variance
+   my.Var <- function(x,na.rm=FALSE){
+    if (all(is.na(x))){
+      return(NA)
+    } else {
+      var(x,na.rm=na.rm)
+    }
+ 
+   }
+   
+   if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+   
+   
+   if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in rowVars")
+   }
+ 
+ 
+   if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+ 
+   if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMax")
+   }
+   
+   
+   
+   if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+   
+ 
+   if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE))  > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMin")
+   }
+ 
+   if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colMedian")
+   }
+ 
+   if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+     stop("No agreement in colRanges")
+   }
+ 
+ 
+   
+ }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> for (rep in 1:20){
+   copymatrix <- matrix(rnorm(200,150,15),10,20)
+   
+   tmp5[1:10,1:20] <- copymatrix
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ## now lets assign some NA values and check agreement
+ 
+   which.row <- sample(1:10,1,replace=TRUE)
+   which.col  <- sample(1:20,1,replace=TRUE)
+   
+   cat(which.row," ",which.col,"\n")
+   
+   tmp5[which.row,which.col] <- NA
+   copymatrix[which.row,which.col] <- NA
+   
+   agree.checks(tmp5,copymatrix)
+ 
+   ## make an entire row NA
+   tmp5[which.row,] <- NA
+   copymatrix[which.row,] <- NA
+ 
+ 
+   agree.checks(tmp5,copymatrix)
+   
+   ### also make an entire col NA
+   tmp5[,which.col] <- NA
+   copymatrix[,which.col] <- NA
+ 
+   agree.checks(tmp5,copymatrix)
+ 
+   ### now make 1 element non NA with NA in the rest of row and column
+ 
+   tmp5[which.row,which.col] <- rnorm(1,150,15)
+   copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+ 
+   agree.checks(tmp5,copymatrix)
+ }
6   7 
7   10 
9   8 
7   17 
3   9 
10   11 
9   16 
4   20 
1   18 
9   19 
4   10 
1   18 
9   10 
5   11 
6   2 
3   16 
3   4 
8   10 
10   10 
9   16 
There were 50 or more warnings (use warnings() to see the first 50)
> 
> 
> ### now test 1 by n and n by 1 matrix
> 
> 
> err.tol <- 1e-12
> 
> rm(tmp5)
> 
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
> 
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
> 
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
> 
> 
> 
> 
> 
> Max(tmp)
[1] 2.024729
> Min(tmp)
[1] -2.602445
> mean(tmp)
[1] -0.1051737
> Sum(tmp)
[1] -10.51737
> Var(tmp)
[1] 0.961802
> 
> rowMeans(tmp)
[1] -0.1051737
> rowSums(tmp)
[1] -10.51737
> rowVars(tmp)
[1] 0.961802
> rowSd(tmp)
[1] 0.980715
> rowMax(tmp)
[1] 2.024729
> rowMin(tmp)
[1] -2.602445
> 
> colMeans(tmp)
  [1] -1.40633775 -1.79618079 -1.47718494  0.45192165 -1.66541611 -0.13885303
  [7]  0.27557157  0.80426732  0.45991560  1.19065629  0.21806316 -0.91848619
 [13] -0.59154579  0.46202926 -0.01756290 -0.31442762 -1.40495020 -2.60244505
 [19] -0.70305064  0.41881810 -0.78791410  1.13622343 -0.29247071 -0.23194318
 [25]  1.36142087 -0.02687450 -1.06404108  0.64888684 -0.80305052 -1.08885004
 [31] -0.41590275  1.07182823 -0.36006377 -0.30757730 -0.71430010  0.09584704
 [37] -0.07078363  0.10933690  0.75503061  1.32537420  0.78072696 -1.33306592
 [43] -0.33909259 -0.66114830 -0.94691268 -1.00277085  0.75134776 -0.73540594
 [49]  0.74770775  0.31254873  0.59304994 -1.68272326  0.46918808 -0.15343097
 [55] -1.73769497  0.14210630  1.65433617 -1.69628074  0.48478740 -0.90510333
 [61]  1.03753969  2.02472861  0.97811835 -0.76426644 -1.16606155  0.23815541
 [67] -0.52690539 -0.09620834  0.30690339 -1.28307766  0.44218823  0.14480759
 [73] -0.69135718  0.80597187 -0.74988102 -2.23232589 -0.62858970  0.18746369
 [79]  0.09311717 -0.21636931 -0.35269183  0.21341975  1.90682229  0.03747795
 [85] -0.47651755  1.10613276 -0.80901798 -0.30261732  1.50497586  1.69691912
 [91]  1.12169485  1.61810767  0.04760222  1.49581101 -0.66265204 -0.71043579
 [97]  0.97929286 -1.24580781 -1.69672749 -0.22025638
> colSums(tmp)
  [1] -1.40633775 -1.79618079 -1.47718494  0.45192165 -1.66541611 -0.13885303
  [7]  0.27557157  0.80426732  0.45991560  1.19065629  0.21806316 -0.91848619
 [13] -0.59154579  0.46202926 -0.01756290 -0.31442762 -1.40495020 -2.60244505
 [19] -0.70305064  0.41881810 -0.78791410  1.13622343 -0.29247071 -0.23194318
 [25]  1.36142087 -0.02687450 -1.06404108  0.64888684 -0.80305052 -1.08885004
 [31] -0.41590275  1.07182823 -0.36006377 -0.30757730 -0.71430010  0.09584704
 [37] -0.07078363  0.10933690  0.75503061  1.32537420  0.78072696 -1.33306592
 [43] -0.33909259 -0.66114830 -0.94691268 -1.00277085  0.75134776 -0.73540594
 [49]  0.74770775  0.31254873  0.59304994 -1.68272326  0.46918808 -0.15343097
 [55] -1.73769497  0.14210630  1.65433617 -1.69628074  0.48478740 -0.90510333
 [61]  1.03753969  2.02472861  0.97811835 -0.76426644 -1.16606155  0.23815541
 [67] -0.52690539 -0.09620834  0.30690339 -1.28307766  0.44218823  0.14480759
 [73] -0.69135718  0.80597187 -0.74988102 -2.23232589 -0.62858970  0.18746369
 [79]  0.09311717 -0.21636931 -0.35269183  0.21341975  1.90682229  0.03747795
 [85] -0.47651755  1.10613276 -0.80901798 -0.30261732  1.50497586  1.69691912
 [91]  1.12169485  1.61810767  0.04760222  1.49581101 -0.66265204 -0.71043579
 [97]  0.97929286 -1.24580781 -1.69672749 -0.22025638
> colVars(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
  [1] -1.40633775 -1.79618079 -1.47718494  0.45192165 -1.66541611 -0.13885303
  [7]  0.27557157  0.80426732  0.45991560  1.19065629  0.21806316 -0.91848619
 [13] -0.59154579  0.46202926 -0.01756290 -0.31442762 -1.40495020 -2.60244505
 [19] -0.70305064  0.41881810 -0.78791410  1.13622343 -0.29247071 -0.23194318
 [25]  1.36142087 -0.02687450 -1.06404108  0.64888684 -0.80305052 -1.08885004
 [31] -0.41590275  1.07182823 -0.36006377 -0.30757730 -0.71430010  0.09584704
 [37] -0.07078363  0.10933690  0.75503061  1.32537420  0.78072696 -1.33306592
 [43] -0.33909259 -0.66114830 -0.94691268 -1.00277085  0.75134776 -0.73540594
 [49]  0.74770775  0.31254873  0.59304994 -1.68272326  0.46918808 -0.15343097
 [55] -1.73769497  0.14210630  1.65433617 -1.69628074  0.48478740 -0.90510333
 [61]  1.03753969  2.02472861  0.97811835 -0.76426644 -1.16606155  0.23815541
 [67] -0.52690539 -0.09620834  0.30690339 -1.28307766  0.44218823  0.14480759
 [73] -0.69135718  0.80597187 -0.74988102 -2.23232589 -0.62858970  0.18746369
 [79]  0.09311717 -0.21636931 -0.35269183  0.21341975  1.90682229  0.03747795
 [85] -0.47651755  1.10613276 -0.80901798 -0.30261732  1.50497586  1.69691912
 [91]  1.12169485  1.61810767  0.04760222  1.49581101 -0.66265204 -0.71043579
 [97]  0.97929286 -1.24580781 -1.69672749 -0.22025638
> colMin(tmp)
  [1] -1.40633775 -1.79618079 -1.47718494  0.45192165 -1.66541611 -0.13885303
  [7]  0.27557157  0.80426732  0.45991560  1.19065629  0.21806316 -0.91848619
 [13] -0.59154579  0.46202926 -0.01756290 -0.31442762 -1.40495020 -2.60244505
 [19] -0.70305064  0.41881810 -0.78791410  1.13622343 -0.29247071 -0.23194318
 [25]  1.36142087 -0.02687450 -1.06404108  0.64888684 -0.80305052 -1.08885004
 [31] -0.41590275  1.07182823 -0.36006377 -0.30757730 -0.71430010  0.09584704
 [37] -0.07078363  0.10933690  0.75503061  1.32537420  0.78072696 -1.33306592
 [43] -0.33909259 -0.66114830 -0.94691268 -1.00277085  0.75134776 -0.73540594
 [49]  0.74770775  0.31254873  0.59304994 -1.68272326  0.46918808 -0.15343097
 [55] -1.73769497  0.14210630  1.65433617 -1.69628074  0.48478740 -0.90510333
 [61]  1.03753969  2.02472861  0.97811835 -0.76426644 -1.16606155  0.23815541
 [67] -0.52690539 -0.09620834  0.30690339 -1.28307766  0.44218823  0.14480759
 [73] -0.69135718  0.80597187 -0.74988102 -2.23232589 -0.62858970  0.18746369
 [79]  0.09311717 -0.21636931 -0.35269183  0.21341975  1.90682229  0.03747795
 [85] -0.47651755  1.10613276 -0.80901798 -0.30261732  1.50497586  1.69691912
 [91]  1.12169485  1.61810767  0.04760222  1.49581101 -0.66265204 -0.71043579
 [97]  0.97929286 -1.24580781 -1.69672749 -0.22025638
> colMedians(tmp)
  [1] -1.40633775 -1.79618079 -1.47718494  0.45192165 -1.66541611 -0.13885303
  [7]  0.27557157  0.80426732  0.45991560  1.19065629  0.21806316 -0.91848619
 [13] -0.59154579  0.46202926 -0.01756290 -0.31442762 -1.40495020 -2.60244505
 [19] -0.70305064  0.41881810 -0.78791410  1.13622343 -0.29247071 -0.23194318
 [25]  1.36142087 -0.02687450 -1.06404108  0.64888684 -0.80305052 -1.08885004
 [31] -0.41590275  1.07182823 -0.36006377 -0.30757730 -0.71430010  0.09584704
 [37] -0.07078363  0.10933690  0.75503061  1.32537420  0.78072696 -1.33306592
 [43] -0.33909259 -0.66114830 -0.94691268 -1.00277085  0.75134776 -0.73540594
 [49]  0.74770775  0.31254873  0.59304994 -1.68272326  0.46918808 -0.15343097
 [55] -1.73769497  0.14210630  1.65433617 -1.69628074  0.48478740 -0.90510333
 [61]  1.03753969  2.02472861  0.97811835 -0.76426644 -1.16606155  0.23815541
 [67] -0.52690539 -0.09620834  0.30690339 -1.28307766  0.44218823  0.14480759
 [73] -0.69135718  0.80597187 -0.74988102 -2.23232589 -0.62858970  0.18746369
 [79]  0.09311717 -0.21636931 -0.35269183  0.21341975  1.90682229  0.03747795
 [85] -0.47651755  1.10613276 -0.80901798 -0.30261732  1.50497586  1.69691912
 [91]  1.12169485  1.61810767  0.04760222  1.49581101 -0.66265204 -0.71043579
 [97]  0.97929286 -1.24580781 -1.69672749 -0.22025638
> colRanges(tmp)
          [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
[1,] -1.406338 -1.796181 -1.477185 0.4519216 -1.665416 -0.138853 0.2755716
[2,] -1.406338 -1.796181 -1.477185 0.4519216 -1.665416 -0.138853 0.2755716
          [,8]      [,9]    [,10]     [,11]      [,12]      [,13]     [,14]
[1,] 0.8042673 0.4599156 1.190656 0.2180632 -0.9184862 -0.5915458 0.4620293
[2,] 0.8042673 0.4599156 1.190656 0.2180632 -0.9184862 -0.5915458 0.4620293
          [,15]      [,16]    [,17]     [,18]      [,19]     [,20]      [,21]
[1,] -0.0175629 -0.3144276 -1.40495 -2.602445 -0.7030506 0.4188181 -0.7879141
[2,] -0.0175629 -0.3144276 -1.40495 -2.602445 -0.7030506 0.4188181 -0.7879141
        [,22]      [,23]      [,24]    [,25]      [,26]     [,27]     [,28]
[1,] 1.136223 -0.2924707 -0.2319432 1.361421 -0.0268745 -1.064041 0.6488868
[2,] 1.136223 -0.2924707 -0.2319432 1.361421 -0.0268745 -1.064041 0.6488868
          [,29]    [,30]      [,31]    [,32]      [,33]      [,34]      [,35]
[1,] -0.8030505 -1.08885 -0.4159028 1.071828 -0.3600638 -0.3075773 -0.7143001
[2,] -0.8030505 -1.08885 -0.4159028 1.071828 -0.3600638 -0.3075773 -0.7143001
          [,36]       [,37]     [,38]     [,39]    [,40]    [,41]     [,42]
[1,] 0.09584704 -0.07078363 0.1093369 0.7550306 1.325374 0.780727 -1.333066
[2,] 0.09584704 -0.07078363 0.1093369 0.7550306 1.325374 0.780727 -1.333066
          [,43]      [,44]      [,45]     [,46]     [,47]      [,48]     [,49]
[1,] -0.3390926 -0.6611483 -0.9469127 -1.002771 0.7513478 -0.7354059 0.7477078
[2,] -0.3390926 -0.6611483 -0.9469127 -1.002771 0.7513478 -0.7354059 0.7477078
         [,50]     [,51]     [,52]     [,53]     [,54]     [,55]     [,56]
[1,] 0.3125487 0.5930499 -1.682723 0.4691881 -0.153431 -1.737695 0.1421063
[2,] 0.3125487 0.5930499 -1.682723 0.4691881 -0.153431 -1.737695 0.1421063
        [,57]     [,58]     [,59]      [,60]   [,61]    [,62]     [,63]
[1,] 1.654336 -1.696281 0.4847874 -0.9051033 1.03754 2.024729 0.9781183
[2,] 1.654336 -1.696281 0.4847874 -0.9051033 1.03754 2.024729 0.9781183
          [,64]     [,65]     [,66]      [,67]       [,68]     [,69]     [,70]
[1,] -0.7642664 -1.166062 0.2381554 -0.5269054 -0.09620834 0.3069034 -1.283078
[2,] -0.7642664 -1.166062 0.2381554 -0.5269054 -0.09620834 0.3069034 -1.283078
         [,71]     [,72]      [,73]     [,74]     [,75]     [,76]      [,77]
[1,] 0.4421882 0.1448076 -0.6913572 0.8059719 -0.749881 -2.232326 -0.6285897
[2,] 0.4421882 0.1448076 -0.6913572 0.8059719 -0.749881 -2.232326 -0.6285897
         [,78]      [,79]      [,80]      [,81]     [,82]    [,83]      [,84]
[1,] 0.1874637 0.09311717 -0.2163693 -0.3526918 0.2134197 1.906822 0.03747795
[2,] 0.1874637 0.09311717 -0.2163693 -0.3526918 0.2134197 1.906822 0.03747795
          [,85]    [,86]     [,87]      [,88]    [,89]    [,90]    [,91]
[1,] -0.4765176 1.106133 -0.809018 -0.3026173 1.504976 1.696919 1.121695
[2,] -0.4765176 1.106133 -0.809018 -0.3026173 1.504976 1.696919 1.121695
        [,92]      [,93]    [,94]     [,95]      [,96]     [,97]     [,98]
[1,] 1.618108 0.04760222 1.495811 -0.662652 -0.7104358 0.9792929 -1.245808
[2,] 1.618108 0.04760222 1.495811 -0.662652 -0.7104358 0.9792929 -1.245808
         [,99]     [,100]
[1,] -1.696727 -0.2202564
[2,] -1.696727 -0.2202564
> 
> 
> Max(tmp2)
[1] 2.472231
> Min(tmp2)
[1] -2.670875
> mean(tmp2)
[1] 0.1922155
> Sum(tmp2)
[1] 19.22155
> Var(tmp2)
[1] 1.144631
> 
> rowMeans(tmp2)
  [1]  0.47406072  1.28408483  1.39429751 -0.98144861  0.21816018  0.29849073
  [7]  0.52234235  0.87362030  0.65775311  1.23642014  1.71235212  0.09072066
 [13]  1.45429063 -0.31369735  1.18200975  0.58886745  0.28140140  1.08906274
 [19]  1.57452667 -0.59998047  0.65462743 -0.80626606  0.08487879 -0.31339082
 [25]  1.99699443 -1.81500829  0.53979431  0.47441007  1.29916745  1.30087656
 [31]  0.54095369 -0.54019075 -0.73722672 -0.85631475  0.50010733  0.08012545
 [37] -2.09700706 -1.05732053 -0.18571945  1.45756552 -0.59329238  1.99102666
 [43]  0.68458684 -0.51691220  1.23698087  0.11641470 -0.92671221  0.80742888
 [49]  0.10890566  2.12883832  0.73621120  1.77396423 -0.28132342  2.47223053
 [55]  0.57668812 -1.15041238 -0.34554558 -0.38221576 -2.24410407 -1.73410256
 [61]  1.25426796 -0.66551378  0.19476858 -1.85214934 -1.30927061  0.14065215
 [67]  0.21331730  0.24565120  0.15420567 -0.61394188  0.22644856  0.52758330
 [73]  0.83297433  0.48460577  1.87264273 -0.50024258 -1.56839260  0.58436755
 [79] -0.49808384 -0.40418260 -2.67087465  0.23462947 -1.70495118  1.23491633
 [85]  0.04531587 -0.41328510  0.83581467  0.61478686 -1.33647797  1.37885763
 [91]  2.04035257 -0.76397490 -0.10173997 -0.58230138  0.54512546  0.54354007
 [97]  0.61604836 -1.22338182  1.36903014  1.22336375
> rowSums(tmp2)
  [1]  0.47406072  1.28408483  1.39429751 -0.98144861  0.21816018  0.29849073
  [7]  0.52234235  0.87362030  0.65775311  1.23642014  1.71235212  0.09072066
 [13]  1.45429063 -0.31369735  1.18200975  0.58886745  0.28140140  1.08906274
 [19]  1.57452667 -0.59998047  0.65462743 -0.80626606  0.08487879 -0.31339082
 [25]  1.99699443 -1.81500829  0.53979431  0.47441007  1.29916745  1.30087656
 [31]  0.54095369 -0.54019075 -0.73722672 -0.85631475  0.50010733  0.08012545
 [37] -2.09700706 -1.05732053 -0.18571945  1.45756552 -0.59329238  1.99102666
 [43]  0.68458684 -0.51691220  1.23698087  0.11641470 -0.92671221  0.80742888
 [49]  0.10890566  2.12883832  0.73621120  1.77396423 -0.28132342  2.47223053
 [55]  0.57668812 -1.15041238 -0.34554558 -0.38221576 -2.24410407 -1.73410256
 [61]  1.25426796 -0.66551378  0.19476858 -1.85214934 -1.30927061  0.14065215
 [67]  0.21331730  0.24565120  0.15420567 -0.61394188  0.22644856  0.52758330
 [73]  0.83297433  0.48460577  1.87264273 -0.50024258 -1.56839260  0.58436755
 [79] -0.49808384 -0.40418260 -2.67087465  0.23462947 -1.70495118  1.23491633
 [85]  0.04531587 -0.41328510  0.83581467  0.61478686 -1.33647797  1.37885763
 [91]  2.04035257 -0.76397490 -0.10173997 -0.58230138  0.54512546  0.54354007
 [97]  0.61604836 -1.22338182  1.36903014  1.22336375
> rowVars(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
  [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
  [1]  0.47406072  1.28408483  1.39429751 -0.98144861  0.21816018  0.29849073
  [7]  0.52234235  0.87362030  0.65775311  1.23642014  1.71235212  0.09072066
 [13]  1.45429063 -0.31369735  1.18200975  0.58886745  0.28140140  1.08906274
 [19]  1.57452667 -0.59998047  0.65462743 -0.80626606  0.08487879 -0.31339082
 [25]  1.99699443 -1.81500829  0.53979431  0.47441007  1.29916745  1.30087656
 [31]  0.54095369 -0.54019075 -0.73722672 -0.85631475  0.50010733  0.08012545
 [37] -2.09700706 -1.05732053 -0.18571945  1.45756552 -0.59329238  1.99102666
 [43]  0.68458684 -0.51691220  1.23698087  0.11641470 -0.92671221  0.80742888
 [49]  0.10890566  2.12883832  0.73621120  1.77396423 -0.28132342  2.47223053
 [55]  0.57668812 -1.15041238 -0.34554558 -0.38221576 -2.24410407 -1.73410256
 [61]  1.25426796 -0.66551378  0.19476858 -1.85214934 -1.30927061  0.14065215
 [67]  0.21331730  0.24565120  0.15420567 -0.61394188  0.22644856  0.52758330
 [73]  0.83297433  0.48460577  1.87264273 -0.50024258 -1.56839260  0.58436755
 [79] -0.49808384 -0.40418260 -2.67087465  0.23462947 -1.70495118  1.23491633
 [85]  0.04531587 -0.41328510  0.83581467  0.61478686 -1.33647797  1.37885763
 [91]  2.04035257 -0.76397490 -0.10173997 -0.58230138  0.54512546  0.54354007
 [97]  0.61604836 -1.22338182  1.36903014  1.22336375
> rowMin(tmp2)
  [1]  0.47406072  1.28408483  1.39429751 -0.98144861  0.21816018  0.29849073
  [7]  0.52234235  0.87362030  0.65775311  1.23642014  1.71235212  0.09072066
 [13]  1.45429063 -0.31369735  1.18200975  0.58886745  0.28140140  1.08906274
 [19]  1.57452667 -0.59998047  0.65462743 -0.80626606  0.08487879 -0.31339082
 [25]  1.99699443 -1.81500829  0.53979431  0.47441007  1.29916745  1.30087656
 [31]  0.54095369 -0.54019075 -0.73722672 -0.85631475  0.50010733  0.08012545
 [37] -2.09700706 -1.05732053 -0.18571945  1.45756552 -0.59329238  1.99102666
 [43]  0.68458684 -0.51691220  1.23698087  0.11641470 -0.92671221  0.80742888
 [49]  0.10890566  2.12883832  0.73621120  1.77396423 -0.28132342  2.47223053
 [55]  0.57668812 -1.15041238 -0.34554558 -0.38221576 -2.24410407 -1.73410256
 [61]  1.25426796 -0.66551378  0.19476858 -1.85214934 -1.30927061  0.14065215
 [67]  0.21331730  0.24565120  0.15420567 -0.61394188  0.22644856  0.52758330
 [73]  0.83297433  0.48460577  1.87264273 -0.50024258 -1.56839260  0.58436755
 [79] -0.49808384 -0.40418260 -2.67087465  0.23462947 -1.70495118  1.23491633
 [85]  0.04531587 -0.41328510  0.83581467  0.61478686 -1.33647797  1.37885763
 [91]  2.04035257 -0.76397490 -0.10173997 -0.58230138  0.54512546  0.54354007
 [97]  0.61604836 -1.22338182  1.36903014  1.22336375
> 
> colMeans(tmp2)
[1] 0.1922155
> colSums(tmp2)
[1] 19.22155
> colVars(tmp2)
[1] 1.144631
> colSd(tmp2)
[1] 1.069874
> colMax(tmp2)
[1] 2.472231
> colMin(tmp2)
[1] -2.670875
> colMedians(tmp2)
[1] 0.2401403
> colRanges(tmp2)
          [,1]
[1,] -2.670875
[2,]  2.472231
> 
> dataset1 <- matrix(dataset1,1,100)
> 
> agree.checks(tmp,dataset1)
> 
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>   
> 
> tmp <- createBufferedMatrix(10,10)
> 
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
 [1] -6.75192370  0.03026594 -7.20401416  6.37108064  1.08642364 -4.72514380
 [7]  1.33464348  0.68281391 -6.45846068 -0.01368186
> colApply(tmp,quantile)[,1]
           [,1]
[1,] -2.4923919
[2,] -1.1858608
[3,] -0.6181443
[4,]  0.0317341
[5,]  0.7083005
> 
> rowApply(tmp,sum)
 [1] -3.2354596 -3.2655118 -0.5223882  4.2708233  4.0917096 -1.7777760
 [7] -8.5760390 -2.7264982 -4.9954066  1.0885498
> rowApply(tmp,rank)[1:10,]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    3    1    3    1    7    4   10    1    6     5
 [2,]    4    6    9    5    2    3    9    5    9     9
 [3,]    7    3    1    4    5    7    1    4    2     3
 [4,]   10    4    8   10   10   10    6    8   10     7
 [5,]    6   10    5    2    8    9    5    2    4    10
 [6,]    1    2    2    7    4    6    8    6    3     2
 [7,]    8    8    6    8    6    2    4   10    7     6
 [8,]    9    9   10    3    3    8    3    9    8     4
 [9,]    2    5    7    6    1    1    2    7    5     1
[10,]    5    7    4    9    9    5    7    3    1     8
> 
> tmp <- createBufferedMatrix(5,20)
> 
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
 [1]  2.09197394 -0.05475772 -2.47649902  1.59841666  4.60306911 -2.67219245
 [7]  2.61680569  1.59540403  1.48708372 -1.69619632 -1.73209629  0.03001262
[13]  1.97838131  0.79919604 -0.65119728 -2.44100839 -2.72375653  0.31322155
[19]  2.69621590  0.64832648
> colApply(tmp,quantile)[,1]
            [,1]
[1,] -0.09800547
[2,]  0.41324677
[3,]  0.49079579
[4,]  0.58830327
[5,]  0.69763358
> 
> rowApply(tmp,sum)
[1]  0.3318162  7.4695267  3.0996745 -1.9704587 -2.9201556
> rowApply(tmp,rank)[1:5,]
     [,1] [,2] [,3] [,4] [,5]
[1,]   16   12   11   14   10
[2,]   14    5   18    6    7
[3,]   10   11   15    1    4
[4,]   13    8    4   20    9
[5,]   20   20    3   16   13
> 
> 
> as.matrix(tmp)
            [,1]       [,2]         [,3]        [,4]       [,5]       [,6]
[1,]  0.69763358  0.5746540 -0.001445276  0.33508876  1.5851973 -1.7049184
[2,]  0.41324677 -0.1853369  0.352686434  0.03806635  3.5196823 -0.3902767
[3,]  0.49079579  0.8366290  0.796686871 -0.59547204 -1.4678955 -0.1183710
[4,]  0.58830327 -0.6369136 -2.375254904  2.05360220  0.7573989 -1.3211785
[5,] -0.09800547 -0.6437902 -1.249172140 -0.23286861  0.2086861  0.8625521
           [,7]        [,8]       [,9]      [,10]      [,11]      [,12]
[1,]  0.9366709  0.32642870 -0.2091510 -0.8053469  0.6187535 -0.3987931
[2,]  0.7684387  0.63464188  0.5196688  0.6085126 -0.9740676 -0.4103718
[3,]  0.7784222 -0.10157409 -0.4651086  0.8059543 -1.7154486 -0.0332970
[4,] -0.6184246  0.68350649 -0.3492041 -1.1609252  0.0854019  0.3366356
[5,]  0.7516985  0.05240104  1.9908786 -1.1443911  0.2532644  0.5358389
          [,13]      [,14]      [,15]      [,16]       [,17]      [,18]
[1,] -0.2062340  0.9335060 -1.2223262 -0.2577248 -1.23406133 -1.2915978
[2,]  0.8309751  0.8827462 -0.1398323  0.2044594 -0.33742725 -0.1838894
[3,]  2.2422880  0.8269863  0.7017116 -2.1073413 -0.08232518  1.2249720
[4,]  1.1843985 -1.4327243  1.1974601 -1.9182597  0.36136409 -0.3953324
[5,] -2.0730463 -0.4113182 -1.1882105  1.6378581 -1.43130686  0.9590691
          [,19]       [,20]
[1,]  1.3916971  0.26378489
[2,]  1.2743389  0.04326524
[3,]  0.6807716  0.40129016
[4,]  1.1789960 -0.18930823
[5,] -1.8295876  0.12929443
> 
> 
> is.BufferedMatrix(tmp)
[1] TRUE
> 
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size:  5 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  800  bytes.
> 
> 
> 
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size:  5 5 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  647  bytes.
Disk usage :  200  bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size:  5 4 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  562  bytes.
Disk usage :  160  bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size:  3 20 
Buffer size:  1 1 
Directory:    /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests 
Prefix:       BM 
Mode: Col mode
Read Only: FALSE
Memory usage :  1.9  Kilobytes.
Disk usage :  480  bytes.
> 
> 
> rm(tmp)
> 
> 
> ###
> ### Testing colnames and rownames
> ###
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> 
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> tmp["row1",]
           col1     col2      col3      col4      col5      col6     col7
row1 -0.7715115 1.669287 0.5651151 -0.798174 0.0349803 -1.135397 1.722266
         col8       col9 col10     col11     col12     col13      col14
row1 1.121376 -0.1350712 1.388 0.5321473 0.9732843 0.1658046 -0.2265853
         col15    col16     col17      col18     col19     col20
row1 -1.445063 1.350553 -1.341845 -0.9520076 -1.315603 -1.421306
> tmp[,"col10"]
         col10
row1  1.388000
row2 -1.490695
row3 -1.089344
row4  2.030809
row5  1.511265
> tmp[c("row1","row5"),]
           col1       col2      col3      col4       col5      col6     col7
row1 -0.7715115  1.6692866 0.5651151 -0.798174  0.0349803 -1.135397 1.722266
row5  0.6261261 -0.6211527 0.5791498  1.113978 -1.4964956  2.319727 1.548727
          col8       col9    col10     col11      col12      col13      col14
row1 1.1213761 -0.1350712 1.388000 0.5321473  0.9732843  0.1658046 -0.2265853
row5 0.9873325  0.4041151 1.511265 0.6647937 -1.9314583 -1.5737382  1.1215627
         col15    col16      col17      col18      col19     col20
row1 -1.445063 1.350553 -1.3418452 -0.9520076 -1.3156034 -1.421306
row5  1.114029 0.478467  0.2320235 -0.6135983  0.5145666 -1.860240
> tmp[,c("col6","col20")]
           col6       col20
row1 -1.1353973 -1.42130583
row2 -0.6885455  0.06698267
row3  0.9745218  1.60872700
row4  0.7898053 -1.24006904
row5  2.3197273 -1.86024048
> tmp[c("row1","row5"),c("col6","col20")]
          col6     col20
row1 -1.135397 -1.421306
row5  2.319727 -1.860240
> 
> 
> 
> 
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")]  <- rnorm(4,mean=105)
> 
> tmp["row1",]
        col1     col2     col3     col4     col5     col6     col7     col8
row1 49.0519 48.74949 50.17423 50.65055 51.09061 107.7114 49.29619 50.30143
         col9    col10    col11   col12    col13    col14    col15    col16
row1 49.10457 49.05571 49.48041 50.3047 50.48796 48.65101 50.68521 49.72498
        col17    col18    col19   col20
row1 49.83942 48.73128 49.88405 105.409
> tmp[,"col10"]
        col10
row1 49.05571
row2 29.97428
row3 29.40192
row4 29.53653
row5 51.82472
> tmp[c("row1","row5"),]
         col1     col2     col3     col4     col5     col6     col7     col8
row1 49.05190 48.74949 50.17423 50.65055 51.09061 107.7114 49.29619 50.30143
row5 49.05858 50.04769 49.16953 51.29648 50.53660 103.5036 51.07088 50.05064
         col9    col10    col11    col12    col13    col14    col15    col16
row1 49.10457 49.05571 49.48041 50.30470 50.48796 48.65101 50.68521 49.72498
row5 51.41326 51.82472 48.98456 51.36834 49.52620 50.49160 49.38788 50.57754
        col17    col18    col19    col20
row1 49.83942 48.73128 49.88405 105.4090
row5 50.70464 50.58682 50.32698 104.1375
> tmp[,c("col6","col20")]
          col6     col20
row1 107.71143 105.40901
row2  74.83986  74.84341
row3  74.64801  74.41162
row4  74.47796  73.68611
row5 103.50362 104.13746
> tmp[c("row1","row5"),c("col6","col20")]
         col6    col20
row1 107.7114 105.4090
row5 103.5036 104.1375
> 
> 
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
         col6    col20
row1 107.7114 105.4090
row5 103.5036 104.1375
> 
> 
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> 
> tmp[,"col13"]
           col13
[1,] -0.67593680
[2,] -0.93773635
[3,] -0.63037567
[4,] -0.02096003
[5,]  0.84843758
> tmp[,c("col17","col7")]
          col17       col7
[1,]  0.5991699 -0.8230713
[2,]  0.5158882 -0.2181775
[3,] -0.6158974  0.9556658
[4,]  1.2138040 -0.4194313
[5,]  0.5250039  0.9797896
> 
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
           col6      col20
[1,]  0.1691564  0.6176878
[2,]  0.5188631  0.3701412
[3,] -0.8769830  0.2420057
[4,] -0.2381864 -0.2271686
[5,]  0.1698660 -1.4890934
> subBufferedMatrix(tmp,1,c("col6"))[,1]
          col1
[1,] 0.1691564
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
          col6
[1,] 0.1691564
[2,] 0.5188631
> 
> 
> 
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> 
> 
> 
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
            [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
row3  0.06117638  0.6676516 -0.7546703  0.7056849  0.6673846  0.1260304
row1 -2.29910656 -0.2564338  0.3008958 -0.4415884 -0.3150843 -0.1704006
           [,7]       [,8]        [,9]      [,10]      [,11]       [,12]
row3 0.17403818  0.3374420 -0.02765668 -1.1358506  0.3639555  0.02331039
row1 0.04196064 -0.4042785  0.77325993 -0.7805882 -0.7340029 -0.17908542
          [,13]    [,14]      [,15]       [,16]     [,17]       [,18]
row3 2.29092828 1.957022 -0.9375861  0.04952109 0.1181468 -0.00124192
row1 0.09295515 1.559257  0.1964337 -0.27922267 0.5741046  2.24866450
          [,19]      [,20]
row3 -0.7601432 -0.7688055
row1  1.8611541 -0.2314087
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
           [,1]      [,2]     [,3]      [,4]      [,5]       [,6]     [,7]
row2 -0.7433022 -1.217416 1.082874 0.7569066 0.9263237 -0.2160425 2.350721
           [,8]      [,9]    [,10]
row2 -0.1962454 0.1550087 1.579814
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
         [,1]       [,2]     [,3]       [,4]     [,5]      [,6]      [,7]
row5 1.638058 -0.6150722 2.184573 -0.9231792 1.023516 0.9259346 0.2150156
          [,8]       [,9]    [,10]     [,11]     [,12]    [,13]   [,14]
row5 0.5130103 -0.5917486 -1.60036 0.3461744 0.2556701 1.615914 1.95817
        [,15]     [,16]      [,17]      [,18]     [,19]     [,20]
row5 1.221799 0.9031706 -0.6308619 0.09333727 -2.060194 0.9363055
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> colnames(tmp)
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
> 
> 
> colnames(tmp) <- NULL
> rownames(tmp) <- NULL
> 
> colnames(tmp)
NULL
> rownames(tmp)
NULL
> 
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> 
> dimnames(tmp)
[[1]]
[1] "row1" "row2" "row3" "row4" "row5"

[[2]]
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"

> 
> dimnames(tmp) <- NULL
> 
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> dimnames(tmp)
[[1]]
NULL

[[2]]
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"

> 
> 
> dimnames(tmp) <- NULL
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
> dimnames(tmp)
[[1]]
[1] "row1" "row2" "row3" "row4" "row5"

[[2]]
NULL

> 
> dimnames(tmp) <- list(NULL,c(colnames(tmp,do.NULL=FALSE)))
> dimnames(tmp)
[[1]]
NULL

[[2]]
 [1] "col1"  "col2"  "col3"  "col4"  "col5"  "col6"  "col7"  "col8"  "col9" 
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"

> 
> 
> 
> ###
> ### Testing logical indexing
> ###
> ###
> 
> tmp <- createBufferedMatrix(230,15)
> tmp[1:230,1:15] <- rnorm(230*15)
> x <-tmp[1:230,1:15]  
> 
> for (rep in 1:10){
+   which.cols <- sample(c(TRUE,FALSE),15,replace=T)
+   which.rows <- sample(c(TRUE,FALSE),230,replace=T)
+   
+   if (!all(tmp[which.rows,which.cols] == x[which.rows,which.cols])){
+     stop("No agreement when logical indexing\n")
+   }
+   
+   if (!all(subBufferedMatrix(tmp,,which.cols)[,1:sum(which.cols)] ==  x[,which.cols])){
+     stop("No agreement when logical indexing in subBufferedMatrix cols\n")
+   }
+   if (!all(subBufferedMatrix(tmp,which.rows,)[1:sum(which.rows),] ==  x[which.rows,])){
+     stop("No agreement when logical indexing in subBufferedMatrix rows\n")
+   }
+   
+   
+   if (!all(subBufferedMatrix(tmp,which.rows,which.cols)[1:sum(which.rows),1:sum(which.cols)]==  x[which.rows,which.cols])){
+     stop("No agreement when logical indexing in subBufferedMatrix rows and columns\n")
+   }
+ }
> 
> 
> ##
> ## Test the ReadOnlyMode
> ##
> 
> ReadOnlyMode(tmp)
<pointer: 0x5ab7b5d0ff60>
> is.ReadOnlyMode(tmp)
[1] TRUE
> 
> filenames(tmp)
 [1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e5651151678e"
 [2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e5653f838888"
 [3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e565303edcee"
 [4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e5654d83c7b0"
 [5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e56575804867"
 [6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e5652c18577" 
 [7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e56514bf5a6f"
 [8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e5652cfa2562"
 [9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e5655a5d4be7"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e56553dcab49"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e5657d2e26f9"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e5652134a20" 
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e56544699959"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e56556184b53"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM6e56526261dd2"
> 
> 
> ### testing coercion functions
> ###
> 
> tmp <- as(tmp,"matrix")
> tmp <- as(tmp,"BufferedMatrix")
> 
> 
> 
> ### testing whether can move storage from one location to another
> 
> MoveStorageDirectory(tmp,"NewDirectory",full.path=FALSE)
<pointer: 0x5ab7b534d670>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5ab7b534d670>
Warning message:
In dir.create(new.directory) :
  '/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
> 
> 
> RowMode(tmp)
<pointer: 0x5ab7b534d670>
> rowMedians(tmp)
  [1]  0.152470538  0.300980999 -0.808773781  0.506597971  0.044445308
  [6] -0.152953532 -0.142753140  0.143128649  0.100992147 -0.219065546
 [11] -0.351750049  0.230661966  0.468683136 -0.177970724 -0.184951378
 [16] -0.164476901  0.190720301  0.483313110  0.023402923 -0.188937577
 [21] -0.379655183  0.234743466 -0.645271182 -0.122282780 -0.339590327
 [26] -0.022699426  0.054312999  0.180324155  0.204980314  0.208884830
 [31] -0.431401264  0.547875988  0.647937593  0.175114226  0.223844410
 [36] -0.397187897  0.065501361 -0.842547975 -0.108061496  0.107731936
 [41] -0.627003847 -0.427892556  0.911858987 -0.558011946  0.505618219
 [46]  0.302296937  0.276862184 -0.690386337  0.156295843  0.297889086
 [51] -0.128261978 -0.279719045 -0.332942358 -0.801721622 -0.141101177
 [56] -0.197372359  0.626015417  0.320326048  0.271048200  0.253569359
 [61] -0.556674220  0.135403710 -0.038854820  0.107423661 -0.216792539
 [66] -0.050948261  0.048566073  0.069494405 -0.693432320 -0.356178207
 [71]  0.371134774  0.062410955  0.501604196  0.354068436 -0.151755688
 [76] -0.125143177  0.585716665 -0.406448071  0.226889414 -0.112761337
 [81] -0.179277145 -0.271705694  0.304516327  0.107221027 -0.028490736
 [86]  0.362266256 -0.173872553  0.167436218  0.019672714 -0.245326047
 [91] -0.085979596 -0.220119077 -0.395134369  0.223899430 -0.003550031
 [96] -0.323679106  0.108871691 -0.683000347  0.216808369 -0.145485386
[101] -0.522059380 -0.693023073  0.254393365  0.335640641 -0.353721524
[106]  0.194577799 -0.477446125  0.349783811  0.094021252 -0.193443187
[111]  0.012974975 -0.025894666 -0.188820705  0.224183205  0.454471180
[116] -0.275462915 -0.344779513 -0.270523512 -0.034510223 -0.169467353
[121]  0.263914094 -0.006617753 -0.259763263 -0.253258702 -0.068030660
[126]  0.304899031  0.136272064  0.447523043 -0.025211204 -0.300804445
[131] -0.008360286  0.563868291  0.016148799 -0.410819274  0.377763438
[136] -0.112308430  0.163487180  0.708354521  0.092797800  0.438021302
[141] -0.109835000  0.870750839 -0.046610210  0.082294169 -0.318508180
[146]  0.281918492  0.030822381  0.170885062  0.569905206  0.026630566
[151]  0.087907264 -0.033506627  0.812809531  0.247820334 -0.035377242
[156]  0.489907662  0.080208590 -0.341620538 -0.071587285 -0.306718110
[161] -0.486057950 -0.233458346 -0.092880094 -0.396456663 -0.020128276
[166]  0.504581912  0.119776375 -0.045310423 -0.467227064  0.407873186
[171] -0.224316939  0.393913186 -0.145378203 -0.587364552  0.314051094
[176] -0.098438864  0.214396173  0.094188345 -0.270095121 -0.056436883
[181]  0.262850151 -0.114724164  0.015086523  0.131637364 -0.123768704
[186]  0.250512940 -0.281267633 -0.051062911  0.199138392 -0.400996605
[191] -0.386493291  0.286476617 -0.241181428  0.067843002 -0.167469985
[196] -0.098824570 -0.503791759 -0.295958157  0.306746277 -0.999500839
[201] -0.613670174  0.355668387 -0.239561478 -0.214247429 -0.245087005
[206]  0.036438065 -0.272654760  0.074092965  0.327093747 -0.230232788
[211] -0.108251458 -0.337512550  0.294863961  0.165888449 -0.188076803
[216]  0.413961302 -0.504609153  0.076534434 -0.469164101 -0.438295954
[221] -0.097975798  0.334767536 -0.398487927  0.236571679 -0.018033059
[226]  0.183518228  0.301015195 -0.064694705  0.037071351  0.323454206
> 
> proc.time()
   user  system elapsed 
  1.820   0.882   2.737 

BufferedMatrix.Rcheck/tests/rawCalltesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> prefix <- "dbmtest"
> directory <- getwd()
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x580ac8801c80>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x580ac8801c80>
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 10
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x580ac8801c80>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 10
Buffer Rows: 1
Buffer Cols: 1

Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 0.000000 0.000000 0.000000 0.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 0.000000 0.000000 0.000000 0.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 0.000000 0.000000 0.000000 0.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 0.000000 0.000000 0.000000 0.000000 

<pointer: 0x580ac8801c80>
> rm(P)
> 
> #P <- .Call("R_bm_Destroy",P)
> #.Call("R_bm_Destroy",P)
> #.Call("R_bm_Test_C",P)
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,5)
[1] TRUE
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 0
Buffer Rows: 1
Buffer Cols: 1

Printing Values






<pointer: 0x580ac8498a00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x580ac8498a00>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 1
Buffer Rows: 1
Buffer Cols: 1

Printing Values
0.000000 
0.000000 
0.000000 
0.000000 
0.000000 

<pointer: 0x580ac8498a00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x580ac8498a00>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 1
Buffer Cols: 1

Printing Values
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 

<pointer: 0x580ac8498a00>
> rm(P)
> 
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,5)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x580ac8563660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x580ac8563660>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 1
Buffer Cols: 1

Printing Values
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 

<pointer: 0x580ac8563660>
> 
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x580ac8563660>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5

Printing Values
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 

<pointer: 0x580ac8563660>
> 
> .Call("R_bm_RowMode",P)
<pointer: 0x580ac8563660>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5

Printing Values
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 

<pointer: 0x580ac8563660>
> 
> .Call("R_bm_ColMode",P)
<pointer: 0x580ac8563660>
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 2
Buffer Rows: 5
Buffer Cols: 5

Printing Values
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 
0.000000 0.000000 

<pointer: 0x580ac8563660>
> rm(P)
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x580ac8a853d0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x580ac8a853d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x580ac8a853d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x580ac8a853d0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile6e7c0333958ef" "BufferedMatrixFile6e7c05d580e8e"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile6e7c0333958ef" "BufferedMatrixFile6e7c05d580e8e"
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x580acabe2460>
> .Call("R_bm_AddColumn",P)
<pointer: 0x580acabe2460>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x580acabe2460>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x580acabe2460>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x580acabe2460>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x580acabe2460>
> .Call("R_bm_isRowMode",P)
[1] FALSE
> rm(P)
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x580aca219e60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x580aca219e60>
> 
> .Call("R_bm_getSize",P)
[1] 10  2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x580aca219e60>
> 
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x580aca219e60>
> rm(P)
> 
> 
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 6.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x580ac908c710>
> .Call("R_bm_getValue",P,3,3)
[1] 6
> 
> .Call("R_bm_getValue",P,100000,10000)
[1] NA
> .Call("R_bm_setValue",P,3,3,12345.0)
[1] TRUE
> .Call("R_bm_Test_C2",P)
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1

Printing Values
0.000000 1.000000 2.000000 3.000000 4.000000 
1.000000 2.000000 3.000000 4.000000 5.000000 
2.000000 3.000000 4.000000 5.000000 6.000000 
3.000000 4.000000 5.000000 12345.000000 7.000000 
4.000000 5.000000 6.000000 7.000000 8.000000 

<pointer: 0x580ac908c710>
> rm(P)
> 
> proc.time()
   user  system elapsed 
  0.313   0.048   0.352 

BufferedMatrix.Rcheck/tests/Rcodetesting.Rout


R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());

Attaching package: 'BufferedMatrix'

The following objects are masked from 'package:base':

    colMeans, colSums, rowMeans, rowSums

> 
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100   0
> buffer.dim(Temp)
[1] 1 1
> 
> 
> proc.time()
   user  system elapsed 
  0.411   0.051   0.463 

Example timings