comparison: Logical Comparison for Cube Objects

Description Usage Arguments Details Value See Also Examples

Description

Determine if two cubes are equal, accounting for recoloring and rotation.

Usage

1
2
3
4
## S3 method for class 'cube'
aCube == bCube 
## S3 method for class 'cube'
all.equal(target, current, ...) 

Arguments

aCube, target

Any cube object.

bCube, current

Any cube object.

...

Not used.

Details

Two cubes are defined to be equal via == if they are the same except perhaps for a recoloring. This means that the permutation and orientation components are the same but the spatial orientation component may be different.

Two cubes are defined to be the same via all.equal if and only if one cube is equal to the other following any of the 24 rotations of the whole cube (including the no rotation case).

For testing if two cubes are exactly identical, you can use the R function identical, however the cubes must be of the same type; either both cubieCubes or both stickerCubes.

Value

A logical value.

See Also

is.solvable, is.solved

Examples

1
2
3
aCube <- randCube()
bCube <- rotate(aCube, "y'")
aCube == bCube

cubing documentation built on May 2, 2019, 10:16 a.m.