 |
My Project
debian-1:4.1.1-p2+ds-4build2
|
Go to the documentation of this file.
81 template<
unsigned int Precision>
128 #ifndef _AMP_NO_TEMPLATE_CONSTRUCTORS
129 template<
unsigned int Precision2>
169 #ifndef _AMP_NO_TEMPLATE_CONSTRUCTORS
170 template<
unsigned int Precision2>
173 if( (
void*)
this==(
void*)(&r) )
244 template<
unsigned int Precision>
251 template<
unsigned int Precision>
256 mpfr_set_ui(getWritePtr(), 0, GMP_RNDN);
259 template<
unsigned int Precision>
264 mpfr_set_si(getWritePtr(), sv, GMP_RNDN);
267 template<
unsigned int Precision>
272 mpfr_set_ui(getWritePtr(),
v, GMP_RNDN);
275 template<
unsigned int Precision>
280 mpfr_set_ld(getWritePtr(),
v, GMP_RNDN);
283 template<
unsigned int Precision>
288 mpfr_strtofr(getWritePtr(),
s,
NULL, 0, GMP_RNDN);
291 template<
unsigned int Precision>
302 template<
unsigned int Precision>
305 if( rval->refCount==1 )
308 mpfr_set(newrval->
value, rval->value, GMP_RNDN);
314 template<
unsigned int Precision>
317 return mpfr_number_p(getReadPtr())!=0;
320 template<
unsigned int Precision>
323 if( !isFiniteNumber() )
325 return mpfr_sgn(getReadPtr())>0;
328 template<
unsigned int Precision>
331 return mpfr_zero_p(getReadPtr())!=0;
334 template<
unsigned int Precision>
337 if( !isFiniteNumber() )
339 return mpfr_sgn(getReadPtr())<0;
342 template<
unsigned int Precision>
345 return getUlpOf(*
this);
348 template<
unsigned int Precision>
351 return mpfr_get_d(getReadPtr(), GMP_RNDN);
354 template<
unsigned int Precision>
360 if( !isFiniteNumber() )
365 ptr = mpfr_get_str(
NULL, &_e, 16, 0, getReadPtr(), GMP_RNDN);
380 ptr = mpfr_get_str(
NULL, &expval, 16, 0, getReadPtr(), GMP_RNDN);
383 if( iexpval!=expval )
385 sprintf(buf_e,
"%ld",
long(iexpval));
399 template<
unsigned int Precision>
407 if( !isFiniteNumber() )
412 ptr = mpfr_get_str(
NULL, &_e, 10, 0, getReadPtr(), GMP_RNDN);
427 ptr = mpfr_get_str(
NULL, &expval, 10, 0, getReadPtr(), GMP_RNDN);
430 if( iexpval!=expval )
432 sprintf(buf_e,
"%ld",
long(iexpval));
445 template<
unsigned int Precision>
448 char *toString_Block=(
char *)
omAlloc(256);
452 if( !isFiniteNumber() )
456 ptr = mpfr_get_str(
NULL, &_e, 10, 0, getReadPtr(), GMP_RNDN);
457 strcpy(toString_Block, ptr);
459 return toString_Block;
471 ptr = mpfr_get_str(
NULL, &expval, 10, 0, getReadPtr(), GMP_RNDN);
474 if( iexpval!=expval )
476 sprintf(buf_e,
"%ld",
long(iexpval));
480 sprintf(toString_Block,
"-0.%sE%s",ptr,buf_e);
483 sprintf(toString_Block,
"0.%sE%s",ptr,buf_e);
485 return toString_Block;
488 template<
unsigned int Precision>
491 if( !
x.isFiniteNumber() )
501 mpfr_get_exp(
x.getReadPtr()),
511 template<
unsigned int Precision>
520 template<
unsigned int Precision>
534 template<
unsigned int Precision>
548 template<
unsigned int Precision>
557 template<
unsigned int Precision>
565 template<
unsigned int Precision>
571 template<
unsigned int Precision>
575 mp_exp_t e1 = mpfr_get_emax();
576 mp_exp_t e2 = -mpfr_get_emin();
577 mp_exp_t e = e1>e2 ? e1 : e2;
582 template<
unsigned int Precision>
586 mp_exp_t e1 = mpfr_get_emax();
587 mp_exp_t e2 = -mpfr_get_emin();
588 mp_exp_t e = e1>e2 ? e1 : e2;
593 template<
unsigned int Precision>
604 template<
unsigned int Precision>
610 template<
unsigned int Precision>
616 template<
unsigned int Precision>
622 template<
unsigned int Precision>
628 template<
unsigned int Precision>
634 template<
unsigned int Precision>
643 template<
unsigned int Precision>
649 template<
unsigned int Precision>
657 template<
unsigned int Precision>
665 template<
unsigned int Precision>
674 template<
unsigned int Precision>
682 template<
unsigned int Precision>
693 template<
unsigned int Precision>
698 mpfr_sqr(
res.getWritePtr(),
x.getReadPtr(), GMP_RNDN);
702 template<
unsigned int Precision>
705 int s = mpfr_sgn(
x.getReadPtr());
713 template<
unsigned int Precision>
718 mpfr_abs(
res.getWritePtr(),
x.getReadPtr(), GMP_RNDN);
722 template<
unsigned int Precision>
727 mpfr_max(
res.getWritePtr(),
x.getReadPtr(),
y.getReadPtr(), GMP_RNDN);
731 template<
unsigned int Precision>
736 mpfr_min(
res.getWritePtr(),
x.getReadPtr(),
y.getReadPtr(), GMP_RNDN);
740 template<
unsigned int Precision>
745 mpfr_sqrt(
res.getWritePtr(),
x.getReadPtr(), GMP_RNDN);
749 template<
unsigned int Precision>
757 mpfr_clear_erangeflag();
759 if( mpfr_erangeflag_p()!=0 )
764 template<
unsigned int Precision>
773 template<
unsigned int Precision>
781 mpfr_clear_erangeflag();
783 if( mpfr_erangeflag_p()!=0 )
788 template<
unsigned int Precision>
796 mpfr_clear_erangeflag();
798 if( mpfr_erangeflag_p()!=0 )
803 template<
unsigned int Precision>
811 mpfr_clear_erangeflag();
813 if( mpfr_erangeflag_p()!=0 )
818 template<
unsigned int Precision>
823 if( !
x.isFiniteNumber() )
837 template<
unsigned int Precision>
849 #define __AMP_BINARY_OPI(type) \
850 template<unsigned int Precision> const ampf<Precision> operator+(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)+op2; } \
851 template<unsigned int Precision> const ampf<Precision> operator+(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)+op2; } \
852 template<unsigned int Precision> const ampf<Precision> operator+(const ampf<Precision>& op1, const signed type& op2) { return op1+ampf<Precision>(op2); } \
853 template<unsigned int Precision> const ampf<Precision> operator+(const ampf<Precision>& op1, const unsigned type& op2) { return op1+ampf<Precision>(op2); } \
854 template<unsigned int Precision> const ampf<Precision> operator-(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)-op2; } \
855 template<unsigned int Precision> const ampf<Precision> operator-(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)-op2; } \
856 template<unsigned int Precision> const ampf<Precision> operator-(const ampf<Precision>& op1, const signed type& op2) { return op1-ampf<Precision>(op2); } \
857 template<unsigned int Precision> const ampf<Precision> operator-(const ampf<Precision>& op1, const unsigned type& op2) { return op1-ampf<Precision>(op2); } \
858 template<unsigned int Precision> const ampf<Precision> operator*(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)*op2; } \
859 template<unsigned int Precision> const ampf<Precision> operator*(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)*op2; } \
860 template<unsigned int Precision> const ampf<Precision> operator*(const ampf<Precision>& op1, const signed type& op2) { return op1*ampf<Precision>(op2); } \
861 template<unsigned int Precision> const ampf<Precision> operator*(const ampf<Precision>& op1, const unsigned type& op2) { return op1*ampf<Precision>(op2); } \
862 template<unsigned int Precision> const ampf<Precision> operator/(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)/op2; } \
863 template<unsigned int Precision> const ampf<Precision> operator/(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)/op2; } \
864 template<unsigned int Precision> const ampf<Precision> operator/(const ampf<Precision>& op1, const signed type& op2) { return op1/ampf<Precision>(op2); } \
865 template<unsigned int Precision> const ampf<Precision> operator/(const ampf<Precision>& op1, const unsigned type& op2) { return op1/ampf<Precision>(op2); } \
866 template<unsigned int Precision> const bool operator==(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)==op2; } \
867 template<unsigned int Precision> const bool operator==(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)==op2; } \
868 template<unsigned int Precision> const bool operator==(const ampf<Precision>& op1, const signed type& op2) { return op1==ampf<Precision>(op2); } \
869 template<unsigned int Precision> const bool operator==(const ampf<Precision>& op1, const unsigned type& op2) { return op1==ampf<Precision>(op2); } \
870 template<unsigned int Precision> const bool operator!=(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)!=op2; } \
871 template<unsigned int Precision> const bool operator!=(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)!=op2; } \
872 template<unsigned int Precision> const bool operator!=(const ampf<Precision>& op1, const signed type& op2) { return op1!=ampf<Precision>(op2); } \
873 template<unsigned int Precision> const bool operator!=(const ampf<Precision>& op1, const unsigned type& op2) { return op1!=ampf<Precision>(op2); } \
874 template<unsigned int Precision> const bool operator<=(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<=op2; } \
875 template<unsigned int Precision> const bool operator<=(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<=op2; } \
876 template<unsigned int Precision> const bool operator<=(const ampf<Precision>& op1, const signed type& op2) { return op1<=ampf<Precision>(op2); } \
877 template<unsigned int Precision> const bool operator<=(const ampf<Precision>& op1, const unsigned type& op2) { return op1<=ampf<Precision>(op2); } \
878 template<unsigned int Precision> const bool operator>=(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>=op2; } \
879 template<unsigned int Precision> const bool operator>=(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>=op2; } \
880 template<unsigned int Precision> const bool operator>=(const ampf<Precision>& op1, const signed type& op2) { return op1>=ampf<Precision>(op2); } \
881 template<unsigned int Precision> const bool operator>=(const ampf<Precision>& op1, const unsigned type& op2) { return op1>=ampf<Precision>(op2); } \
882 template<unsigned int Precision> const bool operator<(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<op2; } \
883 template<unsigned int Precision> const bool operator<(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<op2; } \
884 template<unsigned int Precision> const bool operator<(const ampf<Precision>& op1, const signed type& op2) { return op1<ampf<Precision>(op2); } \
885 template<unsigned int Precision> const bool operator<(const ampf<Precision>& op1, const unsigned type& op2) { return op1<ampf<Precision>(op2); } \
886 template<unsigned int Precision> const bool operator>(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>op2; } \
887 template<unsigned int Precision> const bool operator>(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>op2; } \
888 template<unsigned int Precision> const bool operator>(const ampf<Precision>& op1, const signed type& op2) { return op1>ampf<Precision>(op2); } \
889 template<unsigned int Precision> const bool operator>(const ampf<Precision>& op1, const unsigned type& op2) { return op1>ampf<Precision>(op2); }
894 #undef __AMP_BINARY_OPI
895 #define __AMP_BINARY_OPF(type) \
896 template<unsigned int Precision> const ampf<Precision> operator+(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)+op2; } \
897 template<unsigned int Precision> const ampf<Precision> operator+(const ampf<Precision>& op1, const type& op2) { return op1+ampf<Precision>(op2); } \
898 template<unsigned int Precision> const ampf<Precision> operator-(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)-op2; } \
899 template<unsigned int Precision> const ampf<Precision> operator-(const ampf<Precision>& op1, const type& op2) { return op1-ampf<Precision>(op2); } \
900 template<unsigned int Precision> const ampf<Precision> operator*(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)*op2; } \
901 template<unsigned int Precision> const ampf<Precision> operator*(const ampf<Precision>& op1, const type& op2) { return op1*ampf<Precision>(op2); } \
902 template<unsigned int Precision> const ampf<Precision> operator/(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)/op2; } \
903 template<unsigned int Precision> const ampf<Precision> operator/(const ampf<Precision>& op1, const type& op2) { return op1/ampf<Precision>(op2); } \
904 template<unsigned int Precision> bool operator==(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)==op2; } \
905 template<unsigned int Precision> bool operator==(const ampf<Precision>& op1, const type& op2) { return op1==ampf<Precision>(op2); } \
906 template<unsigned int Precision> bool operator!=(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)!=op2; } \
907 template<unsigned int Precision> bool operator!=(const ampf<Precision>& op1, const type& op2) { return op1!=ampf<Precision>(op2); } \
908 template<unsigned int Precision> bool operator<=(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<=op2; } \
909 template<unsigned int Precision> bool operator<=(const ampf<Precision>& op1, const type& op2) { return op1<=ampf<Precision>(op2); } \
910 template<unsigned int Precision> bool operator>=(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>=op2; } \
911 template<unsigned int Precision> bool operator>=(const ampf<Precision>& op1, const type& op2) { return op1>=ampf<Precision>(op2); } \
912 template<unsigned int Precision> bool operator<(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<op2; } \
913 template<unsigned int Precision> bool operator<(const ampf<Precision>& op1, const type& op2) { return op1<ampf<Precision>(op2); } \
914 template<unsigned int Precision> bool operator>(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>op2; } \
915 template<unsigned int Precision> bool operator>(const ampf<Precision>& op1, const type& op2) { return op1>ampf<Precision>(op2); }
919 #undef __AMP_BINARY_OPF
924 template<
unsigned int Precision>
928 mpfr_const_pi(
v->value, GMP_RNDN);
932 template<
unsigned int Precision>
936 mpfr_const_pi(
v->value, GMP_RNDN);
937 mpfr_mul_2si(
v->value,
v->value, -1, GMP_RNDN);
941 template<
unsigned int Precision>
945 mpfr_const_pi(
v->value, GMP_RNDN);
946 mpfr_mul_2si(
v->value,
v->value, +1, GMP_RNDN);
950 template<
unsigned int Precision>
954 mpfr_sin(
v->value,
x.getReadPtr(), GMP_RNDN);
958 template<
unsigned int Precision>
962 mpfr_cos(
v->value,
x.getReadPtr(), GMP_RNDN);
966 template<
unsigned int Precision>
970 mpfr_tan(
v->value,
x.getReadPtr(), GMP_RNDN);
974 template<
unsigned int Precision>
978 mpfr_asin(
v->value,
x.getReadPtr(), GMP_RNDN);
982 template<
unsigned int Precision>
986 mpfr_acos(
v->value,
x.getReadPtr(), GMP_RNDN);
990 template<
unsigned int Precision>
994 mpfr_atan(
v->value,
x.getReadPtr(), GMP_RNDN);
998 template<
unsigned int Precision>
1002 mpfr_atan2(
v->value,
y.getReadPtr(),
x.getReadPtr(), GMP_RNDN);
1006 template<
unsigned int Precision>
1010 mpfr_log(
v->value,
x.getReadPtr(), GMP_RNDN);
1014 template<
unsigned int Precision>
1018 mpfr_log2(
v->value,
x.getReadPtr(), GMP_RNDN);
1022 template<
unsigned int Precision>
1026 mpfr_log10(
v->value,
x.getReadPtr(), GMP_RNDN);
1030 template<
unsigned int Precision>
1034 mpfr_exp(
v->value,
x.getReadPtr(), GMP_RNDN);
1038 template<
unsigned int Precision>
1042 mpfr_sinh(
v->value,
x.getReadPtr(), GMP_RNDN);
1046 template<
unsigned int Precision>
1050 mpfr_cosh(
v->value,
x.getReadPtr(), GMP_RNDN);
1054 template<
unsigned int Precision>
1058 mpfr_tanh(
v->value,
x.getReadPtr(), GMP_RNDN);
1062 template<
unsigned int Precision>
1066 mpfr_pow(
v->value,
x.getReadPtr(),
y.getReadPtr(), GMP_RNDN);
1073 template<
unsigned int Precision>
1092 #ifndef _AMP_NO_TEMPLATE_CONSTRUCTORS
1093 template<
unsigned int Prec2>
1116 #ifndef _AMP_NO_TEMPLATE_CONSTRUCTORS
1117 template<
unsigned int Precision2>
1132 template<
unsigned int Precision>
1134 {
return lhs.
x==rhs.
x && lhs.
y==rhs.
y; }
1136 template<
unsigned int Precision>
1138 {
return lhs.
x!=rhs.
x || lhs.
y!=rhs.
y; }
1140 template<
unsigned int Precision>
1144 template<
unsigned int Precision>
1146 { lhs.
x += rhs.
x; lhs.
y += rhs.
y;
return lhs; }
1148 template<
unsigned int Precision>
1152 template<
unsigned int Precision>
1156 template<
unsigned int Precision>
1158 { lhs.
x -= rhs.
x; lhs.
y -= rhs.
y;
return lhs; }
1160 template<
unsigned int Precision>
1164 template<
unsigned int Precision>
1173 template<
unsigned int Precision>
1177 template<
unsigned int Precision>
1200 template<
unsigned int Precision>
1207 template<
unsigned int Precision>
1214 w = xabs>yabs ? xabs : yabs;
1215 v = xabs<yabs ? xabs : yabs;
1225 template<
unsigned int Precision>
1231 template<
unsigned int Precision>
1241 #define __AMP_BINARY_OPI(type) \
1242 template<unsigned int Precision> const campf<Precision> operator+ (const signed type& op1, const campf<Precision>& op2) { return campf<Precision>(op1+op2.x, op2.y); } \
1243 template<unsigned int Precision> const campf<Precision> operator+ (const unsigned type& op1, const campf<Precision>& op2) { return campf<Precision>(op1+op2.x, op2.y); } \
1244 template<unsigned int Precision> const campf<Precision> operator+ (const campf<Precision>& op1, const signed type& op2) { return campf<Precision>(op1.x+op2, op1.y); } \
1245 template<unsigned int Precision> const campf<Precision> operator+ (const campf<Precision>& op1, const unsigned type& op2) { return campf<Precision>(op1.x+op2, op1.y); } \
1246 template<unsigned int Precision> const campf<Precision> operator- (const signed type& op1, const campf<Precision>& op2) { return campf<Precision>(op1-op2.x, -op2.y); } \
1247 template<unsigned int Precision> const campf<Precision> operator- (const unsigned type& op1, const campf<Precision>& op2) { return campf<Precision>(op1-op2.x, -op2.y); } \
1248 template<unsigned int Precision> const campf<Precision> operator- (const campf<Precision>& op1, const signed type& op2) { return campf<Precision>(op1.x-op2, op1.y); } \
1249 template<unsigned int Precision> const campf<Precision> operator- (const campf<Precision>& op1, const unsigned type& op2) { return campf<Precision>(op1.x-op2, op1.y); } \
1250 template<unsigned int Precision> const campf<Precision> operator* (const signed type& op1, const campf<Precision>& op2) { return campf<Precision>(op1*op2.x, op1*op2.y); } \
1251 template<unsigned int Precision> const campf<Precision> operator* (const unsigned type& op1, const campf<Precision>& op2) { return campf<Precision>(op1*op2.x, op1*op2.y); } \
1252 template<unsigned int Precision> const campf<Precision> operator* (const campf<Precision>& op1, const signed type& op2) { return campf<Precision>(op2*op1.x, op2*op1.y); } \
1253 template<unsigned int Precision> const campf<Precision> operator* (const campf<Precision>& op1, const unsigned type& op2) { return campf<Precision>(op2*op1.x, op2*op1.y); } \
1254 template<unsigned int Precision> const campf<Precision> operator/ (const signed type& op1, const campf<Precision>& op2) { return campf<Precision>(ampf<Precision>(op1),ampf<Precision>(0))/op2; } \
1255 template<unsigned int Precision> const campf<Precision> operator/ (const unsigned type& op1, const campf<Precision>& op2) { return campf<Precision>(ampf<Precision>(op1),ampf<Precision>(0))/op2; } \
1256 template<unsigned int Precision> const campf<Precision> operator/ (const campf<Precision>& op1, const signed type& op2) { return campf<Precision>(op1.x/op2, op1.y/op2); } \
1257 template<unsigned int Precision> const campf<Precision> operator/ (const campf<Precision>& op1, const unsigned type& op2) { return campf<Precision>(op1.x/op2, op1.y/op2); } \
1258 template<unsigned int Precision> bool operator==(const signed type& op1, const campf<Precision>& op2) { return op1==op2.x && op2.y==0; } \
1259 template<unsigned int Precision> bool operator==(const unsigned type& op1, const campf<Precision>& op2) { return op1==op2.x && op2.y==0; } \
1260 template<unsigned int Precision> bool operator==(const campf<Precision>& op1, const signed type& op2) { return op1.x==op2 && op1.y==0; } \
1261 template<unsigned int Precision> bool operator==(const campf<Precision>& op1, const unsigned type& op2) { return op1.x==op2 && op1.y==0; } \
1262 template<unsigned int Precision> bool operator!=(const campf<Precision>& op1, const signed type& op2) { return op1.x!=op2 || op1.y!=0; } \
1263 template<unsigned int Precision> bool operator!=(const campf<Precision>& op1, const unsigned type& op2) { return op1.x!=op2 || op1.y!=0; } \
1264 template<unsigned int Precision> bool operator!=(const signed type& op1, const campf<Precision>& op2) { return op1!=op2.x || op2.y!=0; } \
1265 template<unsigned int Precision> bool operator!=(const unsigned type& op1, const campf<Precision>& op2) { return op1!=op2.x || op2.y!=0; }
1270 #undef __AMP_BINARY_OPI
1271 #define __AMP_BINARY_OPF(type) \
1272 template<unsigned int Precision> const campf<Precision> operator+ (const type& op1, const campf<Precision>& op2) { return campf<Precision>(op1+op2.x, op2.y); } \
1273 template<unsigned int Precision> const campf<Precision> operator+ (const campf<Precision>& op1, const type& op2) { return campf<Precision>(op1.x+op2, op1.y); } \
1274 template<unsigned int Precision> const campf<Precision> operator- (const type& op1, const campf<Precision>& op2) { return campf<Precision>(op1-op2.x, -op2.y); } \
1275 template<unsigned int Precision> const campf<Precision> operator- (const campf<Precision>& op1, const type& op2) { return campf<Precision>(op1.x-op2, op1.y); } \
1276 template<unsigned int Precision> const campf<Precision> operator* (const type& op1, const campf<Precision>& op2) { return campf<Precision>(op1*op2.x, op1*op2.y); } \
1277 template<unsigned int Precision> const campf<Precision> operator* (const campf<Precision>& op1, const type& op2) { return campf<Precision>(op2*op1.x, op2*op1.y); } \
1278 template<unsigned int Precision> const campf<Precision> operator/ (const type& op1, const campf<Precision>& op2) { return campf<Precision>(ampf<Precision>(op1),ampf<Precision>(0))/op2; } \
1279 template<unsigned int Precision> const campf<Precision> operator/ (const campf<Precision>& op1, const type& op2) { return campf<Precision>(op1.x/op2, op1.y/op2); } \
1280 template<unsigned int Precision> bool operator==(const type& op1, const campf<Precision>& op2) { return op1==op2.x && op2.y==0; } \
1281 template<unsigned int Precision> bool operator==(const campf<Precision>& op1, const type& op2) { return op1.x==op2 && op1.y==0; } \
1282 template<unsigned int Precision> bool operator!=(const type& op1, const campf<Precision>& op2) { return op1!=op2.x || op2.y!=0; } \
1283 template<unsigned int Precision> bool operator!=(const campf<Precision>& op1, const type& op2) { return op1.x!=op2 || op1.y!=0; }
1288 #undef __AMP_BINARY_OPF
1293 template<
unsigned int Precision>
1297 int i, cnt = v1.GetLength();
1298 const ampf<Precision> *p1 = v1.GetData();
1299 const ampf<Precision> *p2 = v2.GetData();
1300 mpfr_record *r =
NULL;
1301 mpfr_record *t =
NULL;
1306 mpfr_set_ui(r->value, 0, GMP_RNDN);
1307 for(
i=0;
i<cnt;
i++)
1309 mpfr_mul(t->value, p1->getReadPtr(), p2->getReadPtr(), GMP_RNDN);
1310 mpfr_add(r->value, r->value, t->value, GMP_RNDN);
1327 template<
unsigned int Precision>
1331 int i, cnt = vDst.GetLength();
1336 for(
i=0;
i<cnt;
i++)
1339 pDst += vDst.GetStep();
1340 pSrc += vSrc.GetStep();
1344 template<
unsigned int Precision>
1348 int i, cnt = vDst.GetLength();
1351 for(
i=0;
i<cnt;
i++)
1355 mpfr_neg(
v,
v, GMP_RNDN);
1356 pDst += vDst.GetStep();
1357 pSrc += vSrc.GetStep();
1361 template<
unsigned int Precision,
class T2>
1365 int i, cnt = vDst.GetLength();
1369 for(
i=0;
i<cnt;
i++)
1374 pDst += vDst.GetStep();
1375 pSrc += vSrc.GetStep();
1379 template<
unsigned int Precision>
1383 int i, cnt = vDst.GetLength();
1386 for(
i=0;
i<cnt;
i++)
1390 mpfr_add(
v,
v, vs, GMP_RNDN);
1391 pDst += vDst.GetStep();
1392 pSrc += vSrc.GetStep();
1396 template<
unsigned int Precision,
class T2>
1400 int i, cnt = vDst.GetLength();
1404 for(
i=0;
i<cnt;
i++)
1408 mpfr_mul(tmp.
getWritePtr(), a.getReadPtr(), vs, GMP_RNDN);
1410 pDst += vDst.GetStep();
1411 pSrc += vSrc.GetStep();
1415 template<
unsigned int Precision>
1419 int i, cnt = vDst.GetLength();
1422 for(
i=0;
i<cnt;
i++)
1426 mpfr_sub(
v,
v, vs, GMP_RNDN);
1427 pDst += vDst.GetStep();
1428 pSrc += vSrc.GetStep();
1432 template<
unsigned int Precision,
class T2>
1438 template<
unsigned int Precision,
class T2>
1441 int i, cnt = vDst.GetLength();
1444 for(
i=0;
i<cnt;
i++)
1448 pDst += vDst.GetStep();
const ampf< Precision > cosh(const ampf< Precision > &x)
campf(const campf< Prec2 > &z)
int exponent(const CanonicalForm &f, int q)
int exponent ( const CanonicalForm & f, int q )
void InitializeAsDouble(long double v)
campf< Precision > & operator*=(campf< Precision > &lhs, const campf< Precision > &rhs)
std::string toHex() const
const ampf< Precision > operator+(const ampf< Precision > &op1)
void vMove(ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc)
const int sign(const ampf< Precision > &x)
static const ampf getAlgoPascalEpsilon()
void vMul(ap::raw_vector< ampf< Precision > > vDst, T2 alpha)
const ampf< Precision > abscomplex(const campf< Precision > &z)
const CanonicalForm int const CFList const Variable & y
const signed long trunc(const ampf< Precision > &x)
const ampf< Precision > frac(const ampf< Precision > &x)
void initialize(int Precision)
const ampf< Precision > abs(const ampf< Precision > &x)
const ampf< Precision > exp(const ampf< Precision > &x)
const ampf< Precision > sqrt(const ampf< Precision > &x)
const ampf< Precision > sinh(const ampf< Precision > &x)
ampf & operator/=(const T &v)
static const ampf getRandom()
const ampf< Precision > operator-(const ampf< Precision > &op1)
campf & operator=(long double v)
const ampf< Precision > tanh(const ampf< Precision > &x)
void vMoveNeg(ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc)
const ampf< Precision > atan(const ampf< Precision > &x)
mpfr_srcptr getReadPtr() const
const ampf< Precision > tan(const ampf< Precision > &x)
const signed long floor(const ampf< Precision > &x)
const campf< Precision > conj(const campf< Precision > &z)
bool isFiniteNumber() const
static gmp_randstate_t * getRandState()
campf< Precision > & operator/=(campf< Precision > &lhs, const campf< Precision > &rhs)
ampf & operator*=(const T &v)
ampf & operator+=(const T &v)
ampf & operator=(long double v)
static const ampf getUlp()
const bool operator==(const ampf< Precision > &op1, const ampf< Precision > &op2)
const ampf< Precision > log2(const ampf< Precision > &x)
static const ampf getAlgoPascalMaxNumber()
std::string toDec() const
campf(const ampf< Precision > &_x)
const signed long ceil(const ampf< Precision > &x)
const bool operator!=(const ampf< Precision > &op1, const ampf< Precision > &op2)
void vAdd(ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc)
const ampf< Precision > acos(const ampf< Precision > &x)
const ampf< Precision > pow(const ampf< Precision > &x, const ampf< Precision > &y)
const ampf< Precision > log(const ampf< Precision > &x)
const ampf< Precision > halfpi()
campf(const ampf< Precision > &_x, const ampf< Precision > &_y)
static const ampf getMinNumber()
const ampf< Precision > ldexp2(const ampf< Precision > &x, mp_exp_t exponent)
const ampf< Precision > sqr(const ampf< Precision > &x)
const ampf< Precision > operator/(const ampf< Precision > &op1, const ampf< Precision > &op2)
const bool operator<(const ampf< Precision > &op1, const ampf< Precision > &op2)
const ampf< Precision > sin(const ampf< Precision > &x)
mpfr_record * mpfr_record_ptr
ampf(const ampf< Precision2 > &r)
const ampf< Precision > twopi()
mpfr_reference & operator=(const mpfr_reference &r)
campf< Precision > & operator+=(campf< Precision > &lhs, const campf< Precision > &rhs)
static void make_assertion(bool bClause)
bool isNegativeNumber() const
const ampf< Precision > minimum(const ampf< Precision > &x, const ampf< Precision > &y)
void InitializeAsString(const char *s)
bool isPositiveNumber() const
void InitializeAsSLong(signed long v)
const ampf< Precision > atan2(const ampf< Precision > &y, const ampf< Precision > &x)
ampf(const std::string &s)
__AMP_BINARY_OPI(char) __AMP_BINARY_OPI(short) __AMP_BINARY_OPI(long) __AMP_BINARY_OPI(int) __AMP_BINARY_OPF(float) __AMP_BINARY_OPF(double) __AMP_BINARY_OPF(long double) template< unsigned int Precision > const ampf< Precision > pi()
ampf & operator-=(const T &v)
const ampf< Precision > maximum(const ampf< Precision > &x, const ampf< Precision > &y)
static const ampf getMaxNumber()
const bool operator<=(const ampf< Precision > &op1, const ampf< Precision > &op2)
const ampf< Precision > frexp2(const ampf< Precision > &x, mp_exp_t *exponent)
const ampf< Precision > log10(const ampf< Precision > &x)
const bool operator>=(const ampf< Precision > &op1, const ampf< Precision > &op2)
const ampf< Precision > asin(const ampf< Precision > &x)
void vSub(ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc)
static const ampf getUlp512()
const Variable & v
< [in] a sqrfree bivariate poly
static mpfr_record * newMpfr(unsigned int Precision)
#define __AMP_BINARY_OPF(type)
campf< Precision > & operator-=(campf< Precision > &lhs, const campf< Precision > &rhs)
const CanonicalForm int s
mpfr_srcptr getReadPtr() const
static const ampf getUlp256()
static void deleteMpfr(mpfr_record *ref)
const ampf< Precision > cos(const ampf< Precision > &x)
const ampf< Precision > operator*(const ampf< Precision > &op1, const ampf< Precision > &op2)
static const ampf getAlgoPascalMinNumber()
void InitializeAsULong(unsigned long v)
static mpfr_record_ptr & getList(unsigned int Precision)
const bool operator>(const ampf< Precision > &op1, const ampf< Precision > &op2)
const signed long round(const ampf< Precision > &x)
const campf< Precision > csqr(const campf< Precision > &z)