Borderbasix

Scl_mpf.hpp
Go to the documentation of this file.
1 /*********************************************************************
2 template<class T> inline
3 Scl<T>& rem (const Scl<T>& dividend, const Scl<T>& divisor) NRVAL(r(dividend))
4 {
5  NRCODE(r.rem(divisor);)
6  NONRCODE(Scl<T> r(dividend); r.rem(divisor); return r;)
7 }
8 * This file is part of the source code of BORDERBASIX software. *
9 * (C) B. Mourrain, GALAAD, INRIA *
10 **********************************************************************
11 History:
12 $Id: Scl_mpf.hpp,v 1.1.1.1 2006/10/06 08:01:40 trebuche Exp $
13 **********************************************************************/
14 #ifndef _SCL_MPF_H_
15 #define _SCL_MPF_H_
16 //----------------------------------------------------------------------
17 #include <iostream>
18 #include <iomanip>
19 #include <string>
20 #include <borderbasix/mdebug.hpp>
21 #include "Scl.hpp"
22 //----------------------------------------------------------------------
23 typedef mpf_t MPF;
24 #define _MPF_
25 unsigned long MPF_PRECISION;
26 //----------------------------------------------------------------------
27 //template<> inline shared_object<MPF>::rep::~rep() {mpf_clear(&obj);}
28 //----------------------------------------------------------------------
29 //----------------------------------------------------------------------
30 template<> inline Scl<MPF>::~Scl (){mpf_clear(rep());}
31 //----------------------------------------------------------------------
32 template<> inline
33 void Scl<MPF>::init ( ) {mpf_init(rep());}
34 //------------------- Scl<T> (...) -------------------------------------
35 template<> inline
37  // cout<<"default construct "<<endl;
38  mpf_init(rep());}
39 //----------------------------------------------------------------------
40 template<> inline
41 Scl<MPF>::operator int () const
42 {
43  return (int) mpf_get_d(rep());
44 }
45 
46 template<> inline
48 {
49  return mpf_get_d(ref.rep());
50 }
51 
52 template<> inline
53 Scl<MPF>::Scl(const Scl<MPF>& rhs)
54 {
55  // COUNT<MPF>('c');
56  //cout<<"const SCl "<<endl;
57  mpf_init_set(data,rhs.rep());
58 }
59 //----------------------------------------------------------------------
60 template<> inline
62 {
63  //COUNT<MPF>('=');
64  if (this != &rhs) {
65  // mpf_init(rep());
66  mpf_set(rep(), rhs.rep());
67  }
68  return *this;
69 }
70 //----------------------------------------------------------------------
71 template<> inline
72 Scl<MPF>::Scl (signed long int sl) {mpf_init_set_si(rep(),sl);}
73 //----------------------------------------------------------------------
74 template<> inline
75 Scl<MPF>::Scl (unsigned long int ul) {mpf_init_set_ui(rep(),ul);}
76 //----------------------------------------------------------------------
77 template<> inline
78 Scl<MPF>::Scl (int si) {
79  // cout<<"init set si "<<endl;
80  mpf_init_set_si(rep(), si);}
81 //----------------------------------------------------------------------
82 template<> inline
83 Scl<MPF>::Scl (const char *string, unsigned int base)
84 {
85  if (mpf_init_set_str(rep(), string, base))
86  std::cerr << "Scl<MPF>: The string " << string
87  << " is not a valid number in base " << base << std::endl;
88 }
89 template<> inline
90 Scl<MPF>::Scl (double d)
91 {
92  //cout<<"je passe dans construct double "<<endl;
93  mpf_init_set_d(rep(),d);
94 }
95 // == ------------------------------------------------------------------
96 template<> inline
97 bool Scl<MPF>::operator == (const Scl<MPF>& rhs) const
98 {
99  return mpf_cmp(rep(), rhs.rep()) == 0;
100 }
101 
102 template<> inline
103 bool Scl<MPF>::operator == (long sl) const {
104  return mpf_cmp_si(rep(), sl) == 0;
105 }
106 
107 template<> inline
108 bool Scl<MPF>::operator == (int si) const {
109  return mpf_cmp_si(rep(), (long) si) == 0;
110 }
111 
112 template<> inline
113 bool Scl<MPF>::operator == (unsigned long ul) const
114 {
115  return mpf_cmp_ui(rep(), ul) == 0;
116 }
117 template<> inline
118 bool Scl<MPF>::operator == (double ul) const
119 {
120  return mpf_cmp_d(rep(), ul) == 0;
121 }
122 
123 // != ------------------------------------------------------------------
124 template<> inline
125 bool Scl<MPF>::operator != (const Scl<MPF>& rhs) const
126 {
127  return mpf_cmp(rep(), rhs.rep()) != 0;
128 }
129 template<> inline
130 bool Scl<MPF>::operator != (double sl) const {
131  return mpf_cmp_d(rep(), sl) != 0;
132 }
133 
134 
135 template<> inline
136 bool Scl<MPF>::operator != (long sl) const {
137  return mpf_cmp_si(rep(), sl) != 0;
138 }
139 
140 template<> inline
141 bool Scl<MPF>::operator != (int si) const {
142  return mpf_cmp_si(rep(), (long) si) != 0;
143 }
144 
145 template<> inline
146 bool Scl<MPF>::operator != (unsigned long ul) const
147 {
148  return mpf_cmp_ui(rep(), ul) != 0;
149 }
150 // > -------------------------------------------------------------------
151 template<> inline
152 bool Scl<MPF>::operator > (const Scl<MPF>& rhs) const
153 {
154  //)<<"RR > RR";
155  return mpf_cmp(rep(), rhs.rep()) > 0;
156 }
157 
158 template<> inline
159 bool Scl<MPF>::operator > (double sl) const {
160  return mpf_cmp_d(rep(), sl) > 0;
161 }
162 
163 template<> inline
164 bool Scl<MPF>::operator > (long sl) const {
165  return mpf_cmp_si(rep(), sl) > 0;
166 }
167 
168 template<> inline
169 bool Scl<MPF>::operator > (int si) const {
170  return mpf_cmp_si(rep(), (long) si) > 0;
171 }
172 
173 template<> inline
174 bool Scl<MPF>::operator > (unsigned long ul) const
175 {
176  return mpf_cmp_ui(rep(), ul) > 0;
177 }
178 
179 
180 // <= --------------------------------------------------------------------
181 template<> inline
182 bool Scl<MPF>::operator >= (const Scl<MPF>& rhs) const
183 {
184  return mpf_cmp(rep(), rhs.rep()) >= 0;
185 }
186 
187 template<> inline
188 bool Scl<MPF>::operator >= (long sl) const {
189  return mpf_cmp_si(rep(), sl) >= 0;
190 }
191 template<> inline
192 bool Scl<MPF>::operator >= (double sl) const {
193  return mpf_cmp_d(rep(), sl) >= 0;
194 }
195 
196 template<> inline
197 bool Scl<MPF>::operator >= (int si) const
198 {
199  return mpf_cmp_si(rep(), (long) si) >= 0;
200 }
201 
202 template<> inline
203 bool Scl<MPF>::operator >= (unsigned long ul) const
204 {
205  return mpf_cmp_ui(rep(), ul) >= 0;
206 }
207 
208 // < -------------------------------------------------------------------
209 template<> inline
210 bool Scl<MPF>::operator < (const Scl<MPF>& rhs) const
211 {
212  return mpf_cmp(rep(), rhs.rep()) < 0;
213 }
214 
215 template<> inline
216 bool Scl<MPF>::operator < (long sl) const {
217  return mpf_cmp_si(rep(), sl) < 0;
218 }
219 template<> inline
220 bool Scl<MPF>::operator < (double sl) const {
221  return mpf_cmp_d(rep(), sl) < 0;
222 }
223 
224 template<> inline
225 bool Scl<MPF>::operator < (int si) const
226 {
227  return mpf_cmp_si(rep(), (long) si) < 0;
228 }
229 
230 
231 template<> inline
232 bool Scl<MPF>::operator < (unsigned long ul) const
233 {
234  return mpf_cmp_ui(rep(), ul) < 0;
235 }
236 
237 // <= ------------------------------------------------------------------
238 
239 template<> inline
240 bool Scl<MPF>::operator <= (const Scl<MPF>& rhs) const
241 {
242  return mpf_cmp(rep(), rhs.rep()) <= 0;
243 }
244 template<> inline
245 bool Scl<MPF>::operator <= (double sl) const {
246  return mpf_cmp_d(rep(), sl) <= 0;
247 }
248 
249 
250 template<> inline
251 bool Scl<MPF>::operator <= (long sl) const {
252  return mpf_cmp_si(rep(), sl) <= 0;
253 }
254 
255 template<> inline
256 bool Scl<MPF>::operator <= (int si) const
257 {
258  return mpf_cmp_si(rep(), (long) si) <= 0;
259 }
260 
261 template<> inline
262 bool Scl<MPF>::operator <= (unsigned long ul) const
263 {
264  return mpf_cmp_ui(rep(), ul) <= 0;
265 }
266 
267 // = -------------------------------------------------------------------
268 template<> inline
270 {
271  mpf_set_ui(rep(), ul); return *this;
272 }
273 
274 template<> inline
276 {
277  mpf_set_d(rep(), ul); return *this;
278 }
279 
280 template<> inline
282 {
283  mpf_set_si(rep(), sl); return *this;
284 }
285 
286 template<> inline
288 {
289  mpf_set_si(rep(), ul); return *this;
290 }
291 // += -------------------------------------------------------------------
292 template<> inline
294 {
295  Scl<MPF> tmp;
296  //mpf_init(tmp.rep());
297  mpf_add(tmp.rep(), rep(), rhs.rep());
298  mpf_swap(tmp.rep(),rep());
299  return *this;
300 
301 }
302 
303 template<> inline
305 {
306  mpf_add_ui(rep(), rep(), ul); return *this;
307 }
308 
309 template<> inline
311 {
312  if (sl >= 0)
313  mpf_add_ui(rep(), rep(), (unsigned long) sl);
314  else
315  mpf_sub_ui(rep(), rep(), ((unsigned long) -sl));
316  return *this;
317 }
318 
319 template<> inline
321 {
322  if (sl >= 0)
323  mpf_add_ui(rep(), rep(), (unsigned long) sl);
324  else
325  mpf_sub_ui(rep(), rep(), ((unsigned long) -sl));
326  return *this;
327 }
328 
329 
330 template<> inline
332 {
333  *this += Scl<MPF>(ul); return *this;
334 }
335 
336 // -= -------------------------------------------------------------------
337 template<> inline
339 {
340  mpf_sub(rep(), rep(), rhs.rep()); return *this;
341 }
342 
343 template<> inline
345 {
346  Scl<MPF> tmp(ul);
347  *this-=tmp; return *this;
348 }
349 template<> inline
351 {
352  mpf_sub_ui(rep(), rep(), ul); return *this;
353 }
354 
355 template<> inline
357 {
358  if (sl >= 0)
359  mpf_sub_ui(rep(), rep(), (unsigned long) sl);
360  else
361  mpf_add_ui(rep(), rep(), (unsigned long) -sl);
362  return *this;
363 }
364 
365 template<> inline
367 {
368  if (sl >= 0)
369  mpf_sub_ui(rep(), rep(), (unsigned long) sl);
370  else
371  mpf_add_ui(rep(), rep(), (unsigned long) -sl);
372  return *this;
373  // *this -= Scl<MPF>(ul); return *this;
374 }
375 // *= -----------------------------------------------------------------
376 template<> inline
378 {
379  mpf_mul(rep(), rep(), rhs.rep()); return *this;
380 }
381 template<> inline
383 {
384  mpf_mul_ui(rep(), rep(), ul); return *this;
385 }
386 template<> inline
388 {
389  if (sl >= 0)
390  mpf_mul_ui(rep(), rep(), (unsigned long) sl);
391  else
392  {
393  mpf_neg(rep(),rep());
394  mpf_mul_ui(rep(), rep(),(unsigned long)(-sl));
395  }
396  return *this;
397 }
398 template<> inline
400 {
401  return *this*=(Scl<MPF>)d;
402 }
403 
404 template<> inline
406 {
407  if (ul >= 0)
408  mpf_mul_ui(rep(), rep(), (unsigned long) ul);
409  else {
410  mpf_mul_ui(rep(), rep(), (unsigned long) (-ul));
411  mpf_neg(rep(), rep());
412  }
413  return *this;
414 }
415 // /= ------------------------------------------------------------------
416 template<>
418 {
419  mpf_div(rep(), rep(), rhs.rep());
420  //mpf_divexact(&rep(), &rep(), &rhs.rep());
421  return *this;
422 }
423 template<> inline
425 {
426  mpf_div_ui(rep(), rep(), ul); return *this;
427 }
428 
429 template<> inline
431 {
432  if (sl >= 0)
433  mpf_div_ui(rep(), rep(), (unsigned long) sl);
434  else
435  {
436  mpf_neg(rep(),rep());
437  mpf_div_ui(rep(), rep(), ((unsigned long) -sl));
438  }
439  return *this;
440 }
441 template<> inline
443 {
444  if (sl >= 0)
445  mpf_div_ui(rep(), rep(), (unsigned long) sl);
446  else
447  {
448  mpf_neg(rep(),rep());
449  mpf_div_ui(rep(), rep(), ((unsigned long) -sl));
450  }
451  return *this;
452 }
453 
454 //======================================================================
455 // ARITHMETIC OPERATORS
456 //======================================================================
457 #if 0
458 Scl<MPF> operator -(const Scl<MPF>& a1)
459 {
460  Scl<MPF> result(a1);
461  result*=(-1);
462  return result;
463 }
464 #endif
465 Scl<MPF> operator +(const Scl<MPF>& a1, const Scl<MPF>& a2)
466 {
467  Scl<MPF> result;
468  mpf_add(result.rep(), a1.rep(), a2.rep());
469  return result;
470 }
471 // //----------------------------------------------------------------------
472 Scl<MPF> operator -(const Scl<MPF>& a1, const Scl<MPF>& a2)
473 {
474  Scl<MPF> result;
475  mpf_sub(result.rep(), a1.rep(), a2.rep());
476  return result;
477 }
478 //----------------------------------------------------------------------
479 Scl<MPF> operator *(const Scl<MPF>& a1, const Scl<MPF>& a2)
480 {
481  Scl<MPF> result;
482  mpf_mul(result.rep(), a1.rep(), a2.rep());
483  return result;
484 }
485 Scl<MPF> operator *(const Scl<MPF>& a1, double a2)
486 {
487  Scl<MPF> result(a1);
488  result*=a2;
489  return result;
490 }
491 
492 //----------------------------------------------------------------------
493 Scl<MPF> operator /(const Scl<MPF>& a1, const Scl<MPF>& a2)
494 {
495  Scl<MPF> result;
496  mpf_div(result.rep(), a1.rep(), a2.rep());
497  return result;
498 }
499 Scl<MPF> operator /(double a2,const Scl<MPF>& a1)
500 {
501  Scl<MPF> result(a2);
502  result/=a1;
503  return result;
504 }
505 Scl<MPF> operator /(const Scl<MPF>& a1, double a2)
506 {
507  Scl<MPF> result=a1;
508  Scl<MPF>tmp(a2);
509  result/=tmp;
510  return result;
511 }
512 Scl<MPF> operator /(int a2,const Scl<MPF>& a1)
513 {
514  Scl<MPF> result(a2);
515  result/=a1;
516  return result;
517 }
518 Scl<MPF> operator /(const Scl<MPF>& a1, int a2)
519 {
520  Scl<MPF> result(a1);
521  Scl<MPF>tmp(a2);
522  result/=tmp;
523  return result;
524 }
525 
526 Scl<MPF> operator /(long int a2,const Scl<MPF>& a1)
527 {
528  Scl<MPF> result(a2);
529  result/=a1;
530  return result;
531 }
532 //Scl<MPF> operator /(const Scl<MPF>& a1, long int a2)
533 //{
534 // Scl<MPF> result(a1);
535 // Scl<MPF>tmp(a2);
536 // result/=tmp;
537 // return result;
538 //}
539 
540 
541 //======================================================================
542 // ASSIGNEMENTS
543 //======================================================================
544 // inline void assign(Scl<MPF> & p,
545 // const OP<'+',Scl<MPF>, Scl<MPF> >& M)
546 // {
547 // mpf_add(p.rep(),M.op1.rep(),M.op2.rep());
548 // }
549 // //----------------------------------------------------------------------
550 // inline
551 // void assign(Scl<MPF> & p,
552 // const OP<'-',Scl<MPF>, Scl<MPF> >& M)
553 // {
554 // mpf_sub(p.rep(),M.op1.rep(),M.op2.rep());
555 // }
556 // //----------------------------------------------------------------------
557 // inline void assign(Scl<MPF> & p,
558 // const OP<'*',Scl<MPF>, Scl<MPF> >& M)
559 // {
560 // mpf_mul(p.rep(),M.op1.rep(),M.op2.rep());
561 // }
562 // //----------------------------------------------------------------------
563 // void assign(Scl<MPF> & p,
564 // const OP<'/',Scl<MPF>,Scl<MPF> >& M)
565 // {
566 // assert(M.op2!=0);
567 // mpf_div(p.rep(),M.op1.rep(),M.op2.rep());
568 //}
569 //======================================================================
571 template<> inline
573 {
574  mpf_add_ui(rep(), rep(), 1);
575 }
576 //----------------------------------------------------------------------
578 template<> inline
580 {
581  mpf_sub_ui(rep(), rep(), 1);
582 }
583 //======================================================================
584 inline void convert(Scl<MPF>& n, char *s)
585 {
586  // printf("%s\n",s);
587  mpf_init_set_str(n.rep(), s, 10);
588  //cout<<"apres convert "<<mpf_get_d(n.rep())<<endl;;
589 }
590 //======================================================================
591 // INPUT OUTPUT
592 //======================================================================
593 std::ostream& operator << (std::ostream& os, const Scl<MPF>& b)
594 {
595  // os<<setprecision(40);
596  unsigned sz= mpf_get_prec(b.rep())+1;
597  char* tmp = new char [sz];
598  int n=os.precision();
599  gmp_sprintf(tmp,"%.*Ff",n,b.rep());
600  os<< tmp;
601  return os;
602 
603  mp_exp_t exponent ;
604  char* str = mpf_get_str(NULL,&exponent, 10, 0, b.rep());
605 
606  if(mpf_cmp_si(b.rep(),0)<0) {
607  os<< "-0."<<(++str);
608  } else {
609  os<< "0."<<str;
610  }
611  if (exponent != 0)
612  os <<"e"<<exponent;
613  //mpf_out_str(stdout, 10,16,b.rep());
614  return os;
615 }
616 //----------------------------------------------------------------------
617 std::istream& operator >> (std::istream& is, Scl<MPF>& b)
618 {
619  std::string s;is >> s;
620  //cout<<"ici string "<<s<<endl;
621  mpf_init_set_str(b.rep(),s.c_str(), 10);
622  //cout<<"valeur de la converstion "<<b<<endl;
623  //mp_exp_t exponent ;
624  //is<< mpf_get_str(NULL,&exponent, 10,0, b.rep());
625  return is;
626 }
627 
628 bool has_positive_sign(const Scl<MPF>& b) {
629  return (b>0);
630 }
631 
632 //======================================================================
633 // SPECIAL FUNCTIONS
634 //======================================================================
638 void mpf_precision(unsigned long l)
639 {
640  mpf_set_default_prec(l);
641 }
642 //----------------------------------------------------------------------
646 void Precision( Scl<MPF>& b, unsigned long l)
647 {
648  mpf_set_prec(b.rep(),l);
649 }
650 //======================================================================
651 template<> inline
652 void Scl<MPF>::Div2Exp (unsigned long exponent_of_2)
653 {
654  mpf_div_2exp(rep(), rep(), exponent_of_2);
655 }
656 
657 template<> inline void
659 {
660  if (mpf_sgn(rep()) < 0)
661  mpf_neg(rep(),rep());
662 }
663 
664 template<> inline
666 {
667  mpf_neg(rep(),rep());
668  //rep()._mp_size = - rep()._mp_size;
669  return *this;
670 }
671 
672 template<> inline
674 {
675  mpf_sqrt(rep(), rep());
676 }
677 
678 //-------------------------- log(...) -----------------------------------
679 #include<mpfr.h>
680 inline Scl<MPF> log (const Scl<MPF>& b)
681 {
682  mpfr_t tmp;
683  Scl<MPF> res;
684  mpfr_set_default_prec(mpf_get_default_prec()+10);
685  mpfr_init(tmp);
686  mpfr_set_f(tmp,b.rep(),GMP_RNDN);
687  mpfr_log(tmp,tmp,GMP_RNDN);
688  mpfr_get_f(res.rep(),tmp,GMP_RNDN);
689  mpfr_clear(tmp);
690  return res;
691 
692  //return mpf_size(b.rep());
693 }
694 //-------------------------- sign ---------------------------------------------
695 inline int sign (const Scl<MPF>& b)
696 {
697  return mpf_sgn(b.rep());
698  // if (b.rep()._mp_size == 0)
699  // return 0;
700  //else
701  // return b.rep()._mp_size > 0 ? 1 : -1;
702 }
703 //--------------------------------------------------------------------------------
704 //#ifdef ONEMORETIME
705 
706 
707 template<> inline
709 
710  mpf_pow_ui(rep(),rep(),exp);
711  return *this;
712 }
713 
714 
715 inline Scl<MPF> pow(const Scl<MPF>& b1, const Scl<MPF>& b2)
716 {
717  //cout<<"puissance "<<b1<<" "<<b2<<endl;
718  mpfr_t tmpb1,tmpb2;
719  Scl<MPF> res;
720  if(1)
721  {
722  // mpfr_set_default_prec(mpf_get_default_prec()+10);
723  mpfr_init(tmpb1);
724  mpfr_init(tmpb2);
725  mpfr_set_f(tmpb1,b1.rep(),MPFR_RNDN);
726  mpfr_set_f(tmpb2,b2.rep(),MPFR_RNDN);
727  mpfr_pow(tmpb1,tmpb1,tmpb2,MPFR_RNDN);
728  mpfr_get_f(res.rep(),tmpb1,MPFR_RNDN);
729  //cout<<"res puissance pos"<<res<<endl;
730  mpfr_clear(tmpb1);
731  mpfr_clear(tmpb2);
732  }
733  else
734  {
735  mpfr_init(tmpb1);
736  mpfr_init(tmpb2);
737  mpfr_set_f(tmpb1,b1.rep(),MPFR_RNDN);
738  mpfr_set_f(tmpb2,b2.rep(),MPFR_RNDN);
739  mpfr_neg(tmpb2,tmpb2,MPFR_RNDN);
740  //mpfr_printf("le tmpb1 : %Rf\n",tmpb1);
741  //mpfr_printf("le tmpb2 : %Rf\n",tmpb2);
742  mpfr_pow(tmpb1,tmpb1,tmpb2,MPFR_RNDN);
743  //mpfr_printf("le temp : %Rf\n",tmpb1);
744  fflush(stdout);
745  mpfr_ui_div(tmpb1,1l,tmpb1,MPFR_RNDN);
746  mpfr_get_f(res.rep(),tmpb1,MPFR_RNDN);
747  //cout<<"res puissance neg "<<res<<endl;
748  mpfr_clear(tmpb1);
749  mpfr_clear(tmpb2);
750 
751  }
752  return res;
753 
754 }
755 
756 //-------------------------- compare (...) ------------------------------------
757 inline int compare (const Scl<MPF>& b1, const Scl<MPF>& b2)
758 {
759  return mpf_cmp(b1.rep(), b2.rep());
760 }
761 
762 inline int compare (const Scl<MPF>& b, unsigned long ul)
763 {
764  return mpf_cmp_ui(b.rep(), ul);
765 }
766 
767 inline int compare (const Scl<MPF>& b, long sl)
768 {
769  return mpf_cmp_si(b.rep(), sl);
770 }
771 
772 bool operator > (double ul, const Scl<MPF> &rhs)
773 {
774  //mdebug()<<"double > RR"<<ul<<rhs;
775  return mpf_cmp_d(rhs.rep(), ul) < 0;
776 }
777 bool operator < (double ul, const Scl<MPF> &rhs)
778 {
779  return mpf_cmp_d(rhs.rep(), ul) > 0;
780 }
781 bool operator < (int ul, const Scl<MPF> &rhs)
782 {
783  return mpf_cmp_si(rhs.rep(), ul) > 0;
784 }
785 bool operator > (int ul, const Scl<MPF> &rhs)
786 {
787  //mdebug()<<"int > RR"<<ul<<rhs<<(mpf_cmp_si(rhs.rep(), ul) < 0);
788  return mpf_cmp_si(rhs.rep(), ul) < 0;
789 }
790 //----------------------------------------------------------------------
791 #endif // //SCL_MPF_H
std::istream & operator>>(std::istream &is, Scl< MPF > &b)
Definition: Scl_mpf.hpp:617
Scl< T > & negate()
void sqrt()
void Div2Exp(unsigned long exponent_of_2)
Scl< MPF > operator*(const Scl< MPF > &a1, const Scl< MPF > &a2)
Definition: Scl_mpf.hpp:479
unsigned long MPF_PRECISION
Definition: Scl_mpf.hpp:25
Scl< T > operator-=(const Scl< T > &rhs)
MSKaccmodee MSKint32t MSKsoltypee MSKstakeye MSKrealt MSKrealt * sl
Definition: mosek.h:3209
Scl< MPF > pow(const Scl< MPF > &b1, const Scl< MPF > &b2)
Definition: Scl_mpf.hpp:715
Scl< T > operator+=(const Scl< T > &rhs)
Scl< MPF > operator-(const Scl< MPF > &a1, const Scl< MPF > &a2)
Definition: Scl_mpf.hpp:472
static double castDouble(Scl< T > &ref)
bool operator>=(const Scl< T > &rhs) const
void operator--()
bool has_positive_sign(const Scl< MPF > &b)
Definition: Scl_mpf.hpp:628
Scl< T > operator*=(const Scl< T > &rhs)
void operator++()
bool operator==(const Scl< T > &rhs) const
MSKCONST char * str
Definition: mosek.h:2317
Scl()
Definition: Scl.hpp:38
bool operator<=(const Scl< T > &rhs) const
bool operator>(double ul, const Scl< MPF > &rhs)
Definition: Scl_mpf.hpp:772
Scl< T > & pow(int exp)
Scl< T > operator/=(const Scl< T > &rhs)
Definition: Scl.hpp:26
void mpf_precision(unsigned long l)
Definition: Scl_mpf.hpp:638
Scl< MPF > operator/(const Scl< MPF > &a1, const Scl< MPF > &a2)
Definition: Scl_mpf.hpp:493
void Precision(Scl< MPF > &b, unsigned long l)
Definition: Scl_mpf.hpp:646
Scl< T > operator=(const Scl< T > &rhs)
int compare(const Scl< MPF > &b1, const Scl< MPF > &b2)
Definition: Scl_mpf.hpp:757
Scl< MPF > operator+(const Scl< MPF > &a1, const Scl< MPF > &a2)
Definition: Scl_mpf.hpp:465
bool operator>(const Scl< T > &rhs) const
mpf_t MPF
Definition: Scl_mpf.hpp:23
int sign(const Scl< MPF > &b)
Definition: Scl_mpf.hpp:695
void abs()
T & rep()
Definition: Scl.hpp:35
~Scl()
Definition: Scl.hpp:49
Scl< MPF > log(const Scl< MPF > &b)
Definition: Scl_mpf.hpp:680
void convert(Scl< MPF > &n, char *s)
Definition: Scl_mpf.hpp:584
bool operator!=(const Scl< T > &rhs) const
bool operator<(const Scl< T > &rhs) const
Home  |  Download & InstallContributions