R Under development (unstable) (2023-12-13 r85679 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 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. > > library(rcdd) If you want correct answers, use rational arithmetic. See the Warnings sections in help pages for functions that do computational geometry. > > ##### H-representation ##### > > hrep <- rbind( + c(0, 0, 1, 1, 0), + c(0, 0, -1, 0, 0), + c(0, 0, 0, -1, 0), + c(0, 0, 0, 0, -1), + c(0, 0, -1, -1, -1)) > > redundant(d2q(hrep), representation = "H") $output [,1] [,2] [,3] [,4] [,5] [1,] "1" "0" "1" "1" "0" [2,] "1" "0" "-1" "0" "0" [3,] "0" "0" "-1" "-1" "-1" attr(,"representation") [1] "H" $implied.linearity [1] 1 2 3 $redundant [1] 4 $new.position [1] 1 2 0 0 3 > > redundant(hrep, representation = "H") $output [,1] [,2] [,3] [,4] [,5] [1,] 1 0 1 1 0 [2,] 1 0 -1 0 0 [3,] 0 0 -1 -1 -1 attr(,"representation") [1] "H" $implied.linearity [1] 1 2 3 $redundant [1] 4 $new.position [1] 1 2 0 0 3 > > ##### V-representation ##### > > foo <- c(1, 0, -1) > hrep <- cbind(0, 1, rep(foo, each = 9), rep(foo, each = 3), foo) > print(hrep) foo [1,] 0 1 1 1 1 [2,] 0 1 1 1 0 [3,] 0 1 1 1 -1 [4,] 0 1 1 0 1 [5,] 0 1 1 0 0 [6,] 0 1 1 0 -1 [7,] 0 1 1 -1 1 [8,] 0 1 1 -1 0 [9,] 0 1 1 -1 -1 [10,] 0 1 0 1 1 [11,] 0 1 0 1 0 [12,] 0 1 0 1 -1 [13,] 0 1 0 0 1 [14,] 0 1 0 0 0 [15,] 0 1 0 0 -1 [16,] 0 1 0 -1 1 [17,] 0 1 0 -1 0 [18,] 0 1 0 -1 -1 [19,] 0 1 -1 1 1 [20,] 0 1 -1 1 0 [21,] 0 1 -1 1 -1 [22,] 0 1 -1 0 1 [23,] 0 1 -1 0 0 [24,] 0 1 -1 0 -1 [25,] 0 1 -1 -1 1 [26,] 0 1 -1 -1 0 [27,] 0 1 -1 -1 -1 > > redundant(d2q(hrep), representation = "V") $output [,1] [,2] [,3] [,4] [,5] [1,] "0" "1" "1" "1" "1" [2,] "0" "1" "1" "1" "-1" [3,] "0" "1" "1" "-1" "1" [4,] "0" "1" "1" "-1" "-1" [5,] "0" "1" "-1" "1" "1" [6,] "0" "1" "-1" "1" "-1" [7,] "0" "1" "-1" "-1" "1" [8,] "0" "1" "-1" "-1" "-1" attr(,"representation") [1] "V" $redundant [1] 2 4 5 6 8 10 11 12 13 14 15 16 17 18 20 22 23 24 26 $new.position [1] 1 0 2 0 0 0 3 0 4 0 0 0 0 0 0 0 0 0 5 0 6 0 0 0 7 0 8 > > redundant(hrep, representation = "V") $output [,1] [,2] [,3] [,4] [,5] [1,] 0 1 1 1 1 [2,] 0 1 1 1 -1 [3,] 0 1 1 -1 1 [4,] 0 1 1 -1 -1 [5,] 0 1 -1 1 1 [6,] 0 1 -1 1 -1 [7,] 0 1 -1 -1 1 [8,] 0 1 -1 -1 -1 attr(,"representation") [1] "V" $redundant [1] 2 4 5 6 8 10 11 12 13 14 15 16 17 18 20 22 23 24 26 $new.position [1] 1 0 2 0 0 0 3 0 4 0 0 0 0 0 0 0 0 0 5 0 6 0 0 0 7 0 8 > > ##### another V-representation ##### > > hrep <- rbind( + c(0, 0, 1, 0, 0), + c(0, 0, 0, 1, 0), + c(0, 0, 0, 0, 1), + c(0, 0, -1, -1, -1)) > > redundant(d2q(hrep), representation = "V") $output [,1] [,2] [,3] [,4] [,5] [1,] "1" "0" "1" "0" "0" [2,] "1" "0" "0" "1" "0" [3,] "1" "0" "0" "0" "1" attr(,"representation") [1] "V" $implied.linearity [1] 1 2 3 4 $new.position [1] 1 2 3 0 > > redundant(hrep, representation = "V") $output [,1] [,2] [,3] [,4] [,5] [1,] 1 0 1 0 0 [2,] 1 0 0 1 0 [3,] 1 0 0 0 1 attr(,"representation") [1] "V" $implied.linearity [1] 1 2 3 4 $new.position [1] 1 2 3 0 > > ##### negative new position ##### > > hrep <- rbind( + c(1, 0, 1, 0, 0), + c(1, 0, 0, 1, 0), + c(1, 0, 0, 0, 1), + c(1, 0, 0, 1, 0), + c(1, 0, 0, 0, 1), + c(1, 0, 0, 0, 1)) > > redundant(hrep, representation = "V") $output [,1] [,2] [,3] [,4] [,5] [1,] 1 0 1 0 0 [2,] 1 0 0 1 0 [3,] 1 0 0 0 1 attr(,"representation") [1] "V" $new.position [1] 1 2 3 0 0 0 > > > proc.time() user system elapsed 0.14 0.04 0.17