pub fn insert<F>(&mut self, path: &[usize], get_value: &mut F) -> Result<(), Error>
    where
        F: FnMut(&[Vec<usize>], &[usize]) -> Result<T, Error>,
    {
        let combination_iter = CombinationIterator::new(self.nb_tries, self.nb_required);
        let min_nb_digits = self.oracle_numeric_infos.get_min_nb_digits();

        for selector in combination_iter {
            let combinations = if self.nb_required > 1 {
                let mut digit_infos = self
                    .oracle_numeric_infos
                    .nb_digits
                    .iter()
                    .enumerate()
                    .filter_map(|(i, x)| {
                        if selector.contains(&i) {
                            Some(*x)
                        } else {
                            None
                        }
                    })
                    .collect::<Vec<_>>();
                let min_index = reorder_to_min_first(&mut digit_infos);
                let to_pad = digit_infos[0] - min_nb_digits;
                let padded_path = pre_pad_vec(path.to_vec(), path.len() + to_pad);
                let mut combinations = compute_outcome_combinations(
                    &digit_infos,
                    &padded_path,
                    self.max_error_exp,
                    self.min_support_exp,
                    self.maximize_coverage,
                );
                if min_index != 0 {
                    for combination in &mut combinations {
                        let to_reorder = combination.remove(0);
                        combination.insert(min_index, to_reorder);
                    }
                }
                combinations
            } else {
                vec![vec![path.to_vec()]]
            };

            for combination in combinations {
                self.insert_internal(selector[0], &combination, 0, &selector, get_value)?;
            }
        }

        Ok(())
    }
/// Insert the value returned by `get_value` at the position specified by `path`.
Insert the value returned by `get_value` at the position specified by `path`.
Insert the value returned by ` get_value ` at the position specified by ` path ` .
pub fn insert<F>(&mut self, path: &[usize], get_value: &mut F) -> Result<(), Error>
    where
        F: FnMut(&[Vec<usize>], &[usize]) -> Result<T, Error>,
    {
        let combination_iter = CombinationIterator::new(self.nb_tries, self.nb_required);
        let min_nb_digits = self.oracle_numeric_infos.get_min_nb_digits();
        for selector in combination_iter {
            let combinations = if self.nb_required > 1 {
                let mut digit_infos = self
                    .oracle_numeric_infos
                    .nb_digits
                    .iter()
                    .enumerate()
                    .filter_map(|(i, x)| {
                        if selector.contains(&i) {
                            Some(*x)
                        } else {
                            None
                        }
                    })
                    .collect::<Vec<_>>();
                let min_index = reorder_to_min_first(&mut digit_infos);
                let to_pad = digit_infos[0] - min_nb_digits;
                let padded_path = pre_pad_vec(path.to_vec(), path.len() + to_pad);
                let mut combinations = compute_outcome_combinations(
                    &digit_infos,
                    &padded_path,
                    self.max_error_exp,
                    self.min_support_exp,
                    self.maximize_coverage,
                );
                if min_index != 0 {
                    for combination in &mut combinations {
                        let to_reorder = combination.remove(0);
                        combination.insert(min_index, to_reorder);
                    }
                }
                combinations
            } else {
                vec![vec![path.to_vec()]]
            };
            for combination in combinations {
                self.insert_internal(selector[0], &combination, 0, &selector, get_value)?;
            }
        }
        Ok(())
    }
pub fn insert < F > ( & mut self , path : & [ usize ] , get_value : & mut F ) -> Result < ( ) , Error > where F : FnMut ( & [ Vec < usize > ] , & [ usize ] ) -> Result < T , Error > , { let combination_iter = CombinationIterator :: new ( self . nb_tries , self . nb_required ) ; let min_nb_digits = self . oracle_numeric_infos . get_min_nb_digits ( ) ; for selector in combination_iter { let combinations = if self . nb_required > 1 { let mut digit_infos = self . oracle_numeric_infos . nb_digits . iter ( ) . enumerate ( ) . filter_map ( | ( i , x ) | { if selector . contains ( & i ) { Some ( * x ) } else { None } } ) . collect :: < Vec < _ > > ( ) ; let min_index = reorder_to_min_first ( & mut digit_infos ) ; let to_pad = digit_infos [ 0 ] - min_nb_digits ; let padded_path = pre_pad_vec ( path . to_vec ( ) , path . len ( ) + to_pad ) ; let mut combinations = compute_outcome_combinations ( & digit_infos , & padded_path , self . max_error_exp , self . min_support_exp , self . maximize_coverage , ) ; if min_index != 0 { for combination in & mut combinations { let to_reorder = combination . remove ( 0 ) ; combination . insert ( min_index , to_reorder ) ; } } combinations } else { vec ! [ vec [ path to_vec ( ) ] ] } ; for combination in combinations { self . insert_internal ( selector [ 0 ] , & combination , 0 , & selector , get_value ) ? ; } } Ok ( ( ) ) }
Insert the value returned by `get_value` at the position specified by `path`.
Insert the value returned by ` get_value ` at the position specified by ` path ` .
&mut self
path
&[usize]
get_value
&mut F