Null permutations
nullperm.Rd
Null permutations are the equivalent of NULL
Format
Object nullcycle
is an empty list coerced to class
cycle
, specifically cycle(list())
Object nullword
is a zero-row matrix, coerced to word
,
specifically word(matrix(integer(0),0,0))
Details
These objects are here to deal with the case where a length-zero permutation is extracted. The behaviour of these null objects is not entirely consistent.
Note
The objects documented here are distinct from the identity
permutation, id
, documented separately.
Examples
rperm(10,4)[0] # null word
#> cycle(0)
#> [coerced from word form]
as.cycle(1:5)[0] # null cycle
#> cycle(0)
data(megaminx)
c(NULL,megaminx) # probably not what the user intended...
#> $White
#> $White[[1]]
#> [1] 10 12 14 16 18
#>
#> $White[[2]]
#> [1] 11 13 15 17 19
#>
#> $White[[3]]
#> [1] 21 33 45 57 69
#>
#> $White[[4]]
#> [1] 22 34 46 58 60
#>
#> $White[[5]]
#> [1] 23 35 47 59 61
#>
#>
#> $Purple
#> $Purple[[1]]
#> [1] 15 67 91 81 35
#>
#> $Purple[[2]]
#> [1] 16 68 92 82 36
#>
#> $Purple[[3]]
#> [1] 17 69 93 83 37
#>
#> $Purple[[4]]
#> [1] 20 22 24 26 28
#>
#> $Purple[[5]]
#> [1] 21 23 25 27 29
#>
#>
#> $DarkYellow
#> $DarkYellow[[1]]
#> [1] 17 29 89 79 47
#>
#> $DarkYellow[[2]]
#> [1] 18 20 80 70 48
#>
#> $DarkYellow[[3]]
#> [1] 19 21 81 71 49
#>
#> $DarkYellow[[4]]
#> [1] 30 32 34 36 38
#>
#> $DarkYellow[[5]]
#> [1] 31 33 35 37 39
#>
#>
#> $DarkBlue
#> $DarkBlue[[1]]
#> [1] 10 32 78 118 50
#>
#> $DarkBlue[[2]]
#> [1] 11 33 79 119 51
#>
#> $DarkBlue[[3]]
#> [1] 19 31 77 117 59
#>
#> $DarkBlue[[4]]
#> [1] 40 42 44 46 48
#>
#> $DarkBlue[[5]]
#> [1] 41 43 45 47 49
#>
#>
#> $Red
#> $Red[[1]]
#> [1] 11 43 115 105 61
#>
#> $Red[[2]]
#> [1] 12 44 116 106 62
#>
#> $Red[[3]]
#> [1] 13 45 117 107 63
#>
#> $Red[[4]]
#> [1] 50 52 54 56 58
#>
#> $Red[[5]]
#> [1] 51 53 55 57 59
#>
#>
#> $DarkGreen
#> $DarkGreen[[1]]
#> [1] 13 55 103 93 23
#>
#> $DarkGreen[[2]]
#> [1] 14 56 104 94 24
#>
#> $DarkGreen[[3]]
#> [1] 15 57 105 95 25
#>
#> $DarkGreen[[4]]
#> [1] 60 62 64 66 68
#>
#> $DarkGreen[[5]]
#> [1] 61 63 65 67 69
#>
#>
#> $LightGreen
#> $LightGreen[[1]]
#> [1] 30 88 120 110 40
#>
#> $LightGreen[[2]]
#> [1] 31 89 121 111 41
#>
#> $LightGreen[[3]]
#> [1] 39 87 129 119 49
#>
#> $LightGreen[[4]]
#> [1] 70 72 74 76 78
#>
#> $LightGreen[[5]]
#> [1] 71 73 75 77 79
#>
#>
#> $Orange
#> $Orange[[1]]
#> [1] 27 99 121 71 37
#>
#> $Orange[[2]]
#> [1] 28 90 122 72 38
#>
#> $Orange[[3]]
#> [1] 29 91 123 73 39
#>
#> $Orange[[4]]
#> [1] 80 82 84 86 88
#>
#> $Orange[[5]]
#> [1] 81 83 85 87 89
#>
#>
#> $LightBlue
#> $LightBlue[[1]]
#> [1] 25 65 101 123 83
#>
#> $LightBlue[[2]]
#> [1] 26 66 102 124 84
#>
#> $LightBlue[[3]]
#> [1] 27 67 103 125 85
#>
#> $LightBlue[[4]]
#> [1] 90 92 94 96 98
#>
#> $LightBlue[[5]]
#> [1] 91 93 95 97 99
#>
#>
#> $LightYellow
#> $LightYellow[[1]]
#> [1] 53 113 125 95 63
#>
#> $LightYellow[[2]]
#> [1] 54 114 126 96 64
#>
#> $LightYellow[[3]]
#> [1] 55 115 127 97 65
#>
#> $LightYellow[[4]]
#> [1] 100 102 104 106 108
#>
#> $LightYellow[[5]]
#> [1] 101 103 105 107 109
#>
#>
#> $Pink
#> $Pink[[1]]
#> [1] 41 75 127 107 51
#>
#> $Pink[[2]]
#> [1] 42 76 128 108 52
#>
#> $Pink[[3]]
#> [1] 43 77 129 109 53
#>
#> $Pink[[4]]
#> [1] 110 112 114 116 118
#>
#> $Pink[[5]]
#> [1] 111 113 115 117 119
#>
#>
#> $Grey
#> $Grey[[1]]
#> [1] 73 85 97 109 111
#>
#> $Grey[[2]]
#> [1] 74 86 98 100 112
#>
#> $Grey[[3]]
#> [1] 75 87 99 101 113
#>
#> $Grey[[4]]
#> [1] 120 122 124 126 128
#>
#> $Grey[[5]]
#> [1] 121 123 125 127 129
#>
#>
c(nullcycle,megaminx) # more useful.
#> White
#> (10,12,14,16,18)(11,13,15,17,19)(21,33,45,57,69)(22,34,46,58,60)(23,35,47,59,61)
#> Purple
#> (15,67,91,81,35)(16,68,92,82,36)(17,69,93,83,37)(20,22,24,26,28)(21,23,25,27,29)
#> DarkYellow
#> (17,29,89,79,47)(18,20,80,70,48)(19,21,81,71,49)(30,32,34,36,38)(31,33,35,37,39)
#> DarkBlue
#> (10,32,78,118,50)(11,33,79,119,51)(19,31,77,117,59)(40,42,44,46,48)(41,43,45,47,49)
#> Red
#> (11,43,115,105,61)(12,44,116,106,62)(13,45,117,107,63)(50,52,54,56,58)(51,53,55,57,59)
#> DarkGreen
#> (13,55,103,93,23)(14,56,104,94,24)(15,57,105,95,25)(60,62,64,66,68)(61,63,65,67,69)
#> LightGreen
#> (30,88,120,110,40)(31,89,121,111,41)(39,87,129,119,49)(70,72,74,76,78)(71,73,75,77,79)
#> Orange
#> (27,99,121,71,37)(28,90,122,72,38)(29,91,123,73,39)(80,82,84,86,88)(81,83,85,87,89)
#> LightBlue
#> (25,65,101,123,83)(26,66,102,124,84)(27,67,103,125,85)(90,92,94,96,98)(91,93,95,97,99)
#> LightYellow
#> (53,113,125,95,63)(54,114,126,96,64)(55,115,127,97,65)(100,102,104,106,108)(101,103,105,107,109)
#> Pink
#> (41,75,127,107,51)(42,76,128,108,52)(43,77,129,109,53)(110,112,114,116,118)(111,113,115,117,119)
#> Grey
#> (73,85,97,109,111)(74,86,98,100,112)(75,87,99,101,113)(120,122,124,126,128)(121,123,125,127,129)
c(id,megaminx) # also useful.
#>
#> ()
#> White
#> (10,12,14,16,18)(11,13,15,17,19)(21,33,45,57,69)(22,34,46,58,60)(23,35,47,59,61)
#> Purple
#> (15,67,91,81,35)(16,68,92,82,36)(17,69,93,83,37)(20,22,24,26,28)(21,23,25,27,29)
#> DarkYellow
#> (17,29,89,79,47)(18,20,80,70,48)(19,21,81,71,49)(30,32,34,36,38)(31,33,35,37,39)
#> DarkBlue
#> (10,32,78,118,50)(11,33,79,119,51)(19,31,77,117,59)(40,42,44,46,48)(41,43,45,47,49)
#> Red
#> (11,43,115,105,61)(12,44,116,106,62)(13,45,117,107,63)(50,52,54,56,58)(51,53,55,57,59)
#> DarkGreen
#> (13,55,103,93,23)(14,56,104,94,24)(15,57,105,95,25)(60,62,64,66,68)(61,63,65,67,69)
#> LightGreen
#> (30,88,120,110,40)(31,89,121,111,41)(39,87,129,119,49)(70,72,74,76,78)(71,73,75,77,79)
#> Orange
#> (27,99,121,71,37)(28,90,122,72,38)(29,91,123,73,39)(80,82,84,86,88)(81,83,85,87,89)
#> LightBlue
#> (25,65,101,123,83)(26,66,102,124,84)(27,67,103,125,85)(90,92,94,96,98)(91,93,95,97,99)
#> LightYellow
#> (53,113,125,95,63)(54,114,126,96,64)(55,115,127,97,65)(100,102,104,106,108)(101,103,105,107,109)
#> Pink
#> (41,75,127,107,51)(42,76,128,108,52)(43,77,129,109,53)(110,112,114,116,118)(111,113,115,117,119)
#> Grey
#> (73,85,97,109,111)(74,86,98,100,112)(75,87,99,101,113)(120,122,124,126,128)(121,123,125,127,129)