Lines Matching defs:hgcd
38 static void hgcd_ref_init (struct hgcd_ref *hgcd);
39 static void hgcd_ref_clear (struct hgcd_ref *hgcd);
40 static int hgcd_ref (struct hgcd_ref *hgcd, mpz_t a, mpz_t b);
162 struct hgcd_matrix hgcd;
188 mpn_hgcd_matrix_init (&hgcd, asize, hgcd_init_tp);
227 &hgcd, hgcd_tp);
262 res[1], &hgcd))
265 fprintf (stderr, "Invalid results for hgcd and hgcd_ref\n");
285 hgcd_ref_init (struct hgcd_ref *hgcd)
292 mpz_init (hgcd->m[i][j]);
297 hgcd_ref_clear (struct hgcd_ref *hgcd)
304 mpz_clear (hgcd->m[i][j]);
322 hgcd_ref (struct hgcd_ref *hgcd, mpz_t a, mpz_t b)
339 mpz_set_ui (hgcd->m[0][0], 1); mpz_set_ui (hgcd->m[0][1], 0);
340 mpz_set_ui (hgcd->m[1][0], 1); mpz_set_ui (hgcd->m[1][1], 1);
348 mpz_set_ui (hgcd->m[0][0], 1); mpz_set_ui (hgcd->m[0][1], 1);
349 mpz_set_ui (hgcd->m[1][0], 0); mpz_set_ui (hgcd->m[1][1], 1);
365 mpz_addmul (hgcd->m[0][1], q, hgcd->m[0][0]);
366 mpz_addmul (hgcd->m[1][1], q, hgcd->m[1][0]);
372 mpz_addmul (hgcd->m[0][0], q, hgcd->m[0][1]);
373 mpz_addmul (hgcd->m[1][0], q, hgcd->m[1][1]);
402 mp_size_t res1, struct hgcd_matrix *hgcd)
462 mp_size_t mn = hgcd->n;
463 MPN_NORMALIZE (hgcd->p[i][j], mn);
465 MPN_COPY (PTR (appr.m[i][j]), hgcd->p[i][j], mn);