pub fn reiterate(&mut self, limit: usize) {
        #[cfg(debug_assertions)]
        println!("reiteration! {}", limit);

        if limit <= self.limit {
            return;
        }

        let n_chunks = self.chunks.len();
        let mut done_chunks: Vec<IterMapChunk> = Vec::with_capacity(n_chunks);
        let mut active_threads: usize = 0;
        let (tx, rx) = mpsc::channel::<IterMapChunk>();
        while done_chunks.len() < n_chunks {
            if active_threads < *N_THREADS {
                if let Some(mut imc) = self.chunks.pop() {
                    let txc = tx.clone();
                    thread::spawn(move || {
                        imc.reiterate(limit);
                        txc.send(imc).unwrap();
                    });
                    active_threads += 1;
                }
            }
            if active_threads == *N_THREADS || self.chunks.is_empty() {
                let imc = rx.recv().unwrap();
                active_threads -= 1;
                done_chunks.push(imc);
            }
        }

        done_chunks.sort_by_key(|imc| imc.y_start);

        std::mem::swap(&mut self.chunks, &mut done_chunks);
        self.limit = limit;
    }
/**
    Extend the current `IterMap` to more steps.

    This is useful if the image dimensions and iteration parameters haven't
    changed, but there's a new target `ColorMap` that's of longer length.

    This method will grovel through all the points in the `IterMap` and
    re-iterate only those who have the previous maximum value.
    */
Extend the current `IterMap` to more steps.
This is useful if the image dimensions and iteration parameters haven't
changed, but there's a new target `ColorMap` that's of longer length.

This method will grovel through all the points in the `IterMap` and
re-iterate only those who have the previous maximum value.
Extend the current ` IterMap ` to more steps . This is useful if the image dimensions and iteration parameters haven ' t changed but there ' s a new target ` ColorMap ` that ' s of longer length . This method will grovel through all the points in the ` IterMap ` and re - iterate only those who have the previous maximum value .
pub fn reiterate(&mut self, limit: usize) {
        #[cfg(debug_assertions)]
        println!("reiteration! {}", limit);
        if limit <= self.limit {
            return;
        }
        let n_chunks = self.chunks.len();
        let mut done_chunks: Vec<IterMapChunk> = Vec::with_capacity(n_chunks);
        let mut active_threads: usize = 0;
        let (tx, rx) = mpsc::channel::<IterMapChunk>();
        while done_chunks.len() < n_chunks {
            if active_threads < *N_THREADS {
                if let Some(mut imc) = self.chunks.pop() {
                    let txc = tx.clone();
                    thread::spawn(move || {
                        imc.reiterate(limit);
                        txc.send(imc).unwrap();
                    });
                    active_threads += 1;
                }
            }
            if active_threads == *N_THREADS || self.chunks.is_empty() {
                let imc = rx.recv().unwrap();
                active_threads -= 1;
                done_chunks.push(imc);
            }
        }
        done_chunks.sort_by_key(|imc| imc.y_start);
        std::mem::swap(&mut self.chunks, &mut done_chunks);
        self.limit = limit;
    }
pub fn reiterate ( & mut self , limit : usize ) { # [ cfg ( debug_assertions ) ] println ! ( " " limit ) ; if limit <= self . limit { return ; } let n_chunks = self . chunks . len ( ) ; let mut done_chunks : Vec < IterMapChunk > = Vec :: with_capacity ( n_chunks ) ; let mut active_threads : usize = 0 ; let ( tx , rx ) = mpsc :: channel :: < IterMapChunk > ( ) ; while done_chunks . len ( ) < n_chunks { if active_threads < * N_THREADS { if let Some ( mut imc ) = self . chunks . pop ( ) { let txc = tx . clone ( ) ; thread :: spawn ( move | | { imc . reiterate ( limit ) ; txc . send ( imc ) . unwrap ( ) ; } ) ; active_threads += 1 ; } } if active_threads == * N_THREADS || self . chunks . is_empty ( ) { let imc = rx . recv ( ) . unwrap ( ) ; active_threads -= 1 ; done_chunks . push ( imc ) ; } } done_chunks . sort_by_key ( | imc | imc . y_start ) ; std :: mem :: swap ( & mut self . chunks , & mut done_chunks ) ; self . limit = limit ; }
Extend the current `IterMap` to more steps.
Extend the current ` IterMap ` to more steps .
&mut self
limit
usize
&mut self
limit
usize