@@ -5,7 +5,7 @@ require(spatstat.sparse)
55ALWAYS <- FULLTEST <- TRUE
66# ' tests/sparse3Darrays.R
77# ' Basic tests of code in sparse3Darray.R and sparsecommon.R
8- # ' $Revision: 1.33 $ $Date: 2026/04/27 06:49:58 $
8+ # ' $Revision: 1.34 $ $Date: 2026/05/06 03:38:51 $
99
1010if (! exists(" ALWAYS" )) ALWAYS <- TRUE
1111if (! exists(" FULLTEST" )) FULLTEST <- ALWAYS
@@ -376,6 +376,18 @@ local({
376376 A <- array (runif(75 ) * (runif(75 ) < 0.7 ), dim = c(3 ,5 ,5 ))
377377 M <- as.sparse3Darray(A )
378378 M [rep(1 ,3 ), c(1 ,1 ,2 ), rep(2 , 3 )]
379+
380+ # # and again using a fixed mwe
381+ Afull <- array (1 : 50 , dim = c(2 ,5 ,5 ))
382+ Asparse <- as.sparse3Darray(Afull )
383+ Mfull <- abs(.col(c(5 ,5 )) - .row(c(5 ,5 )))
384+ Msparse <- as(as(Mfull , " symmetricMatrix" ), " sparseMatrix" )
385+ Rfull <- sumsymouter(Afull , Mfull )
386+ Rsparse <- sumsymouterSparse(Asparse , Msparse )
387+ if (! all(Rsparse == Rfull ))
388+ stop(paste(" sumsymouter(x, w): sparse and non-sparse algorithms disagree" ,
389+ " when w is symmetric" ))
390+
379391})
380392
381393}
0 commit comments