pub struct FilterNone {}
Expand description
A filter that includes all atoms without any filtering criteria.
This struct implements the Filter
trait and represents the absence of filtering.
It treats all atoms as both center and other atoms, making it useful for
calculations that should include all possible atom pairs in the system.
§Characteristics
- Center atoms: All atoms in the system
- Other atoms: All atoms in the system
- center_is_other: Always returns
false
(no special handling needed)
§Use Cases
- Global analysis: Calculate properties considering all atoms equally
- Benchmarking: Compare filtered vs. unfiltered results
- Simple systems: When element or tag-based filtering is unnecessary
- Default behavior: Fallback when no specific filtering is required
§Performance Note
While FilterNone
provides optimized implementations that avoid unnecessary
filtering operations, be aware that including all atoms can result in O(N²)
computational complexity for pairwise calculations.
§Examples
use fastatomstruct::atoms::{FilterNone, Filter, Atom, Element};
use nalgebra::Point3;
let atoms = vec![
Atom { element: Element::H, position: Point3::new(0.0, 0.0, 0.0), ..Default::default() },
Atom { element: Element::He, position: Point3::new(1.0, 0.0, 0.0), ..Default::default() },
Atom { element: Element::Li, position: Point3::new(2.0, 0.0, 0.0), ..Default::default() },
];
let filter = FilterNone {};
// All atoms are considered center atoms
assert!(filter.is_center(&atoms[0])); // H
assert!(filter.is_center(&atoms[1])); // He
assert!(filter.is_center(&atoms[2])); // Li
// All atoms are considered other atoms
assert!(filter.is_other(&atoms[0])); // H
assert!(filter.is_other(&atoms[1])); // He
assert!(filter.is_other(&atoms[2])); // Li
// No special center/other relationship
assert!(!filter.center_is_other());
Trait Implementations§
Source§impl Clone for FilterNone
impl Clone for FilterNone
Source§fn clone(&self) -> FilterNone
fn clone(&self) -> FilterNone
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FilterNone
impl Debug for FilterNone
Source§impl Filter for FilterNone
impl Filter for FilterNone
Source§fn center_is_other(&self) -> bool
fn center_is_other(&self) -> bool
Check if the center atom is also an other atom. Read more
Source§fn range_filtered_center<A: AtomsExt>(&self, atoms: &A) -> Vec<usize>
fn range_filtered_center<A: AtomsExt>(&self, atoms: &A) -> Vec<usize>
Returns the indices of atoms that pass the filter criteria for the center atoms. Read more
Source§fn range_filtered_other<A: AtomsExt>(&self, atoms: &A) -> Vec<usize>
fn range_filtered_other<A: AtomsExt>(&self, atoms: &A) -> Vec<usize>
Returns the indices of atoms that pass the filter criteria for the other atoms. Read more
Source§fn len_filtered_center<A: AtomsExt>(&self, atoms: &A) -> usize
fn len_filtered_center<A: AtomsExt>(&self, atoms: &A) -> usize
Returns the number of atoms that pass the filter criteria for the center atoms. Read more
Source§fn len_filtered_other<A: AtomsExt>(&self, atoms: &A) -> usize
fn len_filtered_other<A: AtomsExt>(&self, atoms: &A) -> usize
Returns the number of atoms that pass the filter criteria for the other atoms. Read more
impl Copy for FilterNone
Auto Trait Implementations§
impl Freeze for FilterNone
impl RefUnwindSafe for FilterNone
impl Send for FilterNone
impl Sync for FilterNone
impl Unpin for FilterNone
impl UnwindSafe for FilterNone
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,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.