Struct FilterNone

Source
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

Source§

fn clone(&self) -> FilterNone

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FilterNone

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Filter for FilterNone

Source§

fn is_center(&self, _atom: &Atom) -> bool

Check if an atom is a center atom. Read more
Source§

fn is_other(&self, _atom: &Atom) -> bool

Check if an atom is an other atom. Read more
Source§

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>

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>

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

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

Returns the number of atoms that pass the filter criteria for the other atoms. Read more
Source§

fn iter_center<'a, A: AtomsExt>( &'a self, atoms: &'a A, ) -> impl Iterator<Item = &'a Atom> + 'a

Returns an iterator over the center atoms. Read more
Source§

fn iter_other<'a, A: AtomsExt>( &'a self, atoms: &'a A, ) -> impl Iterator<Item = &'a Atom> + 'a

Returns an iterator over the other atoms. Read more
Source§

impl Copy for FilterNone

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Ungil for T
where T: Send,