Borderbasix

Scl_mpz.hpp
Go to the documentation of this file.
1 /*********************************************************************
2 * This file is part of the source code of BORDERBASIX software. *
3 * (C) B. Mourrain, GALAAD, INRIA *
4 **********************************************************************
5 History:
6 $Id: Scl_mpz.hpp,v 1.1.1.1 2006/10/06 08:01:40 trebuche Exp $
7 **********************************************************************/
8 #ifndef _SCL_MPZ_H_
9 #define _SCL_MPZ_H_
10 //----------------------------------------------------------------------
11 #include <string>
12 #include "Scl.hpp"
13 //----------------------------------------------------------------------
14 typedef MP_INT MPZ;
15 #define _MPZ_
16 //----------------------------------------------------------------------
17 // template<> inline
18 // shared_object<MPZ>::rep::~rep()
19 // {
20 // //COUT <<"Delete mpz"<<endl;
21 // mpz_clear(&obj);
22 // }
23 //----------------------------------------------------------------------
24 template<> inline Scl<MPZ>::~Scl ( )
25 {
26  //COUT <<"Delete mpz"<<endl;
27  mpz_clear(&rep());
28 }
29 //----------------------------------------------------------------------
30 template<> inline
31 void Scl<MPZ>::init ( )
32 {
33  //COUT <<"Init mpz"<<endl;
34  mpz_init(&rep());
35 }
36 //------------------- Scl<T> (...) -------------------------------------
37 template<> inline
38 Scl<MPZ>::Scl () //: data()
39 {
40  //COUNT<MPZ>(' ');
41  mpz_init(&rep());
42 }
43 //----------------------------------------------------------------------
44 template<> inline
45 Scl<MPZ>::Scl (signed long int sl): data() {mpz_init_set_si(&rep(),sl);}
46 //----------------------------------------------------------------------
47 template<> inline
48 Scl<MPZ>::Scl (unsigned long int ul): data() {mpz_init_set_ui(&rep(),ul);}
49 //----------------------------------------------------------------------
50 template<> inline
51 Scl<MPZ>::Scl (int si): data() {mpz_init_set_si(&rep(), si);}
52 //----------------------------------------------------------------------
53 template<> inline
54 Scl<MPZ>::Scl (const char *str, unsigned int base): data()
55 {
56  if (mpz_init_set_str(&rep(), str, base))
57  std::cerr << "Scl<MPZ>: The string " << str
58  << " is not a valid number in base " << base << std::endl;
59 }
60 //----------------------------------------------------------------------
61 template<> inline
62 Scl<MPZ>::Scl (const Scl<MPZ> & rhs)
63 {
64  //COUT <<"Init mpz"<<endl;
65  //COUNT<MPZ>('c');
66  mpz_init_set(&rep(), &rhs.rep());
67 }
68 //{ data=b.data;}
69 //----------------------------------------------------------------------
70 template<> inline
72 {
73  //COUNT<MPZ>('=');
74  if (this != &rhs) mpz_set(&rep(), &rhs.rep());
75  return *this;
76 }
77 // == ------------------------------------------------------------------
78 template<> inline
79 bool Scl<MPZ>::operator == (const Scl<MPZ>& rhs) const
80 {
81  return mpz_cmp(&rep(), &rhs.rep()) == 0;
82 }
83 
84 template<> inline
85 bool Scl<MPZ>::operator == (long sl) const {
86  return mpz_cmp_si(&rep(), sl) == 0;
87 }
88 
89 template<> inline
90 bool Scl<MPZ>::operator == (int si) const {
91  return mpz_cmp_si(&rep(), (long) si) == 0;
92 }
93 
94 template<> inline
95 bool Scl<MPZ>::operator == (unsigned long ul) const
96 {
97  return mpz_cmp_ui(&rep(), ul) == 0;
98 }
99 
100 // != ------------------------------------------------------------------
101 template<> inline
102 bool Scl<MPZ>::operator != (const Scl<MPZ>& rhs) const
103 {
104  return mpz_cmp(&rep(), &rhs.rep()) != 0;
105 }
106 
107 template<> inline
108 bool Scl<MPZ>::operator != (long sl) const {
109  return mpz_cmp_si(&rep(), sl) != 0;
110 }
111 
112 template<> inline
113 bool Scl<MPZ>::operator != (int si) const {
114  return mpz_cmp_si(&rep(), (long) si) != 0;
115 }
116 
117 template<> inline
118 bool Scl<MPZ>::operator != (unsigned long ul) const
119 {
120  return mpz_cmp_ui(&rep(), ul) != 0;
121 }
122 // > -------------------------------------------------------------------
123 template<> inline
124 bool Scl<MPZ>::operator > (const Scl<MPZ>& rhs) const
125 {
126  return mpz_cmp(&rep(), &rhs.rep()) > 0;
127 }
128 
129 template<> inline
130 bool Scl<MPZ>::operator > (long sl) const {
131  return mpz_cmp_si(&rep(), sl) > 0;
132 }
133 
134 template<> inline
135 bool Scl<MPZ>::operator > (int si) const {
136  return mpz_cmp_si(&rep(), (long) si) > 0;
137 }
138 
139 template<> inline
140 bool Scl<MPZ>::operator > (unsigned long ul) const
141 {
142  return mpz_cmp_ui(&rep(), ul) > 0;
143 }
144 // <= --------------------------------------------------------------------
145 template<> inline
146 bool Scl<MPZ>::operator >= (const Scl<MPZ>& rhs) const
147 {
148  return mpz_cmp(&rep(), &rhs.rep()) >= 0;
149 }
150 
151 template<> inline
152 bool Scl<MPZ>::operator >= (long sl) const {
153  return mpz_cmp_si(&rep(), sl) >= 0;
154 }
155 
156 template<> inline
157 bool Scl<MPZ>::operator >= (int si) const
158 {
159  return mpz_cmp_si(&rep(), (long) si) >= 0;
160 }
161 
162 template<> inline
163 bool Scl<MPZ>::operator >= (unsigned long ul) const
164 {
165  return mpz_cmp_ui(&rep(), ul) >= 0;
166 }
167 
168 // < -------------------------------------------------------------------
169 template<> inline
170 bool Scl<MPZ>::operator < (const Scl<MPZ>& rhs) const
171 {
172  return mpz_cmp(&rep(), &rhs.rep()) < 0;
173 }
174 
175 template<> inline
176 bool Scl<MPZ>::operator < (long sl) const {
177  return mpz_cmp_si(&rep(), sl) < 0;
178 }
179 
180 template<> inline
181 bool Scl<MPZ>::operator < (int si) const
182 {
183  return mpz_cmp_si(&rep(), (long) si) < 0;
184 }
185 
186 template<> inline
187 bool Scl<MPZ>::operator < (unsigned long ul) const
188 {
189  return mpz_cmp_ui(&rep(), ul) < 0;
190 }
191 
192 // <= ------------------------------------------------------------------
193 
194 template<> inline
195 bool Scl<MPZ>::operator <= (const Scl<MPZ>& rhs) const
196 {
197  return mpz_cmp(&rep(), &rhs.rep()) <= 0;
198 }
199 
200 template<> inline
201 bool Scl<MPZ>::operator <= (long sl) const {
202  return mpz_cmp_si(&rep(), sl) <= 0;
203 }
204 
205 template<> inline
206 bool Scl<MPZ>::operator <= (int si) const
207 {
208  return mpz_cmp_si(&rep(), (long) si) <= 0;
209 }
210 
211 template<> inline
212 bool Scl<MPZ>::operator <= (unsigned long ul) const
213 {
214  return mpz_cmp_ui(&rep(), ul) <= 0;
215 }
216 
217 // = -------------------------------------------------------------------
218 template<> inline
220 {
221  mpz_set_ui(&rep(), ul); return *this;
222 }
223 
224 template<> inline
226 {
227  mpz_set_si(&rep(), sl); return *this;
228 }
229 
230 template<> inline
232 {
233  mpz_init_set_si(&(this->rep()), ul); return *this;
234 }
235 // += -------------------------------------------------------------------
236 template<> inline
238 {
239  mpz_add(&rep(), &rep(), &rhs.rep()); return *this;
240 }
241 
242 template<> inline
244 {
245  mpz_add_ui(&rep(), &rep(), ul); return *this;
246 }
247 
248 template<> inline
250 {
251  if (sl >= 0)
252  mpz_add_ui(&rep(), &rep(), (unsigned long) sl);
253  else
254  mpz_sub_ui(&rep(), &rep(), ((unsigned long) -sl));
255  return *this;
256 }
257 
258 template<> inline
260 {
261  *this += Scl<MPZ>(ul); return *this;
262 }
263 
264 // -= -------------------------------------------------------------------
265 template<> inline
267 {
268  mpz_sub(&rep(), &rep(), &rhs.rep()); return *this;
269 }
270 
271 template<> inline
273 {
274  mpz_sub_ui(&rep(), &rep(), ul); return *this;
275 }
276 
277 template<> inline
279 {
280  if (sl >= 0)
281  mpz_sub_ui(&rep(), &rep(), (unsigned long) sl);
282  else
283  mpz_add_ui(&rep(), &rep(), (unsigned long) sl);
284  return *this;
285 }
286 
287 template<> inline
289 {
290  *this -= Scl<MPZ>(ul); return *this;
291 }
292 // *= -----------------------------------------------------------------
293 template<> inline
295 {
296  mpz_mul(&rep(), &rep(), &rhs.rep()); return *this;
297 }
298 template<> inline
300 {
301  mpz_mul_ui(&rep(), &rep(), ul); return *this;
302 }
303 template<> inline
305 {
306  if (sl >= 0)
307  mpz_mul_ui(&rep(), &rep(), (unsigned long) sl);
308  else
309  {
310  rep()._mp_size = -rep()._mp_size;
311  mpz_mul_ui(&rep(), &rep(), ((unsigned long) -sl));
312  }
313  return *this;
314 }
315 template<> inline
317 {
318  if (ul >= 0)
319  mpz_mul_ui(&rep(), &rep(), (unsigned long) ul);
320  else {
321  mpz_mul_ui(&rep(), &rep(), (unsigned long) (-ul));
322  mpz_neg(&rep(), &rep());
323  }
324  return *this;
325 }
326 // /= ------------------------------------------------------------------
327 template<> inline
329 {
330  mpz_div(&rep(), &rep(), &rhs.rep());
331  //mpz_divexact(&rep(), &rep(), &rhs.rep());
332  return *this;
333 }
334 template<> inline
336 {
337  mpz_div_ui(&rep(), &rep(), ul); return *this;
338 }
339 
340 template<> inline
342 {
343  if (sl >= 0)
344  mpz_div_ui(&rep(), &rep(), (unsigned long) sl);
345  else
346  {
347  rep()._mp_size = -rep()._mp_size;
348  mpz_div_ui(&rep(), &rep(), ((unsigned long) -sl));
349  }
350  return *this;
351 }
352 
353 // %= ------------------------------------------------------------------
354 template<> inline
356 {
357  mpz_mod(&rep(), &rep(), &rhs.rep()); return *this;
358 }
359 
360 template<> inline
362 {
363  mpz_mod_ui(&rep(), &rep(), ul); return *this;
364 }
365 
366 //======================================================================
367 // ARITHMETIC OPERATORS
368 //======================================================================
369  Scl<MPZ> operator +(const Scl<MPZ>& a1, const Scl<MPZ>& a2)
370  {
371  Scl<MPZ> result;
372  mpz_add(&result.rep(), &a1.rep(), &a2.rep());
373  return result;
374  }
375 
376  //----------------------------------------------------------------------
377  Scl<MPZ> operator -(const Scl<MPZ>& a1, const Scl<MPZ>& a2)
378  {
379  Scl<MPZ> result;
380  mpz_sub(&result.rep(), &a1.rep(), &a2.rep());
381  return result;
382  }
383 
384 //----------------------------------------------------------------------
385  Scl<MPZ> operator *(const Scl<MPZ>& a1, const Scl<MPZ>& a2)
386  {
387  Scl<MPZ> result;
388  mpz_mul(&result.rep(), &a1.rep(), &a2.rep());
389  return result;
390  }
391 
392 //----------------------------------------------------------------------
394 {
395  Scl<MPZ> r;
396  mpz_div(&r.rep(),&a.rep(),&b.rep());
397  return r;
398  }
399 
400 //----------------------------------------------------------------------
402 {
403  Scl<MPZ> r;
404  mpz_mod(&r.rep(),&a.rep(),&b.rep());
405  return r;
406  }
407 //======================================================================
409 template<> inline
411 {
412  mpz_add_ui(&rep(), &rep(), 1);
413 }
414 //----------------------------------------------------------------------
416 template<> inline
418 {
419  mpz_sub_ui(&rep(), &rep(), 1);
420 }
421 //======================================================================
422 inline void convert(Scl<MPZ>& n, char *s)
423 {
424  mpz_init_set_str(&n.rep(), s, 10);
425 }
426 //======================================================================
427 // INPUT OUTPUT
428 //======================================================================
429 std::ostream& operator << (std::ostream& os, const Scl<MPZ>& b)
430 {
431  mpz_out_str(stdout, 10, &b.rep());
432  return os;
433 }
434 //----------------------------------------------------------------------
435 std::istream& operator >> (std::istream& is, Scl<MPZ>& b)
436 {
437  std::string s;is >> s;
438  mpz_init_set_str(&b.rep(),s.c_str(), 10);
439  return is;
440 }
441 //======================================================================
442 // SPECIAL FUNCTIONS
443 //======================================================================
444 template<> inline void
445 Scl<MPZ>::Div2Exp (unsigned long exponent_of_2)
446 {
447  mpz_div_2exp(&rep(), &rep(), exponent_of_2);
448 }
449 
450 template<> inline
451 void Scl<MPZ>::GCD (const Scl<MPZ>& b2)
452 {
453  mpz_gcd (&rep(), &rep(), &b2.rep());
454 }
455 
456 
457 template<> inline void
458 Scl<MPZ>::Mod2Exp (unsigned long exponent_of_2)
459 {
460  mpz_mod_2exp(&rep(), &rep(), exponent_of_2);
461 }
462 
463 template<> inline void
464 Scl<MPZ>::Mul2Exp (unsigned long exponent_of_2)
465 {
466  mpz_mul_2exp(&rep(), &rep(), exponent_of_2);
467 }
468 
469 template<> inline void
470 Scl<MPZ>::PowMod (const Scl<MPZ>& exp, const Scl<MPZ>& m)
471 {
472  mpz_powm(&rep(), &rep(), &exp.rep(), &m.rep());
473 }
474 
475 template<> inline void
476 Scl<MPZ>::PowMod (unsigned long exp, const Scl<MPZ>& m)
477 {
478  mpz_powm_ui(&rep(), &rep(), exp, &m.rep());
479 }
480 
481 template<> inline void
483 {
484  if (rep()._mp_size < 0)
485  rep()._mp_size = - rep()._mp_size;
486 }
487 
488 template<> inline void
489 Scl<MPZ>::factorial (unsigned long n)
490 {
491  mpz_fac_ui(&rep(), n);
492 }
493 
494 template<> inline
496 {
497  rep()._mp_size = - rep()._mp_size; return *this;
498 }
499 
500 template<> inline
502 {
503  mpz_pow_ui(&rep(), &rep(), exp); return *this;
504 }
505 
506 template<> inline
507 Scl<MPZ>& Scl<MPZ>::pow (unsigned long base, unsigned long exp)
508 {
509  mpz_ui_pow_ui(&rep(), base, exp); return *this;
510 }
511 
512 template<> inline void
513 Scl<MPZ>::quo (const Scl<MPZ>& divisor)
514 {
515  mpz_mdiv (&rep(), &rep(), &divisor.rep());
516 }
517 
518 template<> inline void
519 Scl<MPZ>::quo (unsigned long divisor)
520 {
521  mpz_mdiv_ui(&rep(), &rep(), divisor);
522 }
523 
524 template<> inline void
525 Scl<MPZ>::rem (const Scl<MPZ>& divisor)
526 {
527  mpz_mmod(&rep(), &rep(), &divisor.rep());
528 }
529 
530 template<> inline unsigned long
531 Scl<MPZ>::rem (unsigned long divisor)
532 {
533  return mpz_mmod_ui(&rep(), &rep(), divisor);
534 }
535 
536 template<> inline void
538 {
539  mpz_sqrt(&rep(), &rep());
540 }
541 
542 inline void
544 {
545  mpz_sqrtrem(&sqrt.rep(), &rem.rep(), &b.rep());
546 }
547 
548 inline void
549 QuoRem (Scl<MPZ>& q, Scl<MPZ>& r, const Scl<MPZ>& divdend, const Scl<MPZ>& divisor)
550 {
551  mpz_mdivmod(&q.rep(), &r.rep(), &divdend.rep(), &divisor.rep());
552 }
553 
554 inline unsigned long
555 QuoRem (Scl<MPZ>& q, Scl<MPZ>& r, const Scl<MPZ>& divdend, unsigned long divisor)
556 {
557  return mpz_mdivmod_ui(&q.rep(), &r.rep(), &divdend.rep(), divisor);
558 }
559 
560 inline void
561 DivMod (Scl<MPZ>& q, Scl<MPZ>& r, const Scl<MPZ>& divdend, const Scl<MPZ>& divisor)
562 {
563  mpz_divmod(&q.rep(), &r.rep(), &divdend.rep(), &divisor.rep());
564 }
565 
566 inline void
567 DivMod (Scl<MPZ>& q, Scl<MPZ>& r, const Scl<MPZ>& divdend, unsigned long divisor)
568 {
569  mpz_divmod_ui(&q.rep(), &r.rep(), &divdend.rep(), divisor);
570 }
571 
572 inline
574  const Scl<MPZ>& x, const Scl<MPZ>& y)
575 {
576  mpz_gcdext(&gcd.rep(), &a.rep(), &b.rep(), &x.rep(), &y.rep());
577 }
578 
579 inline
581  const Scl<MPZ>& x, const Scl<MPZ>& y)
582 {
583  mpz_gcdext(&gcd.rep(), &a.rep(), 0, &x.rep(), &y.rep());
584 }
585 
586 inline unsigned long BigIntToUL (const Scl<MPZ>& b)
587 {
588  return mpz_get_ui(&b.rep());
589 }
590 //-------------------------- BigIntToSL ---------------------------------
591 inline signed long BigIntToSL (const Scl<MPZ>& b)
592 {
593  return mpz_get_si(&b.rep());
594 }
595 //-------------------------- log(...) -----------------------------------
596 inline size_t log (const Scl<MPZ>& b)
597 {
598  return mpz_size(&b.rep());
599 }
600 
601 inline size_t log (const Scl<MPZ>& b, int base)
602 {
603  assert(base >= 2 && base <= 36);
604  return mpz_sizeinbase(&b.rep(), base);
605 }
606 //-------------------------- sign ---------------------------------------------
607 inline int sign (const Scl<MPZ>& b)
608 {
609  if (b.rep()._mp_size == 0)
610  return 0;
611  else
612  return b.rep()._mp_size > 0 ? 1 : -1;
613 }
614 //-------------------------- compare (...) ------------------------------------
615 inline int compare (const Scl<MPZ>& b1, const Scl<MPZ>& b2)
616 {
617  return mpz_cmp(&b1.rep(), &b2.rep());
618 }
619 
620 inline int compare (const Scl<MPZ>& b, unsigned long ul)
621 {
622  return mpz_cmp_ui(&b.rep(), ul);
623 }
624 
625 inline int compare (const Scl<MPZ>& b, long sl)
626 {
627  return mpz_cmp_si(&b.rep(), sl);
628 }
629 //-------------------------- IsPositive etc. ----------------------------------
630 inline bool IsPositive (const Scl<MPZ>& b) {
631  return b.rep()._mp_size > 0;
632 }
633 
634 inline bool IsNegative (const Scl<MPZ>& b) {
635  return b.rep()._mp_size < 0;
636 }
637 
638 inline bool IsZero (const Scl<MPZ>& b) {
639  return b.rep()._mp_size == 0;
640 }
641 
642 inline bool IsOne(const Scl<MPZ>& b) {
643  return b.rep()._mp_size == 1 && b.rep()._mp_d[0] == 1;
644 }
645 
646 inline bool IsMinusOne (const Scl<MPZ>& b) {
647  return b.rep()._mp_size == -1 && b.rep()._mp_d[0] == 1;
648 }
649 
650 inline bool IsOdd (const Scl<MPZ>& b) {
651  return b.rep()._mp_size != 0 && (b.rep()._mp_d[0] & ((mp_limb_t) 1));
652 }
653 
654 inline bool IsEven (const Scl<MPZ>& b) {
655  return b.rep()._mp_size == 0 || (b.rep()._mp_d[0] ^ ((mp_limb_t) 0));
656 }
657 
658 inline bool IsPerfectSquare (const Scl<MPZ>& b)
659 {
660  return mpz_perfect_square_p(&b.rep());
661 }
662 
663 inline bool IsProbablyPrime (const Scl<MPZ>& b, int reps /* = 25 */)
664 {
665  return mpz_probab_prime_p(&b.rep(), reps);
666 }
667 
669  return (x.rep()._mp_size > 0);
670 }
671 
672 //----------------------------------------------------------------------
673 #endif // //SCL_MPZ_H
void convert(Scl< MPZ > &n, char *s)
Definition: Scl_mpz.hpp:422
void ExtGCD(Scl< MPZ > &gcd, Scl< MPZ > &a, Scl< MPZ > &b, const Scl< MPZ > &x, const Scl< MPZ > &y)
Definition: Scl_mpz.hpp:573
bool IsEven(const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:654
void PowMod(const Scl< T > &exp, const Scl< T > &m)
Scl< MPZ > operator/(const Scl< MPZ > &a, const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:393
Scl< T > & negate()
void SqrtRem(Scl< MPZ > &sqrt, Scl< MPZ > &rem, const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:543
void sqrt()
void Div2Exp(unsigned long exponent_of_2)
Scl< MPZ > operator-(const Scl< MPZ > &a1, const Scl< MPZ > &a2)
Definition: Scl_mpz.hpp:377
unsigned long BigIntToUL(const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:586
bool IsOne(const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:642
bool IsMinusOne(const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:646
Scl< T > operator-=(const Scl< T > &rhs)
MSKaccmodee MSKint32t MSKsoltypee MSKstakeye MSKrealt MSKrealt * sl
Definition: mosek.h:3209
Scl< T > operator+=(const Scl< T > &rhs)
void DivMod(Scl< MPZ > &q, Scl< MPZ > &r, const Scl< MPZ > &divdend, const Scl< MPZ > &divisor)
Definition: Scl_mpz.hpp:561
MP_INT MPZ
Definition: Scl_mpz.hpp:14
MSKcallbackcodee MSKsoltypee MSKprostae MSKsolstae MSKstakeye MSKstakeye MSKstakeye MSKrealt MSKrealt MSKrealt * y
Definition: mosek.h:2689
bool operator>=(const Scl< T > &rhs) const
void operator--()
MSKaccmodee MSKint32t MSKsoltypee MSKstakeye MSKrealt * x
Definition: mosek.h:3209
void Mod2Exp(unsigned long exponent_of_2)
void quo(const Scl< T > &divisor)
Scl< T > operator*=(const Scl< T > &rhs)
std::istream & operator>>(std::istream &is, Scl< MPZ > &b)
Definition: Scl_mpz.hpp:435
bool IsOdd(const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:650
void operator++()
bool operator==(const Scl< T > &rhs) const
void rem(const Scl< T > &divisor)
MSKCONST char * str
Definition: mosek.h:2317
Scl< T > & rem(const Scl< T > &dividend, const Scl< T > &divisor)
Definition: BC.hpp:1096
Scl< MPZ > operator*(const Scl< MPZ > &a1, const Scl< MPZ > &a2)
Definition: Scl_mpz.hpp:385
Scl()
Definition: Scl.hpp:38
bool operator<=(const Scl< T > &rhs) const
Scl< T > & pow(int exp)
Scl< T > operator/=(const Scl< T > &rhs)
bool IsNegative(const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:634
int compare(const Scl< MPZ > &b1, const Scl< MPZ > &b2)
Definition: Scl_mpz.hpp:615
Definition: Scl.hpp:26
void Mul2Exp(unsigned long exponent_of_2)
bool IsProbablyPrime(const Scl< MPZ > &b, int reps)
Definition: Scl_mpz.hpp:663
bool IsPerfectSquare(const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:658
size_t log(const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:596
Scl< T > & sqrt(const Scl< T > &b)
Definition: BC.hpp:1103
Scl< T > operator=(const Scl< T > &rhs)
MSKrescodee r
Definition: mosek.h:2321
Scl< T > operator%=(const Scl< T > &rhs)
bool operator>(const Scl< T > &rhs) const
signed long BigIntToSL(const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:591
bool IsZero(const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:638
MSKstreamtypee MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t a
Definition: mosek.h:3833
int sign(const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:607
void abs()
void QuoRem(Scl< MPZ > &q, Scl< MPZ > &r, const Scl< MPZ > &divdend, const Scl< MPZ > &divisor)
Definition: Scl_mpz.hpp:549
T & rep()
Definition: Scl.hpp:35
bool has_positive_sign(const Scl< MPZ > &x)
Definition: Scl_mpz.hpp:668
Scl< MPZ > operator+(const Scl< MPZ > &a1, const Scl< MPZ > &a2)
Definition: Scl_mpz.hpp:369
~Scl()
Definition: Scl.hpp:49
void GCD(const Scl< T > &b2)
void factorial(unsigned long n)
bool operator!=(const Scl< T > &rhs) const
bool IsPositive(const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:630
bool operator<(const Scl< T > &rhs) const
Scl< T > & gcd(const Scl< T > &b1, const Scl< T > &b2)
Definition: BC.hpp:1026
Scl< MPZ > operator%(const Scl< MPZ > &a, const Scl< MPZ > &b)
Definition: Scl_mpz.hpp:401
void HalfExtGCD(Scl< MPZ > &gcd, Scl< MPZ > &a, const Scl< MPZ > &x, const Scl< MPZ > &y)
Definition: Scl_mpz.hpp:580
Home  |  Download & InstallContributions