Loading...
Searching...
No Matches
amp Namespace Reference

## Data Structures

class | exception
class | incorrectPrecision
class | overflow
class | divisionByZero
class | sqrtOfNegativeNumber
class | invalidConversion
class | invalidString
class | internalError
class | domainError
struct | mpfr_record
class | mpfr_storage
class | mpfr_reference
class | ampf
class | campf

## Typedefs

typedef unsigned long | unsigned32
typedef signed long | signed32
typedef mpfr_record * | mpfr_record_ptr

## Functions

template<unsigned int Precision>
const bool | operator== (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
const bool | operator!= (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
const bool | operator< (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
const bool | operator> (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
const bool | operator<= (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
const bool | operator>= (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
const ampf< Precision > | operator+ (const ampf< Precision > &op1)
template<unsigned int Precision>
const ampf< Precision > | operator- (const ampf< Precision > &op1)
template<unsigned int Precision>
const ampf< Precision > | operator+ (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
const ampf< Precision > | operator- (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
const ampf< Precision > | operator* (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
const ampf< Precision > | operator/ (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
const ampf< Precision > | sqr (const ampf< Precision > &x)
template<unsigned int Precision>
const int | sign (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | abs (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | maximum (const ampf< Precision > &x, const ampf< Precision > &y)
template<unsigned int Precision>
const ampf< Precision > | minimum (const ampf< Precision > &x, const ampf< Precision > &y)
template<unsigned int Precision>
const ampf< Precision > | sqrt (const ampf< Precision > &x)
template<unsigned int Precision>
const signed long | trunc (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | frac (const ampf< Precision > &x)
template<unsigned int Precision>
const signed long | floor (const ampf< Precision > &x)
template<unsigned int Precision>
const signed long | ceil (const ampf< Precision > &x)
template<unsigned int Precision>
const signed long | round (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | frexp2 (const ampf< Precision > &x, mp_exp_t *exponent)
template<unsigned int Precision>
const ampf< Precision > | ldexp2 (const ampf< Precision > &x, mp_exp_t exponent)
| __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()
template<unsigned int Precision>
const ampf< Precision > | halfpi ()
template<unsigned int Precision>
const ampf< Precision > | twopi ()
template<unsigned int Precision>
const ampf< Precision > | sin (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | cos (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | tan (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | asin (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | acos (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | atan (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | atan2 (const ampf< Precision > &y, const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | log (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | log2 (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | log10 (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | exp (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | sinh (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | cosh (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | tanh (const ampf< Precision > &x)
template<unsigned int Precision>
const ampf< Precision > | pow (const ampf< Precision > &x, const ampf< Precision > &y)
template<unsigned int Precision>
const bool | operator== (const campf< Precision > &lhs, const campf< Precision > &rhs)
template<unsigned int Precision>
const bool | operator!= (const campf< Precision > &lhs, const campf< Precision > &rhs)
template<unsigned int Precision>
const campf< Precision > | operator+ (const campf< Precision > &lhs)
template<unsigned int Precision>
campf< Precision > & | operator+= (campf< Precision > &lhs, const campf< Precision > &rhs)
template<unsigned int Precision>
const campf< Precision > | operator+ (const campf< Precision > &lhs, const campf< Precision > &rhs)
template<unsigned int Precision>
const campf< Precision > | operator- (const campf< Precision > &lhs)
template<unsigned int Precision>
campf< Precision > & | operator-= (campf< Precision > &lhs, const campf< Precision > &rhs)
template<unsigned int Precision>
const campf< Precision > | operator- (const campf< Precision > &lhs, const campf< Precision > &rhs)
template<unsigned int Precision>
campf< Precision > & | operator*= (campf< Precision > &lhs, const campf< Precision > &rhs)
template<unsigned int Precision>
const campf< Precision > | operator* (const campf< Precision > &lhs, const campf< Precision > &rhs)
template<unsigned int Precision>
const campf< Precision > | operator/ (const campf< Precision > &lhs, const campf< Precision > &rhs)
template<unsigned int Precision>
campf< Precision > & | operator/= (campf< Precision > &lhs, const campf< Precision > &rhs)
template<unsigned int Precision>
const ampf< Precision > | abscomplex (const campf< Precision > &z)
template<unsigned int Precision>
const campf< Precision > | conj (const campf< Precision > &z)
template<unsigned int Precision>
const campf< Precision > | csqr (const campf< Precision > &z)
template<unsigned int Precision>
void | vMove (ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc)
template<unsigned int Precision>
void | vMoveNeg (ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc)
template<unsigned int Precision, class T2>
void | vMove (ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc, T2 alpha)
template<unsigned int Precision>
void | vAdd (ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc)
template<unsigned int Precision, class T2>
void | vAdd (ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc, T2 alpha)
template<unsigned int Precision>
void | vSub (ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc)
template<unsigned int Precision, class T2>
void | vSub (ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc, T2 alpha)
template<unsigned int Precision, class T2>
void | vMul (ap::raw_vector< ampf< Precision > > vDst, T2 alpha)
template<unsigned int Precision>
bool | operator== (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
bool | operator!= (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
bool | operator< (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
bool | operator> (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
bool | operator<= (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
bool | operator>= (const ampf< Precision > &op1, const ampf< Precision > &op2)
template<unsigned int Precision>
int | sign (const ampf< Precision > &x)
template<unsigned int Precision>
signed long | trunc (const ampf< Precision > &x)
template<unsigned int Precision>
signed long | floor (const ampf< Precision > &x)
template<unsigned int Precision>
signed long | ceil (const ampf< Precision > &x)
template<unsigned int Precision>
signed long | round (const ampf< Precision > &x)
template<unsigned int Precision>
bool | operator== (const campf< Precision > &lhs, const campf< Precision > &rhs)
template<unsigned int Precision>
bool | operator!= (const campf< Precision > &lhs, const campf< Precision > &rhs)

## Data Structure Documentation

## amp::mpfr_record

struct amp::mpfr_record

Definition at line 33 of file amp.h.

Data Fields
mpfr_record * | next |
unsigned int | Precision |
unsigned int | refCount |
mpfr_t | value |

## Typedef Documentation

## mpfr_record_ptr

typedef mpfr_record * amp::mpfr_record_ptr

Definition at line 41 of file amp.h.

## signed32

typedef signed long amp::signed32

Definition at line 31 of file amp.h.

## unsigned32

typedef unsigned long amp::unsigned32

Definition at line 30 of file amp.h.

## Function Documentation

## __AMP_BINARY_OPI()

amp::__AMP_BINARY_OPI | ( | char |  | ) | const

Definition at line 889 of file amp.h.

{ return ampf<Precision>(op1)+op2; } \
template<unsigned int Precision> const ampf<Precision> operator+(const ampf<Precision>& op1, const type& op2) { return op1+ampf<Precision>(op2); } \
template<unsigned int Precision> const ampf<Precision> operator-(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)-op2; } \
template<unsigned int Precision> const ampf<Precision> operator-(const ampf<Precision>& op1, const type& op2) { return op1-ampf<Precision>(op2); } \
template<unsigned int Precision> const ampf<Precision> operator*(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)*op2; } \
template<unsigned int Precision> const ampf<Precision> operator*(const ampf<Precision>& op1, const type& op2) { return op1*ampf<Precision>(op2); } \
template<unsigned int Precision> const ampf<Precision> operator/(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)/op2; } \
template<unsigned int Precision> const ampf<Precision> operator/(const ampf<Precision>& op1, const type& op2) { return op1/ampf<Precision>(op2); } \
template<unsigned int Precision> bool operator==(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)==op2; } \
template<unsigned int Precision> bool operator==(const ampf<Precision>& op1, const type& op2) { return op1==ampf<Precision>(op2); } \
template<unsigned int Precision> bool operator!=(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)!=op2; } \
template<unsigned int Precision> bool operator!=(const ampf<Precision>& op1, const type& op2) { return op1!=ampf<Precision>(op2); } \
template<unsigned int Precision> bool operator<=(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<=op2; } \
template<unsigned int Precision> bool operator<=(const ampf<Precision>& op1, const type& op2) { return op1<=ampf<Precision>(op2); } \
template<unsigned int Precision> bool operator>=(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>=op2; } \
template<unsigned int Precision> bool operator>=(const ampf<Precision>& op1, const type& op2) { return op1>=ampf<Precision>(op2); } \
template<unsigned int Precision> bool operator<(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<op2; } \
template<unsigned int Precision> bool operator<(const ampf<Precision>& op1, const type& op2) { return op1<ampf<Precision>(op2); } \
template<unsigned int Precision> bool operator>(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>op2; } \
template<unsigned int Precision> bool operator>(const ampf<Precision>& op1, const type& op2) { return op1>ampf<Precision>(op2); }
__AMP_BINARY_OPF(float)
__AMP_BINARY_OPF(double)
__AMP_BINARY_OPF(long double)
#undef __AMP_BINARY_OPF
//
// transcendent functions
//
template<unsigned int Precision>
const ampf<Precision> pi()
{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_const_pi(v->value, GMP_RNDN);
return v;
}
__AMP_BINARY_OPF
#define __AMP_BINARY_OPF(type)
amp::ampf
Definition amp.h:82
amp::mpfr_storage::newMpfr
static mpfr_record * newMpfr(unsigned int Precision)
Definition amp.cpp:11
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
pi
#define pi
Definition libparse.cc:1145
amp::operator>
const bool operator>(const ampf< Precision > &op1, const ampf< Precision > &op2)
Definition amp.h:622
amp::operator-
const ampf< Precision > operator-(const ampf< Precision > &op1)
Definition amp.h:649
amp::operator/
const ampf< Precision > operator/(const ampf< Precision > &op1, const ampf< Precision > &op2)
Definition amp.h:682
amp::operator>=
const bool operator>=(const ampf< Precision > &op1, const ampf< Precision > &op2)
Definition amp.h:634
amp::operator<=
const bool operator<=(const ampf< Precision > &op1, const ampf< Precision > &op2)
Definition amp.h:628
amp::operator+
const ampf< Precision > operator+(const ampf< Precision > &op1)
Definition amp.h:643
amp::operator!=
const bool operator!=(const ampf< Precision > &op1, const ampf< Precision > &op2)
Definition amp.h:610
amp::operator<
const bool operator<(const ampf< Precision > &op1, const ampf< Precision > &op2)
Definition amp.h:616
amp::operator*
const ampf< Precision > operator*(const ampf< Precision > &op1, const ampf< Precision > &op2)
Definition amp.h:674
amp::operator==
const bool operator==(const ampf< Precision > &op1, const ampf< Precision > &op2)
Definition amp.h:604
amp::mpfr_record
Definition amp.h:34

## abs()

template<unsigned int Precision>

const ampf< Precision > amp::abs | ( | const ampf< Precision > & | x | ) |

Definition at line 713 of file amp.h.

{
// TODO: optimize temporary for return value
ampf<Precision> res;
mpfr_abs(res.getWritePtr(), x.getReadPtr(), GMP_RNDN);
return res;
}
x
Variable x
Definition cfModGcd.cc:4090
res
CanonicalForm res
Definition facAbsFact.cc:60

## abscomplex()

template<unsigned int Precision>

const ampf< Precision > amp::abscomplex | ( | const campf< Precision > & | z | ) |

Definition at line 1207 of file amp.h.

{
ampf<Precision> w, xabs, yabs, v;
xabs = abs(z.x);
yabs = abs(z.y);
w = xabs>yabs ? xabs : yabs;
v = xabs<yabs ? xabs : yabs;
if( v==0 )
return w;
else
{
ampf<Precision> t = v/w;
return w*sqrt(1+sqr(t));
}
}
amp::campf::y
ampf< Precision > y
Definition amp.h:1125
amp::campf::x
ampf< Precision > x
Definition amp.h:1125
w
const CanonicalForm & w
Definition facAbsFact.cc:51
amp::abs
const ampf< Precision > abs(const ampf< Precision > &x)
Definition amp.h:713
amp::sqrt
const ampf< Precision > sqrt(const ampf< Precision > &x)
Definition amp.h:740
amp::sqr
const ampf< Precision > sqr(const ampf< Precision > &x)
Definition amp.h:693

## acos()

template<unsigned int Precision>

const ampf< Precision > amp::acos | ( | const ampf< Precision > & | x | ) |

Definition at line 982 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_acos(v->value, x.getReadPtr(), GMP_RNDN);
return v;
}

## asin()

template<unsigned int Precision>

const ampf< Precision > amp::asin | ( | const ampf< Precision > & | x | ) |

Definition at line 974 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_asin(v->value, x.getReadPtr(), GMP_RNDN);
return v;
}

## atan()

template<unsigned int Precision>

const ampf< Precision > amp::atan | ( | const ampf< Precision > & | x | ) |

Definition at line 990 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_atan(v->value, x.getReadPtr(), GMP_RNDN);
return v;
}

## atan2()

template<unsigned int Precision>

const ampf< Precision > amp::atan2 | ( | const ampf< Precision > & | y,
|  | const ampf< Precision > & | x )

Definition at line 998 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_atan2(v->value, y.getReadPtr(), x.getReadPtr(), GMP_RNDN);
return v;
}
y
const CanonicalForm int const CFList const Variable & y
Definition facAbsFact.cc:53

## ceil() [1/2]

template<unsigned int Precision>

const signed long amp::ceil | ( | const ampf< Precision > & | x | ) |

Definition at line 788 of file amp.h.

{
ampf<Precision> tmp;
signed long r;
mpfr_ceil(tmp.getWritePtr(), x.getReadPtr());
if( mpfr_integer_p(tmp.getReadPtr())==0 )
throw invalidConversion();
mpfr_clear_erangeflag();
r = mpfr_get_si(tmp.getReadPtr(), GMP_RNDN);
if( mpfr_erangeflag_p()!=0 )
throw invalidConversion();
return r;
}
amp::ampf::getWritePtr
mpfr_ptr getWritePtr()
Definition amp.h:302
amp::ampf::getReadPtr
mpfr_srcptr getReadPtr() const
Definition amp.h:291
amp::invalidConversion
Definition amp.h:25

## ceil() [2/2]

template<unsigned int Precision>

signed long amp::ceil | ( | const ampf< Precision > & | x | ) |

Definition at line 1806 of file svd_si.h.

{
ampf<Precision> tmp;
signed long r;
mpfr_ceil(tmp.getWritePtr(), x.getReadPtr());
if( mpfr_integer_p(tmp.getReadPtr())==0 )
//throw invalidConversion();
WerrorS("internalError");
mpfr_clear_erangeflag();
r = mpfr_get_si(tmp.getReadPtr(), GMP_RNDN);
if( mpfr_erangeflag_p()!=0 )
//throw invalidConversion();
WerrorS("internalError");
return r;
}
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24

## conj()

template<unsigned int Precision>

const campf< Precision > amp::conj | ( | const campf< Precision > & | z | ) |

Definition at line 1225 of file amp.h.

{
return campf<Precision>(z.x, -z.y);
}
amp::campf
Definition amp.h:1074

## cos()

template<unsigned int Precision>

const ampf< Precision > amp::cos | ( | const ampf< Precision > & | x | ) |

Definition at line 958 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_cos(v->value, x.getReadPtr(), GMP_RNDN);
return v;
}

## cosh()

template<unsigned int Precision>

const ampf< Precision > amp::cosh | ( | const ampf< Precision > & | x | ) |

Definition at line 1046 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_cosh(v->value, x.getReadPtr(), GMP_RNDN);
return v;
}

## csqr()

template<unsigned int Precision>

const campf< Precision > amp::csqr | ( | const campf< Precision > & | z | ) |

Definition at line 1231 of file amp.h.

{
ampf<Precision> t = z.x*z.y;
return campf<Precision>(sqr(z.x)-sqr(z.y), t+t);
}

## exp()

template<unsigned int Precision>

const ampf< Precision > amp::exp | ( | const ampf< Precision > & | x | ) |

Definition at line 1030 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_exp(v->value, x.getReadPtr(), GMP_RNDN);
return v;
}

## floor() [1/2]

template<unsigned int Precision>

const signed long amp::floor | ( | const ampf< Precision > & | x | ) |

Definition at line 773 of file amp.h.

{
ampf<Precision> tmp;
signed long r;
mpfr_floor(tmp.getWritePtr(), x.getReadPtr());
if( mpfr_integer_p(tmp.getReadPtr())==0 )
throw invalidConversion();
mpfr_clear_erangeflag();
r = mpfr_get_si(tmp.getReadPtr(), GMP_RNDN);
if( mpfr_erangeflag_p()!=0 )
throw invalidConversion();
return r;
}

## floor() [2/2]

template<unsigned int Precision>

signed long amp::floor | ( | const ampf< Precision > & | x | ) |

Definition at line 1789 of file svd_si.h.

{
ampf<Precision> tmp;
signed long r;
mpfr_floor(tmp.getWritePtr(), x.getReadPtr());
if( mpfr_integer_p(tmp.getReadPtr())==0 )
//throw invalidConversion();
WerrorS("internalError");
mpfr_clear_erangeflag();
r = mpfr_get_si(tmp.getReadPtr(), GMP_RNDN);
if( mpfr_erangeflag_p()!=0 )
//throw invalidConversion();
WerrorS("internalError");
return r;
}

## frac()

template<unsigned int Precision>

const ampf< Precision > amp::frac | ( | const ampf< Precision > & | x | ) |

Definition at line 764 of file amp.h.

{
// TODO: optimize temporary for return value
ampf<Precision> r;
mpfr_frac(r.getWritePtr(), x.getReadPtr(), GMP_RNDN);
return r;
}

## frexp2()

template<unsigned int Precision>

const ampf< Precision > amp::frexp2 | ( | const ampf< Precision > & | x,
|  | mp_exp_t * | exponent )

Definition at line 818 of file amp.h.

{
// TODO: optimize temporary for return value
ampf<Precision> r;
if( !x.isFiniteNumber() )
throw invalidConversion();
if( x.isZero() )
{
*exponent = 0;
r = 0;
return r;
}
r = x;
*exponent = mpfr_get_exp(r.getReadPtr());
mpfr_set_exp(r.getWritePtr(),0);
return r;
}
exponent
#define exponent
Definition interpolation.cc:31

## halfpi()

template<unsigned int Precision>

const ampf< Precision > amp::halfpi | ( |  | ) |

Definition at line 932 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_const_pi(v->value, GMP_RNDN);
mpfr_mul_2si(v->value, v->value, -1, GMP_RNDN);
return v;
}

## ldexp2()

template<unsigned int Precision>

const ampf< Precision > amp::ldexp2 | ( | const ampf< Precision > & | x,
|  | mp_exp_t | exponent )

Definition at line 837 of file amp.h.

{
// TODO: optimize temporary for return value
ampf<Precision> r;
mpfr_mul_2si(r.getWritePtr(), x.getReadPtr(), exponent, GMP_RNDN);
return r;
}

## log()

template<unsigned int Precision>

const ampf< Precision > amp::log | ( | const ampf< Precision > & | x | ) |

Definition at line 1006 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_log(v->value, x.getReadPtr(), GMP_RNDN);
return v;
}

## log10()

template<unsigned int Precision>

const ampf< Precision > amp::log10 | ( | const ampf< Precision > & | x | ) |

Definition at line 1022 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_log10(v->value, x.getReadPtr(), GMP_RNDN);
return v;
}

## log2()

template<unsigned int Precision>

const ampf< Precision > amp::log2 | ( | const ampf< Precision > & | x | ) |

Definition at line 1014 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_log2(v->value, x.getReadPtr(), GMP_RNDN);
return v;
}

## maximum()

template<unsigned int Precision>

const ampf< Precision > amp::maximum | ( | const ampf< Precision > & | x,
|  | const ampf< Precision > & | y )

Definition at line 722 of file amp.h.

{
// TODO: optimize temporary for return value
ampf<Precision> res;
mpfr_max(res.getWritePtr(), x.getReadPtr(), y.getReadPtr(), GMP_RNDN);
return res;
}

## minimum()

template<unsigned int Precision>

const ampf< Precision > amp::minimum | ( | const ampf< Precision > & | x,
|  | const ampf< Precision > & | y )

Definition at line 731 of file amp.h.

{
// TODO: optimize temporary for return value
ampf<Precision> res;
mpfr_min(res.getWritePtr(), x.getReadPtr(), y.getReadPtr(), GMP_RNDN);
return res;
}

## operator!=() [1/4]

template<unsigned int Precision>

const bool amp::operator!= | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 610 of file amp.h.

{
return mpfr_cmp(op1.getReadPtr(), op2.getReadPtr())!=0;
}

## operator!=() [2/4]

template<unsigned int Precision>

bool amp::operator!= | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 1624 of file svd_si.h.

{
return mpfr_cmp(op1.getReadPtr(), op2.getReadPtr())!=0;
}

## operator!=() [3/4]

template<unsigned int Precision>

const bool amp::operator!= | ( | const campf< Precision > & | lhs,
|  | const campf< Precision > & | rhs )

Definition at line 1136 of file amp.h.

{ return lhs.x!=rhs.x || lhs.y!=rhs.y; }

## operator!=() [4/4]

template<unsigned int Precision>

bool amp::operator!= | ( | const campf< Precision > & | lhs,
|  | const campf< Precision > & | rhs )

Definition at line 2159 of file svd_si.h.

{ return lhs.x!=rhs.x || lhs.y!=rhs.y; }

## operator*() [1/2]

template<unsigned int Precision>

const ampf< Precision > amp::operator* | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 674 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_mul(v->value, op1.getReadPtr(), op2.getReadPtr(), GMP_RNDN);
return v;
}

## operator*() [2/2]

template<unsigned int Precision>

const campf< Precision > amp::operator* | ( | const campf< Precision > & | lhs,
|  | const campf< Precision > & | rhs )

Definition at line 1173 of file amp.h.

{ campf<Precision> r = lhs; r *= rhs; return r; }

## operator*=()

template<unsigned int Precision>

campf< Precision > & amp::operator*= | ( | campf< Precision > & | lhs,
|  | const campf< Precision > & | rhs )

Definition at line 1164 of file amp.h.

{
ampf<Precision> xx(lhs.x*rhs.x), yy(lhs.y*rhs.y), mm((lhs.x+lhs.y)*(rhs.x+rhs.y));
lhs.x = xx-yy;
lhs.y = mm-xx-yy;
return lhs;
}

## operator+() [1/4]

template<unsigned int Precision>

const ampf< Precision > amp::operator+ | ( | const ampf< Precision > & | op1 | ) |

Definition at line 643 of file amp.h.

{
return op1;
}

## operator+() [2/4]

template<unsigned int Precision>

const ampf< Precision > amp::operator+ | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 657 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_add(v->value, op1.getReadPtr(), op2.getReadPtr(), GMP_RNDN);
return v;
}

## operator+() [3/4]

template<unsigned int Precision>

const campf< Precision > amp::operator+ | ( | const campf< Precision > & | lhs | ) |

Definition at line 1140 of file amp.h.

{ return lhs; }

## operator+() [4/4]

template<unsigned int Precision>

const campf< Precision > amp::operator+ | ( | const campf< Precision > & | lhs,
|  | const campf< Precision > & | rhs )

Definition at line 1148 of file amp.h.

{ campf<Precision> r = lhs; r += rhs; return r; }

## operator+=()

template<unsigned int Precision>

campf< Precision > & amp::operator+= | ( | campf< Precision > & | lhs,
|  | const campf< Precision > & | rhs )

Definition at line 1144 of file amp.h.

{ lhs.x += rhs.x; lhs.y += rhs.y; return lhs; }

## operator-() [1/4]

template<unsigned int Precision>

const ampf< Precision > amp::operator- | ( | const ampf< Precision > & | op1 | ) |

Definition at line 649 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_neg(v->value, op1.getReadPtr(), GMP_RNDN);
return v;
}

## operator-() [2/4]

template<unsigned int Precision>

const ampf< Precision > amp::operator- | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 665 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_sub(v->value, op1.getReadPtr(), op2.getReadPtr(), GMP_RNDN);
return v;
}

## operator-() [3/4]

template<unsigned int Precision>

const campf< Precision > amp::operator- | ( | const campf< Precision > & | lhs | ) |

Definition at line 1152 of file amp.h.

{ return campf<Precision>(-lhs.x, -lhs.y); }

## operator-() [4/4]

template<unsigned int Precision>

const campf< Precision > amp::operator- | ( | const campf< Precision > & | lhs,
|  | const campf< Precision > & | rhs )

Definition at line 1160 of file amp.h.

{ campf<Precision> r = lhs; r -= rhs; return r; }

## operator-=()

template<unsigned int Precision>

campf< Precision > & amp::operator-= | ( | campf< Precision > & | lhs,
|  | const campf< Precision > & | rhs )

Definition at line 1156 of file amp.h.

{ lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; }

## operator/() [1/2]

template<unsigned int Precision>

const ampf< Precision > amp::operator/ | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 682 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_div(v->value, op1.getReadPtr(), op2.getReadPtr(), GMP_RNDN);
return v;
}

## operator/() [2/2]

template<unsigned int Precision>

const campf< Precision > amp::operator/ | ( | const campf< Precision > & | lhs,
|  | const campf< Precision > & | rhs )

Definition at line 1177 of file amp.h.

{
campf<Precision> result;
ampf<Precision> e;
ampf<Precision> f;
if( abs(rhs.y)<abs(rhs.x) )
{
e = rhs.y/rhs.x;
f = rhs.x+rhs.y*e;
result.x = (lhs.x+lhs.y*e)/f;
result.y = (lhs.y-lhs.x*e)/f;
}
else
{
e = rhs.x/rhs.y;
f = rhs.y+rhs.x*e;
result.x = (lhs.y+lhs.x*e)/f;
result.y = (-lhs.x+lhs.y*e)/f;
}
return result;
}
f
FILE * f
Definition checklibs.c:9
result
return result
Definition facAbsBiFact.cc:76

## operator/=()

template<unsigned int Precision>

campf< Precision > & amp::operator/= | ( | campf< Precision > & | lhs,
|  | const campf< Precision > & | rhs )

Definition at line 1200 of file amp.h.

{
lhs = lhs/rhs;
return lhs;
}

## operator<() [1/2]

template<unsigned int Precision>

const bool amp::operator< | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 616 of file amp.h.

{
return mpfr_cmp(op1.getReadPtr(), op2.getReadPtr())<0;
}

## operator<() [2/2]

template<unsigned int Precision>

bool amp::operator< | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 1630 of file svd_si.h.

{
return mpfr_cmp(op1.getReadPtr(), op2.getReadPtr())<0;
}

## operator<=() [1/2]

template<unsigned int Precision>

const bool amp::operator<= | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 628 of file amp.h.

{
return mpfr_cmp(op1.getReadPtr(), op2.getReadPtr())<=0;
}

## operator<=() [2/2]

template<unsigned int Precision>

bool amp::operator<= | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 1642 of file svd_si.h.

{
return mpfr_cmp(op1.getReadPtr(), op2.getReadPtr())<=0;
}

## operator==() [1/4]

template<unsigned int Precision>

const bool amp::operator== | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 604 of file amp.h.

{
return mpfr_cmp(op1.getReadPtr(), op2.getReadPtr())==0;
}

## operator==() [2/4]

template<unsigned int Precision>

bool amp::operator== | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 1618 of file svd_si.h.

{
return mpfr_cmp(op1.getReadPtr(), op2.getReadPtr())==0;
}

## operator==() [3/4]

template<unsigned int Precision>

const bool amp::operator== | ( | const campf< Precision > & | lhs,
|  | const campf< Precision > & | rhs )

Definition at line 1132 of file amp.h.

{ return lhs.x==rhs.x && lhs.y==rhs.y; }

## operator==() [4/4]

template<unsigned int Precision>

bool amp::operator== | ( | const campf< Precision > & | lhs,
|  | const campf< Precision > & | rhs )

Definition at line 2155 of file svd_si.h.

{ return lhs.x==rhs.x && lhs.y==rhs.y; }

## operator>() [1/2]

template<unsigned int Precision>

const bool amp::operator> | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 622 of file amp.h.

{
return mpfr_cmp(op1.getReadPtr(), op2.getReadPtr())>0;
}

## operator>() [2/2]

template<unsigned int Precision>

bool amp::operator> | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 1636 of file svd_si.h.

{
return mpfr_cmp(op1.getReadPtr(), op2.getReadPtr())>0;
}

## operator>=() [1/2]

template<unsigned int Precision>

const bool amp::operator>= | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 634 of file amp.h.

{
return mpfr_cmp(op1.getReadPtr(), op2.getReadPtr())>=0;
}

## operator>=() [2/2]

template<unsigned int Precision>

bool amp::operator>= | ( | const ampf< Precision > & | op1,
|  | const ampf< Precision > & | op2 )

Definition at line 1648 of file svd_si.h.

{
return mpfr_cmp(op1.getReadPtr(), op2.getReadPtr())>=0;
}

## pow()

template<unsigned int Precision>

const ampf< Precision > amp::pow | ( | const ampf< Precision > & | x,
|  | const ampf< Precision > & | y )

Definition at line 1062 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_pow(v->value, x.getReadPtr(), y.getReadPtr(), GMP_RNDN);
return v;
}

## round() [1/2]

template<unsigned int Precision>

const signed long amp::round | ( | const ampf< Precision > & | x | ) |

Definition at line 803 of file amp.h.

{
ampf<Precision> tmp;
signed long r;
mpfr_round(tmp.getWritePtr(), x.getReadPtr());
if( mpfr_integer_p(tmp.getReadPtr())==0 )
throw invalidConversion();
mpfr_clear_erangeflag();
r = mpfr_get_si(tmp.getReadPtr(), GMP_RNDN);
if( mpfr_erangeflag_p()!=0 )
throw invalidConversion();
return r;
}

## round() [2/2]

template<unsigned int Precision>

signed long amp::round | ( | const ampf< Precision > & | x | ) |

Definition at line 1823 of file svd_si.h.

{
ampf<Precision> tmp;
signed long r;
mpfr_round(tmp.getWritePtr(), x.getReadPtr());
if( mpfr_integer_p(tmp.getReadPtr())==0 )
//throw invalidConversion();
WerrorS("internalError");
mpfr_clear_erangeflag();
r = mpfr_get_si(tmp.getReadPtr(), GMP_RNDN);
if( mpfr_erangeflag_p()!=0 )
//throw invalidConversion();
WerrorS("internalError");
return r;
}

## sign() [1/2]

template<unsigned int Precision>

const int amp::sign | ( | const ampf< Precision > & | x | ) |

Definition at line 702 of file amp.h.

{
int s = mpfr_sgn(x.getReadPtr());
if( s>0 )
return +1;
if( s<0 )
return -1;
return 0;
}
s
const CanonicalForm int s
Definition facAbsFact.cc:51

## sign() [2/2]

template<unsigned int Precision>

int amp::sign | ( | const ampf< Precision > & | x | ) |

Definition at line 1716 of file svd_si.h.

{
int s = mpfr_sgn(x.getReadPtr());
if( s>0 )
return +1;
if( s<0 )
return -1;
return 0;
}

## sin()

template<unsigned int Precision>

const ampf< Precision > amp::sin | ( | const ampf< Precision > & | x | ) |

Definition at line 950 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_sin(v->value, x.getReadPtr(), GMP_RNDN);
return v;
}

## sinh()

template<unsigned int Precision>

const ampf< Precision > amp::sinh | ( | const ampf< Precision > & | x | ) |

Definition at line 1038 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_sinh(v->value, x.getReadPtr(), GMP_RNDN);
return v;
}

## sqr()

template<unsigned int Precision>

const ampf< Precision > amp::sqr | ( | const ampf< Precision > & | x | ) |

Definition at line 693 of file amp.h.

{
// TODO: optimize temporary for return value
ampf<Precision> res;
mpfr_sqr(res.getWritePtr(), x.getReadPtr(), GMP_RNDN);
return res;
}

## sqrt()

template<unsigned int Precision>

const ampf< Precision > amp::sqrt | ( | const ampf< Precision > & | x | ) |

Definition at line 740 of file amp.h.

{
// TODO: optimize temporary for return value
ampf<Precision> res;
mpfr_sqrt(res.getWritePtr(), x.getReadPtr(), GMP_RNDN);
return res;
}

## tan()

template<unsigned int Precision>

const ampf< Precision > amp::tan | ( | const ampf< Precision > & | x | ) |

Definition at line 966 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_tan(v->value, x.getReadPtr(), GMP_RNDN);
return v;
}

## tanh()

template<unsigned int Precision>

const ampf< Precision > amp::tanh | ( | const ampf< Precision > & | x | ) |

Definition at line 1054 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_tanh(v->value, x.getReadPtr(), GMP_RNDN);
return v;
}

## trunc() [1/2]

template<unsigned int Precision>

const signed long amp::trunc | ( | const ampf< Precision > & | x | ) |

Definition at line 749 of file amp.h.

{
ampf<Precision> tmp;
signed long r;
mpfr_trunc(tmp.getWritePtr(), x.getReadPtr());
if( mpfr_integer_p(tmp.getReadPtr())==0 )
throw invalidConversion();
mpfr_clear_erangeflag();
r = mpfr_get_si(tmp.getReadPtr(), GMP_RNDN);
if( mpfr_erangeflag_p()!=0 )
throw invalidConversion();
return r;
}

## trunc() [2/2]

template<unsigned int Precision>

signed long amp::trunc | ( | const ampf< Precision > & | x | ) |

Definition at line 1763 of file svd_si.h.

{
ampf<Precision> tmp;
signed long r;
mpfr_trunc(tmp.getWritePtr(), x.getReadPtr());
if( mpfr_integer_p(tmp.getReadPtr())==0 )
//throw invalidConversion();
WerrorS("internalError");
mpfr_clear_erangeflag();
r = mpfr_get_si(tmp.getReadPtr(), GMP_RNDN);
if( mpfr_erangeflag_p()!=0 )
//throw invalidConversion();
WerrorS("internalError");
return r;
}

## twopi()

template<unsigned int Precision>

const ampf< Precision > amp::twopi | ( |  | ) |

Definition at line 941 of file amp.h.

{
mpfr_record *v = mpfr_storage::newMpfr(Precision);
mpfr_const_pi(v->value, GMP_RNDN);
mpfr_mul_2si(v->value, v->value, +1, GMP_RNDN);
return v;
}

## vAdd() [1/2]

template<unsigned int Precision>

void amp::vAdd | ( | ap::raw_vector< ampf< Precision > > | vDst,
|  | ap::const_raw_vector< ampf< Precision > > | vSrc )

Definition at line 1379 of file amp.h.

{
ap::ap_error::make_assertion(vDst.GetLength()==vSrc.GetLength());
int i, cnt = vDst.GetLength();
ampf<Precision> *pDst = vDst.GetData();
const ampf<Precision> *pSrc = vSrc.GetData();
for(i=0; i<cnt; i++)
{
mpfr_ptr v = pDst->getWritePtr();
mpfr_srcptr vs = pSrc->getReadPtr();
mpfr_add(v, v, vs, GMP_RNDN);
pDst += vDst.GetStep();
pSrc += vSrc.GetStep();
}
}
i
int i
Definition cfEzgcd.cc:132
ap::ap_error::make_assertion
static void make_assertion(bool bClause)
Definition ap.h:49
ap::const_raw_vector::GetStep
int GetStep() const
Definition ap.h:148
ap::const_raw_vector::GetData
const T * GetData() const
Definition ap.h:142
ap::const_raw_vector::GetLength
int GetLength() const
Definition ap.h:145
ap::raw_vector::GetData
T * GetData()
Definition ap.h:172

## vAdd() [2/2]

template<unsigned int Precision, class T2>

void amp::vAdd | ( | ap::raw_vector< ampf< Precision > > | vDst,
|  | ap::const_raw_vector< ampf< Precision > > | vSrc,
|  | T2 | alpha )

Definition at line 1396 of file amp.h.

{
ap::ap_error::make_assertion(vDst.GetLength()==vSrc.GetLength());
int i, cnt = vDst.GetLength();
ampf<Precision> *pDst = vDst.GetData();
const ampf<Precision> *pSrc = vSrc.GetData();
ampf<Precision> a(alpha), tmp;
for(i=0; i<cnt; i++)
{
mpfr_ptr v = pDst->getWritePtr();
mpfr_srcptr vs = pSrc->getReadPtr();
mpfr_mul(tmp.getWritePtr(), a.getReadPtr(), vs, GMP_RNDN);
mpfr_add(v, v, tmp.getWritePtr(), GMP_RNDN);
pDst += vDst.GetStep();
pSrc += vSrc.GetStep();
}
}
alpha
Variable alpha
Definition facAbsBiFact.cc:52

## vMove() [1/2]

template<unsigned int Precision>

void amp::vMove | ( | ap::raw_vector< ampf< Precision > > | vDst,
|  | ap::const_raw_vector< ampf< Precision > > | vSrc )

Definition at line 1327 of file amp.h.

{
ap::ap_error::make_assertion(vDst.GetLength()==vSrc.GetLength());
int i, cnt = vDst.GetLength();
ampf<Precision> *pDst = vDst.GetData();
const ampf<Precision> *pSrc = vSrc.GetData();
if( pDst==pSrc )
return;
for(i=0; i<cnt; i++)
{
*pDst = *pSrc;
pDst += vDst.GetStep();
pSrc += vSrc.GetStep();
}
}

## vMove() [2/2]

template<unsigned int Precision, class T2>

void amp::vMove | ( | ap::raw_vector< ampf< Precision > > | vDst,
|  | ap::const_raw_vector< ampf< Precision > > | vSrc,
|  | T2 | alpha )

Definition at line 1361 of file amp.h.

{
ap::ap_error::make_assertion(vDst.GetLength()==vSrc.GetLength());
int i, cnt = vDst.GetLength();
ampf<Precision> *pDst = vDst.GetData();
const ampf<Precision> *pSrc = vSrc.GetData();
ampf<Precision> a(alpha);
for(i=0; i<cnt; i++)
{
*pDst = *pSrc;
mpfr_ptr v = pDst->getWritePtr();
mpfr_mul(v, v, a.getReadPtr(), GMP_RNDN);
pDst += vDst.GetStep();
pSrc += vSrc.GetStep();
}
}

## vMoveNeg()

template<unsigned int Precision>

void amp::vMoveNeg | ( | ap::raw_vector< ampf< Precision > > | vDst,
|  | ap::const_raw_vector< ampf< Precision > > | vSrc )

Definition at line 1344 of file amp.h.

{
ap::ap_error::make_assertion(vDst.GetLength()==vSrc.GetLength());
int i, cnt = vDst.GetLength();
ampf<Precision> *pDst = vDst.GetData();
const ampf<Precision> *pSrc = vSrc.GetData();
for(i=0; i<cnt; i++)
{
*pDst = *pSrc;
mpfr_ptr v = pDst->getWritePtr();
mpfr_neg(v, v, GMP_RNDN);
pDst += vDst.GetStep();
pSrc += vSrc.GetStep();
}
}

## vMul()

template<unsigned int Precision, class T2>

void amp::vMul | ( | ap::raw_vector< ampf< Precision > > | vDst,
|  | T2 | alpha )

Definition at line 1438 of file amp.h.

{
int i, cnt = vDst.GetLength();
ampf<Precision> *pDst = vDst.GetData();
ampf<Precision> a(alpha);
for(i=0; i<cnt; i++)
{
mpfr_ptr v = pDst->getWritePtr();
mpfr_mul(v, a.getReadPtr(), v, GMP_RNDN);
pDst += vDst.GetStep();
}
}

## vSub() [1/2]

template<unsigned int Precision>

void amp::vSub | ( | ap::raw_vector< ampf< Precision > > | vDst,
|  | ap::const_raw_vector< ampf< Precision > > | vSrc )

Definition at line 1415 of file amp.h.

{
ap::ap_error::make_assertion(vDst.GetLength()==vSrc.GetLength());
int i, cnt = vDst.GetLength();
ampf<Precision> *pDst = vDst.GetData();
const ampf<Precision> *pSrc = vSrc.GetData();
for(i=0; i<cnt; i++)
{
mpfr_ptr v = pDst->getWritePtr();
mpfr_srcptr vs = pSrc->getReadPtr();
mpfr_sub(v, v, vs, GMP_RNDN);
pDst += vDst.GetStep();
pSrc += vSrc.GetStep();
}
}

## vSub() [2/2]

template<unsigned int Precision, class T2>

void amp::vSub | ( | ap::raw_vector< ampf< Precision > > | vDst,
|  | ap::const_raw_vector< ampf< Precision > > | vSrc,
|  | T2 | alpha )

Definition at line 1432 of file amp.h.

{
vAdd(vDst, vSrc, -alpha);
}
amp::vAdd
void vAdd(ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc)
Definition amp.h:1379