pub struct SymOp { /* private fields */ }Expand description
One symmetry operation: x' = R x + t in fractional coordinates.
Implementations§
Source§impl SymOp
impl SymOp
Sourcepub fn new(
rotation: [[i32; 3]; 3],
translation: [f64; 3],
) -> Result<Self, Error>
pub fn new( rotation: [[i32; 3]; 3], translation: [f64; 3], ) -> Result<Self, Error>
Creates an operation and wraps the translation into [0, 1).
§Errors
Returns Error::InvalidInput for a singular rotation or non-finite
translation.
Sourcepub const fn translation(&self) -> [f64; 3]
pub const fn translation(&self) -> [f64; 3]
Fractional translation in [0, 1).
Sourcepub fn apply_many(&self, points: &[[f64; 3]]) -> Vec<[f64; 3]>
pub fn apply_many(&self, points: &[[f64; 3]]) -> Vec<[f64; 3]>
Applies the operation to a block of points.
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Whether this is the identity operation.
Trait Implementations§
impl Copy for SymOp
Source§impl<'de> Deserialize<'de> for SymOp
impl<'de> Deserialize<'de> for SymOp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for SymOp
Auto Trait Implementations§
impl Forget for SymOp
impl Freeze for SymOp
impl Move for SymOp
impl RefUnwindSafe for SymOp
impl Send for SymOp
impl Sync for SymOp
impl Unpin for SymOp
impl UnsafeUnpin for SymOp
impl UnwindSafe for SymOp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more