pub fn first_nonzero(&self) -> Option<(usize, u32)> {
        let entries_per_limb = limb::entries_per_limb_const::<P>();
        let bit_length = limb::bit_length_const::<P>();
        let bitmask = limb::bitmask::<P>();
        for (i, &limb) in self.limbs.iter().enumerate() {
            if limb == 0 {
                continue;
            }
            let index = limb.trailing_zeros() as usize / bit_length;
            return Some((
                i * entries_per_limb + index,
                ((limb >> (index * bit_length)) & bitmask) as u32,
            ));
        }
        None
    }
/// Find the index and value of the first non-zero entry of the vector. `None` if the vector is zero.
Find the index and value of the first non-zero entry of the vector. `None` if the vector is zero.
Find the index and value of the first non - zero entry of the vector . ` None ` if the vector is zero .
pub fn first_nonzero(&self) -> Option<(usize, u32)> {
        let entries_per_limb = limb::entries_per_limb_const::<P>();
        let bit_length = limb::bit_length_const::<P>();
        let bitmask = limb::bitmask::<P>();
        for (i, &limb) in self.limbs.iter().enumerate() {
            if limb == 0 {
                continue;
            }
            let index = limb.trailing_zeros() as usize / bit_length;
            return Some((
                i * entries_per_limb + index,
                ((limb >> (index * bit_length)) & bitmask) as u32,
            ));
        }
        None
    }
pub fn first_nonzero ( & self ) -> Option < ( usize , u32 ) > { let entries_per_limb = limb :: entries_per_limb_const :: < P > ( ) ; let bit_length = limb :: bit_length_const :: < P > ( ) ; let bitmask = limb :: bitmask :: < P > ( ) ; for ( i , & limb ) in self . limbs . iter ( ) . enumerate ( ) { if limb == 0 { continue ; } let index = limb . trailing_zeros ( ) as usize / bit_length ; return Some ( ( i * entries_per_limb + index , ( ( limb >> ( index * bit_length ) ) & bitmask ) as u32 , ) ) ; } None }
Find the index and value of the first non-zero entry of the vector.
Find the index and value of the first non - zero entry of the vector .
&self
&self