fn point_query_to_coset_query(
    point_indices: &[usize],
    log_num_cosets: usize,
) -> (Vec<usize>, Vec<usize>) {
    // coset index = position % num_cosets = the least significant `log_num_cosets`
    // bits of pos element index in coset = position / num_cosets = all
    // other bits
    let coset_index = point_indices
        .iter()
        .map(|&pos| pos & ((1 << log_num_cosets) - 1))
        .collect::<Vec<_>>();
    let element_index_in_coset = point_indices
        .iter()
        .map(|&pos| pos >> log_num_cosets)
        .collect::<Vec<_>>();
    (coset_index, element_index_in_coset)
}
/// Given point indices, return coset index and element index in coset.
Given point indices, return coset index and element index in coset.
Given point indices return coset index and element index in coset .
fn point_query_to_coset_query(
    point_indices: &[usize],
    log_num_cosets: usize,
) -> (Vec<usize>, Vec<usize>) {
    // coset index = position % num_cosets = the least significant `log_num_cosets`
    // bits of pos element index in coset = position / num_cosets = all
    // other bits
    let coset_index = point_indices
        .iter()
        .map(|&pos| pos & ((1 << log_num_cosets) - 1))
        .collect::<Vec<_>>();
    let element_index_in_coset = point_indices
        .iter()
        .map(|&pos| pos >> log_num_cosets)
        .collect::<Vec<_>>();
    (coset_index, element_index_in_coset)
}
fn point_query_to_coset_query ( point_indices : & [ usize ] , log_num_cosets : usize , ) -> ( Vec < usize > , Vec < usize > ) { // coset index = position % num_cosets = the least significant `log_num_cosets` // bits of pos element index in coset = position / num_cosets = all // other bits let coset_index = point_indices . iter ( ) . map ( | & pos | pos & ( ( 1 << log_num_cosets ) - 1 ) ) . collect :: < Vec < _ > > ( ) ; let element_index_in_coset = point_indices . iter ( ) . map ( | & pos | pos >> log_num_cosets ) . collect :: < Vec < _ > > ( ) ; ( coset_index , element_index_in_coset ) }
Given point indices, return coset index and element index in coset.
Given point indices return coset index and element index in coset .
point_indices
&[usize]
log_num_cosets
usize
point_indices
&[usize]
log_num_cosets
usize