/* gamma = product (1-z*a^Ij) for erasure locs Ij */ void CReedSolomon::init_gamma (int gamma []) { int tmp [MAX_LENGTH]; for (int i = 0; i < MAX_LENGTH; i ++) { gamma [i] = 0; tmp [i] = 0; } gamma[0] = 1; for (int e = 0; e < m_NErasures; e ++) { copy_poly (tmp, gamma); scale_poly (byExpToInt [m_ErasureLocs [e]], tmp); mul_z_poly (tmp); add_polys (gamma, tmp); } }
/* gamma = product (1-z*a^Ij) for erasure locs Ij */ void init_gamma (int gamma[]) { int e, tmp[MAXDEG]; zero_poly(gamma); zero_poly(tmp); gamma[0] = 1; for (e = 0; e < NErasures; e++) { copy_poly(tmp, gamma); scale_poly(gexp[ErasureLocs[e]], tmp); mul_z_poly(tmp); add_polys(gamma, tmp); } }