Enum rlifesrc_lib::Symmetry [−][src]
Symmetries of the pattern.
For each symmetry, its symmetry group is a subgroup of the dihedral group D8. 10 different symmetries correspond to 10 subgroups of D8.
The notations are stolen from Oscar Cunningham's Logic Life Search. Please see the Life Wiki for details.
Some of the symmetries are only valid when the world is square, and some are only valid when the world has no diagonal width.
Variants
C1
.
No symmetry at all.
C2
.
Symmetry under 180° rotation.
C4
.
Symmetry under 90° rotation.
Requires the world to be square and have no diagonal width.
D2-
.
Symmetry under reflection across the middle row.
Requires the world to have no diagonal width.
D2|
.
Symmetry under reflection across the middle column.
Requires the world to have no diagonal width.
D2\
.
Symmetry under reflection across the diagonal.
Requires the world to be square.
D2/
.
Symmetry under reflection across the antidiagonal.
Requires the world to be square.
D4+
.
Symmetry under reflections across the middle row and the middle column.
Requires the world to have no diagonal width.
D4X
.
Symmetry under reflections across the diagonal and the antidiagonal.
Requires the world to be square.
D8
.
Symmetry under all 8 transformations.
Requires the world to be square and have no diagonal width.
Implementations
impl Symmetry
[src]
pub fn require_square_world(self) -> bool
[src]
Whether this symmetry requires the world to be square.
Returns true
for C4
, D2\
, D2/
, D4X
and D8
.
pub fn require_no_diagonal_width(self) -> bool
[src]
Whether this transformation requires the world to have no diagonal width.
Returns true
for C4
, D2-
, D2|
, D4+
and D8
.
pub fn members(self) -> Vec<Transform>
[src]
Transformations contained in the symmetry group.
pub fn cosets(self) -> Vec<Transform>
[src]
A list of coset representatives, seeing the symmetry group as a subgroup of D8.
The first element in the result is always Transform::Id
.
Trait Implementations
impl Clone for Symmetry
[src]
impl Copy for Symmetry
[src]
impl Debug for Symmetry
[src]
impl Default for Symmetry
[src]
impl<'de> Deserialize<'de> for Symmetry
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for Symmetry
[src]
impl Eq for Symmetry
[src]
impl FromStr for Symmetry
[src]
type Err = String
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for Symmetry
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Symmetry> for Symmetry
[src]
fn eq(&self, other: &Symmetry) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Symmetry> for Symmetry
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
We say that symmetry a
is smaller than symmetry b
,
when the symmetry group of a
is a subgroup of that of b
,
i.e., all patterns with symmetry b
also have symmetry a
.
For example, Symmetry::C1
is smaller than all other symmetries.
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for Symmetry
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Symmetry
[src]
impl StructuralPartialEq for Symmetry
[src]
Auto Trait Implementations
impl RefUnwindSafe for Symmetry
[src]
impl Send for Symmetry
[src]
impl Sync for Symmetry
[src]
impl Unpin for Symmetry
[src]
impl UnwindSafe for Symmetry
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,