/// `compute_homomorphism` for fallible functions.
`compute_homomorphism` for fallible functions.
` compute_homomorphism ` for fallible functions .
pub fn try_compute_homomorphism<E, H>(
        &self,
        mut compute: impl FnMut(usize, &G) -> Result<H, E>,
        mut compose: impl FnMut(&H, &H) -> Result<H, E>,
    ) -> Result<Vec<H>, E>
    {Ok({
        let len = self.members.len();
        let mut out = Vec::with_capacity(len);
        for (index, g, decomp) in izip!(0..len, &self.members, &self.decomps) {
            let value = match *decomp {
                None => compute(index, g)?,
                Some((a, b)) => compose(&out[a], &out[b])?,
            };
            out.push(value);
        }
        out
    })}
pub fn try_compute_homomorphism < E , H > ( & self , mut compute : impl FnMut ( usize , & G ) -> Result < H , E > , mut compose : impl FnMut ( & H , & H ) -> Result < H , E > , ) -> Result < Vec < H > , E > { Ok ( { let len = self . members . len ( ) ; let mut out = Vec :: with_capacity ( len ) ; for ( index , g , decomp ) in izip ! ( 0 len self members self decomps ) { let value = match * decomp { None => compute ( index , g ) ? , Some ( ( a , b ) ) => compose ( & out [ a ] , & out [ b ] ) ? , } ; out . push ( value ) ; } out } ) }
`compute_homomorphism` for fallible functions.
` compute_homomorphism ` for fallible functions .
&self
compute
impl FnMut(usize, &G) -> Result<H, E>
compose
impl FnMut(&H, &H) -> Result<H, E>