R Under development (unstable) (2024-07-05 r86875 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 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. > require( zonohedra ) Loading required package: zonohedra Package: zonohedra. Author: Glenn Davis. Version: 0.3-0. Built: R 4.5.0; x86_64-w64-mingw32; 2024-07-07 02:06:25 UTC; windows Attaching package: 'zonohedra' The following object is masked from 'package:base': rank > options( width=144 ) > > testSimplify <- function() + { + path = system.file( "extdata/xyz1931.5nm.txt", package='zonohedra' ) + + df = read.table( path, header=T, stringsAsFactors=F ) #; print( str(df) ) + + ground = df$wavelength + xyz5 = rbind( df$x, df$y, df$z ) + colnames( xyz5 ) = ground + + M = matroid( xyz5, ground=ground ) #; print(M) + + hypersimple = simplify( M$hyperplane, M$ground ) + + hyper = unsimplify( hypersimple, M$loop, M$multiple ) + + if( ! identical( M$hyperplane, hyper ) ) return(FALSE) + + + path = system.file( "extdata/ciexyz31_1.csv", package='zonohedra' ) + + df = read.table( path, header=T, sep=',', stringsAsFactors=F ) #; print( str(df) ) + + ground = df$Wavelength + xyz1 = rbind( df$x, df$y, df$z ) + colnames( xyz1 ) = ground + + M = matroid( xyz1, e2=1.e-10, ground=ground ) #; print(M) + + hypersimple = simplify( M$hyperplane, M$ground ) + + hyper = unsimplify( hypersimple, M$loop, M$multiple ) + + if( ! identical( M$hyperplane, hyper ) ) return(FALSE) + + return(TRUE) + } > > > if( ! testSimplify() ) stop( "testSimplify() failed !" ) > > cat( "Passed all matroid tests !\n", file=stderr() ) Passed all matroid tests ! > > proc.time() user system elapsed 1.04 0.14 1.15