pub fn add_composite(&self, s: u32, degree: i32, maps: CompositeData<A>, dir: Option<&Path>) {
        for (_, d1, d0) in &maps {
            assert!(Arc::ptr_eq(&d1.target(), &d0.source()));
            assert!(Arc::ptr_eq(&d0.target(), &self.target));
            assert_eq!(d1.degree_shift() + d0.degree_shift(), self.shift_t);
        }

        let f = |t, idx| {
            let save_file = SaveFile {
                algebra: self.target.algebra(),
                kind: SaveKind::SecondaryComposite,
                s,
                t,
                idx: Some(idx),
            };
            if let Some(dir) = dir {
                if let Some(mut f) = save_file.open_file(dir.to_owned()) {
                    return SecondaryComposite::from_bytes(
                        Arc::clone(&self.target),
                        t - self.shift_t,
                        self.hit_generator,
                        &mut f,
                    )
                    .unwrap();
                }
            }

            let mut composite = SecondaryComposite::new(
                Arc::clone(&self.target),
                t - self.shift_t,
                self.hit_generator,
            );
            for (coef, d1, d0) in &maps {
                composite.add_composite(*coef, t, idx, &*d1, &*d0);
            }
            composite.finalize();

            if let Some(dir) = dir {
                let mut f = save_file.create_file(dir.to_owned());
                composite.to_bytes(&mut f).unwrap();
            }

            composite
        };

        #[cfg(not(feature = "concurrent"))]
        self.composites.extend(degree, |t| {
            (0..self.source.number_of_gens_in_degree(t))
                .map(|i| f(t, i))
                .collect()
        });

        #[cfg(feature = "concurrent")]
        self.composites.par_extend(degree, |t| {
            (0..self.source.number_of_gens_in_degree(t))
                .into_par_iter()
                .map(|i| f(t, i))
                .collect()
        });
    }
/// Add composites up to and including the specified degree
Add composites up to and including the specified degree
Add composites up to and including the specified degree
pub fn add_composite(&self, s: u32, degree: i32, maps: CompositeData<A>, dir: Option<&Path>) {
        for (_, d1, d0) in &maps {
            assert!(Arc::ptr_eq(&d1.target(), &d0.source()));
            assert!(Arc::ptr_eq(&d0.target(), &self.target));
            assert_eq!(d1.degree_shift() + d0.degree_shift(), self.shift_t);
        }
        let f = |t, idx| {
            let save_file = SaveFile {
                algebra: self.target.algebra(),
                kind: SaveKind::SecondaryComposite,
                s,
                t,
                idx: Some(idx),
            };
            if let Some(dir) = dir {
                if let Some(mut f) = save_file.open_file(dir.to_owned()) {
                    return SecondaryComposite::from_bytes(
                        Arc::clone(&self.target),
                        t - self.shift_t,
                        self.hit_generator,
                        &mut f,
                    )
                    .unwrap();
                }
            }
            let mut composite = SecondaryComposite::new(
                Arc::clone(&self.target),
                t - self.shift_t,
                self.hit_generator,
            );
            for (coef, d1, d0) in &maps {
                composite.add_composite(*coef, t, idx, &*d1, &*d0);
            }
            composite.finalize();
            if let Some(dir) = dir {
                let mut f = save_file.create_file(dir.to_owned());
                composite.to_bytes(&mut f).unwrap();
            }
            composite
        };
        #[cfg(not(feature = "concurrent"))]
        self.composites.extend(degree, |t| {
            (0..self.source.number_of_gens_in_degree(t))
                .map(|i| f(t, i))
                .collect()
        });
        #[cfg(feature = "concurrent")]
        self.composites.par_extend(degree, |t| {
            (0..self.source.number_of_gens_in_degree(t))
                .into_par_iter()
                .map(|i| f(t, i))
                .collect()
        });
    }
pub fn add_composite ( & self , s : u32 , degree : i32 , maps : CompositeData < A > , dir : Option < & Path > ) { for ( _ , d1 , d0 ) in & maps { assert ! ( Arc ptr_eq ( d1 target ( ) d0 source ( ) ) ) ; assert ! ( Arc ptr_eq ( d0 target ( ) self target ) ) ; assert_eq ! ( d1 degree_shift ( ) d0 degree_shift ( ) self shift_t ) ; } let f = | t , idx | { let save_file = SaveFile { algebra : self . target . algebra ( ) , kind : SaveKind :: SecondaryComposite , s , t , idx : Some ( idx ) , } ; if let Some ( dir ) = dir { if let Some ( mut f ) = save_file . open_file ( dir . to_owned ( ) ) { return SecondaryComposite :: from_bytes ( Arc :: clone ( & self . target ) , t - self . shift_t , self . hit_generator , & mut f , ) . unwrap ( ) ; } } let mut composite = SecondaryComposite :: new ( Arc :: clone ( & self . target ) , t - self . shift_t , self . hit_generator , ) ; for ( coef , d1 , d0 ) in & maps { composite . add_composite ( * coef , t , idx , & * d1 , & * d0 ) ; } composite . finalize ( ) ; if let Some ( dir ) = dir { let mut f = save_file . create_file ( dir . to_owned ( ) ) ; composite . to_bytes ( & mut f ) . unwrap ( ) ; } composite } ; # [ cfg ( not ( feature " " ) ) ] self . composites . extend ( degree , | t | { ( 0 .. self . source . number_of_gens_in_degree ( t ) ) . map ( | i | f ( t , i ) ) . collect ( ) } ) ; # [ cfg ( feature " " ) ] self . composites . par_extend ( degree , | t | { ( 0 .. self . source . number_of_gens_in_degree ( t ) ) . into_par_iter ( ) . map ( | i | f ( t , i ) ) . collect ( ) } ) ; }
Add composites up to and including the specified degree
Add composites up to and including the specified degree
&self
s
u32
degree
i32
maps
CompositeData<A>
dir
Option<&Path>
&self
s
u32
degree
i32
maps
CompositeData<A>
dir
Option<&Path>