Changeset 045efb in git for libpolys/coeffs/longrat.cc
- Timestamp:
- Aug 10, 2011, 7:43:14 PM (13 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 5ff1d31f3d80f972b5abf4d4435d01cb9b033ffb
- Parents:
- b1ca9992c1a4e67c4f6161015c9bb3efd24c96f4
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-08-10 19:43:14+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 13:19:14+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/longrat.cc
rb1ca999 r045efb 542 542 } 543 543 544 void nlMPZ(mpz_t m, number &n, const coeffs r) 545 { 546 assume( getCoeffType(r) == ID ); 547 548 nlTest(n, r); 549 nlNormalize(n, r); 550 if (SR_HDL(n) & SR_INT) mpz_init_set_si(m, SR_TO_INT(n)); /* n fits in an int */ 551 else mpz_init_set(m, (mpz_ptr)n->z); 552 } 553 554 544 555 /*2 545 556 * convert number to int … … 2091 2102 } 2092 2103 2093 2094 2104 LINLINE number nlInit (int i, const coeffs r) 2095 2105 { … … 2102 2112 } 2103 2113 2114 2115 number nlInitMPZ(mpz_t m, const coeffs r) 2116 { 2117 number z = ALLOC_RNUMBER(); 2118 mpz_init_set(z->z, m); 2119 mpz_init_set_ui(z->n, 1); 2120 z->s = 3; 2121 return z; 2122 } 2104 2123 2105 2124 /*2 … … 2596 2615 r->cfExactDiv= nlExactDiv; 2597 2616 r->cfInit = nlInit; 2617 r->cfInitMPZ = nlInitMPZ; 2598 2618 r->cfSize = nlSize; 2599 2619 r->cfInt = nlInt; 2620 r->cfMPZ = nlMPZ; 2621 2600 2622 r->cfChineseRemainder=nlChineseRemainder; 2601 2623 r->cfFarey=nlFarey;
Note: See TracChangeset
for help on using the changeset viewer.