
R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

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.

> #
> # Test out the behavior of a 1x1 bds corner.
> #  Actually, the problem that motivated this occurred whenever the
> # rmat portion was larger than the block diagonal portion.
> #
> library(bdsmatrix)

Attaching package: 'bdsmatrix'

The following object is masked from 'package:base':

    backsolve

> test1 <- bdsmatrix(blocksize=1, blocks=33, 
+                    rmat=matrix(c(17,33,7,-1, -7,7,48,-7,
+                                  1, -1, -7,4),4))
> 
> test2 <- bdsmatrix(blocksize=2, blocks=c(33,17,33),
+                     rmat=matrix(c( -7,7,48,-7, 1, -1, -7,4),4))
> all.equal(as.matrix(test1), as.matrix(test2))
[1] TRUE
> 
> g1 <- gchol(test1)
> g2 <- gchol(test2)
> all.equal(as.matrix(g1), as.matrix(g2))
[1] TRUE
> 
> s1 <- solve(g1, full=T)
> s2 <- solve(g2, full=T)
> all.equal(as.matrix(s1), as.matrix(s2))
[1] TRUE
> 
> all.equal(solve(test1), solve(test2))
[1] TRUE
> 
> proc.time()
   user  system elapsed 
  0.518   0.040   0.572 
