/// Query the virtual oracle cosets at `coset_index` in the codeword domain.
Query the virtual oracle cosets at `coset_index` in the codeword domain.
Query the virtual oracle cosets at ` coset_index ` in the codeword domain .
pub fn query_coset<O: RoundOracle<F>>(
        &self,
        coset_index: &[usize],
        iop_messages: &mut MessagesCollection<F, O>,
    ) -> CosetQueryResult<F> {
        // first, construct constituent oracles
        let constituent_oracle_handles = self.coset_evaluator.constituent_oracle_handles();
        // constituent_oracles[i][j][k] is coset_index[i] -> oracle_index[j] ->
        // element_index[k]
        let constituent_oracles = constituent_oracle_handles
            .into_iter()
            .map(|(round, idxes)| {
                // check idxes have unique elements
                debug_assert!(
                    idxes.iter().collect::<BTreeSet<_>>().len() == idxes.len(),
                    "idxes must be unique"
                );
                let query_responses = iop_messages.prover_round(round).query_coset(
                    coset_index,
                    iop_trace!("constituent oracle for virtual oracle"),
                );
                query_responses.into_iter() // iterate over cosets
                    .map(|mut c| { // shape (num_oracles_in_this_round, num_elements_in_coset)
                        idxes.iter().map(|idx| take(&mut c[idx.idx])).collect::<Vec<_>>() // shape (num_oracles_needed_for_this_round, num_elements_in_coset) 
                    }).collect::<Vec<_>>()
                // shape: (num_cosets, num_oracles_needed_for_this_round,
                // num_elements_in_coset)
            })
            .fold(vec![vec![]; coset_index.len()], |mut acc, r| {
                // shape of r is (num_cosets, num_oracles_needed_for_this_round,
                // num_elements_in_coset) result shape: (num_cosets,
                // num_oracles_needed_for_all_rounds, num_elements_in_coset)
                acc.iter_mut().zip(r).for_each(|(a, r)| {
                    a.extend(r);
                });
                acc
            });
        // shape: (num_cosets, num_oracles_needed_for_all_rounds, num_elements_in_coset)
        // convert coset index to cosets
        let queried_cosets = coset_index
            .iter()
            .map(|&i| {
                self.codeword_domain
                    .query_position_to_coset(i, self.localization_param)
                    .1
            })
            .collect::<Vec<_>>();
        let query_result = constituent_oracles
            .into_iter()
            .zip(queried_cosets)
            .map(|(cons, coset)| self.coset_evaluator.evaluate(coset, &cons))
            .collect::<Vec<Vec<_>>>();
        CosetQueryResult::from_single_oracle_result(query_result)
    }
pub fn query_coset < O : RoundOracle < F > > ( & self , coset_index : & [ usize ] , iop_messages : & mut MessagesCollection < F , O > , ) -> CosetQueryResult < F > { // first, construct constituent oracles let constituent_oracle_handles = self . coset_evaluator . constituent_oracle_handles ( ) ; // constituent_oracles[i][j][k] is coset_index[i] -> oracle_index[j] -> // element_index[k] let constituent_oracles = constituent_oracle_handles . into_iter ( ) . map ( | ( round , idxes ) | { // check idxes have unique elements debug_assert ! ( idxes iter ( ) collect BTreeSet ( ) len ( ) idxes len ( ) " " ) ; let query_responses = iop_messages . prover_round ( round ) . query_coset ( coset_index , iop_trace ! ( " " ) , ) ; query_responses . into_iter ( ) // iterate over cosets . map ( | mut c | { // shape (num_oracles_in_this_round, num_elements_in_coset) idxes . iter ( ) . map ( | idx | take ( & mut c [ idx . idx ] ) ) . collect :: < Vec < _ > > ( ) // shape (num_oracles_needed_for_this_round, num_elements_in_coset)  } ) . collect :: < Vec < _ > > ( ) // shape: (num_cosets, num_oracles_needed_for_this_round, // num_elements_in_coset) } ) . fold ( vec ! [ vec [ ] coset_index len ( ) ] , | mut acc , r | { // shape of r is (num_cosets, num_oracles_needed_for_this_round, // num_elements_in_coset) result shape: (num_cosets, // num_oracles_needed_for_all_rounds, num_elements_in_coset) acc . iter_mut ( ) . zip ( r ) . for_each ( | ( a , r ) | { a . extend ( r ) ; } ) ; acc } ) ; // shape: (num_cosets, num_oracles_needed_for_all_rounds, num_elements_in_coset) // convert coset index to cosets let queried_cosets = coset_index . iter ( ) . map ( | & i | { self . codeword_domain . query_position_to_coset ( i , self . localization_param ) . 1 } ) . collect :: < Vec < _ > > ( ) ; let query_result = constituent_oracles . into_iter ( ) . zip ( queried_cosets ) . map ( | ( cons , coset ) | self . coset_evaluator . evaluate ( coset , & cons ) ) . collect :: < Vec < Vec < _ > > > ( ) ; CosetQueryResult :: from_single_oracle_result ( query_result ) }
Query the virtual oracle cosets at `coset_index` in the codeword domain.
Query the virtual oracle cosets at ` coset_index ` in the codeword domain .
&self
coset_index
&[usize]
iop_messages
&mut MessagesCollection<F, O>