pub fn bond_path(&self, i: usize, j: usize) -> BondPath {
        assert!(i < self.size() && j < self.size());
        if !(self.are_in_same_molecule(i, j)) {
            BondPath::None
        } else if i == j {
            BondPath::SameParticle
        } else {
            let connect = self.molecule(self.molecule_id(i)).bond_distances(i, j);
            if connect.contains(BondDistances::ONE) {
                BondPath::OneBond
            } else if connect.contains(BondDistances::TWO) {
                BondPath::TwoBonds
            } else if connect.contains(BondDistances::THREE) {
                BondPath::ThreeBonds
            } else if connect.contains(BondDistances::FAR) {
                BondPath::Far
            } else {
                unreachable!();
            }
        }
    }
/// Get the length of the shortest bond path to go from the particle `i` to
/// the particle `j`. If the particles are not in the same molecule, the
/// length is -1. Else, this length is 0 if `i == j`, 1 if there is a bond
/// between `i` and `j`, etc.
Get the length of the shortest bond path to go from the particle `i` to
the particle `j`. If the particles are not in the same molecule, the
length is -1.
Get the length of the shortest bond path to go from the particle ` i ` to the particle ` j ` . If the particles are not in the same molecule the length is - 1 .
pub fn bond_path(&self, i: usize, j: usize) -> BondPath {
        assert!(i < self.size() && j < self.size());
        if !(self.are_in_same_molecule(i, j)) {
            BondPath::None
        } else if i == j {
            BondPath::SameParticle
        } else {
            let connect = self.molecule(self.molecule_id(i)).bond_distances(i, j);
            if connect.contains(BondDistances::ONE) {
                BondPath::OneBond
            } else if connect.contains(BondDistances::TWO) {
                BondPath::TwoBonds
            } else if connect.contains(BondDistances::THREE) {
                BondPath::ThreeBonds
            } else if connect.contains(BondDistances::FAR) {
                BondPath::Far
            } else {
                unreachable!();
            }
        }
    }
pub fn bond_path ( & self , i : usize , j : usize ) -> BondPath { assert ! ( i self size ( ) j self size ( ) ) ; if ! ( self . are_in_same_molecule ( i , j ) ) { BondPath :: None } else if i == j { BondPath :: SameParticle } else { let connect = self . molecule ( self . molecule_id ( i ) ) . bond_distances ( i , j ) ; if connect . contains ( BondDistances :: ONE ) { BondPath :: OneBond } else if connect . contains ( BondDistances :: TWO ) { BondPath :: TwoBonds } else if connect . contains ( BondDistances :: THREE ) { BondPath :: ThreeBonds } else if connect . contains ( BondDistances :: FAR ) { BondPath :: Far } else { unreachable ! ( ) ; } } }
Get the length of the shortest bond path to go from the particle `i` to
the particle `j`.
Get the length of the shortest bond path to go from the particle ` i ` to the particle ` j ` .
&self
i
usize
j
usize