R Under development (unstable) (2023-04-23 r84305 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (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. > > library(rcdd) If you want correct answers, use rational arithmetic. See the Warnings sections in help pages for functions that do computational geometry. > > d <- 4 > qux <- makeH(- diag(d), rep(0, d), rep(1, d), 1) > print(qux) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 1 -1 -1 -1 -1 [2,] 0 0 1 0 0 0 [3,] 0 0 0 1 0 0 [4,] 0 0 0 0 1 0 [5,] 0 0 0 0 0 1 attr(,"representation") [1] "H" > out <- scdd(qux) > print(out) $output [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0 1 0 0 0 1 [2,] 0 1 0 0 1 0 [3,] 0 1 0 1 0 0 [4,] 0 1 1 0 0 0 attr(,"representation") [1] "V" > > qux1 <- addHeq(1:d, 2.2, qux) > print(qux1) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 1.0 -1 -1 -1 -1 [2,] 0 0.0 1 0 0 0 [3,] 0 0.0 0 1 0 0 [4,] 0 0.0 0 0 1 0 [5,] 0 0.0 0 0 0 1 [6,] 1 2.2 -1 -2 -3 -4 attr(,"representation") [1] "H" > out1 <- scdd(qux1) > print(out1) $output [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0 1 0.6 0.0 0.0 0.4 [2,] 0 1 0.4 0.0 0.6 0.0 [3,] 0 1 0.0 0.8 0.2 0.0 [4,] 0 1 0.0 0.9 0.0 0.1 attr(,"representation") [1] "V" > > qux1q <- qux1 > qux1q[6, 2] <- "11/5" > print(qux1q) [,1] [,2] [,3] [,4] [,5] [,6] [1,] "1" "1" "-1" "-1" "-1" "-1" [2,] "0" "0" "1" "0" "0" "0" [3,] "0" "0" "0" "1" "0" "0" [4,] "0" "0" "0" "0" "1" "0" [5,] "0" "0" "0" "0" "0" "1" [6,] "1" "11/5" "-1" "-2" "-3" "-4" attr(,"representation") [1] "H" > out1q <- scdd(qux1q) > print(out1q) $output [,1] [,2] [,3] [,4] [,5] [,6] [1,] "0" "1" "3/5" "0" "0" "2/5" [2,] "0" "1" "2/5" "0" "3/5" "0" [3,] "0" "1" "0" "4/5" "1/5" "0" [4,] "0" "1" "0" "9/10" "0" "1/10" attr(,"representation") [1] "V" > > out1$output [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0 1 0.6 0.0 0.0 0.4 [2,] 0 1 0.4 0.0 0.6 0.0 [3,] 0 1 0.0 0.8 0.2 0.0 [4,] 0 1 0.0 0.9 0.0 0.1 attr(,"representation") [1] "V" > q2d(out1q$output) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0 1 0.6 0.0 0.0 0.4 [2,] 0 1 0.4 0.0 0.6 0.0 [3,] 0 1 0.0 0.8 0.2 0.0 [4,] 0 1 0.0 0.9 0.0 0.1 attr(,"representation") [1] "V" > qmq(out1$output, out1q$output) [,1] [,2] [,3] [,4] [1,] "0" "0" "-1/45035996273704960" "0" [2,] "0" "0" "-13/90071992547409920" "0" [3,] "0" "0" "0" "-13/45035996273704960" [4,] "0" "0" "0" "-1/11258999068426240" [,5] [,6] [1,] "0" "7/90071992547409920" [2,] "1/11258999068426240" "0" [3,] "1/5629499534213120" "0" [4,] "0" "1/11258999068426240" attr(,"representation") [1] "V" > > > proc.time() user system elapsed 0.26 0.01 0.26