26 template<
class T>
struct Scl
35 inline T &
rep() {
return (data);}
36 inline const T &
rep()
const {
return (data);}
38 Scl (){this->init();};
40 Scl (
double d){this->init();data=T(d);};
42 Scl (
unsigned long ul);
44 Scl (
const char*
str,
unsigned int b=10);
51 operator int ()
const;
60 bool operator < (const Scl<T>& rhs)
const;
61 bool operator <= (const Scl<T>& rhs)
const;
143 void Div2Exp (
unsigned long exponent_of_2);
145 void Mod2Exp (
unsigned long exponent_of_2);
146 void Mul2Exp (
unsigned long exponent_of_2);
153 Scl<T>&
pow (
unsigned long base,
unsigned long exp);
155 void quo (
unsigned long divisor);
157 unsigned long rem (
unsigned long divisor);
244 unsigned long exponent_of_2);
248 unsigned long exponent_of_2);
259 unsigned long divisor);
263 template<
class T>
unsigned long rem (
const Scl<T>& b,
unsigned long divisor);
272 #if defined(__GNUG__) && !defined(NO_NRV)
273 #define NRVAL(name) return name
274 #define NRCODE(code) code
275 #define NONRCODE(code)
279 #define NONRCODE(code) code
282 #define OPCODE(a, b, op) Scl<T> r(a); return (r op b);
316 template<
class T>
inline
322 template<
class T>
inline
327 template<
class T>
inline
333 template<
class T>
inline
338 template<
class T>
inline
343 template<
class T>
inline
348 template<
class T>
inline
353 template<
class T>
inline
359 template<
class T>
inline Scl<T>
364 template<
class T>
inline Scl<T>
370 template<
class T>
inline Scl<T>
376 template<
class T>
inline Scl<T>
382 template<
class T>
inline Scl<T>
388 template<
class T>
inline Scl<T>
394 template<
class T>
inline Scl<T>
400 template<
class T>
inline
407 template<
class T>
inline
413 template<
class T>
inline
419 template<
class T>
inline
426 template<
class T>
inline
432 template<
class T>
inline
438 template<
class T>
inline
444 template<
class T>
inline
450 template<
class T>
inline Scl<T>&
458 template<
class T>
inline
464 template<
class T>
inline
471 template<
class T>
inline
474 NRCODE(
r.Div2Exp(exponent_of_2);)
478 template<class T>
inline
485 template<class T>
inline
492 template<class T>
inline
495 NRCODE(
r.Mod2Exp(exponent_of_2);)
499 template<class T>
inline
502 NRCODE(
r.Mul2Exp(exponent_of_2);)
506 template<class T>
inline
513 template<class T>
inline
521 template <class T>
inline
535 template<class T>
inline
538 template<
class T>
inline
545 template<class T>
inline
552 template<class T>
inline
559 template<class T>
inline
566 template<class T>
inline
573 template<class T>
inline
574 unsigned long rem (
const Scl<T>& b,
unsigned long divisor)
577 return r.
rem(divisor);
580 template<
class T>
inline
587 template<class T>
inline
600 template<
class T>
inline
603 return sqrt(a*a+b*b);
Scl< T > Mul2Exp(const Scl< T > &b, unsigned long exponent_of_2)
Definition: BC.hpp:1040
Scl< T > operator*(const Scl< T > &b, int ul)
Definition: Scl.hpp:433
Scl< T > quo(const Scl< T > ÷nd, const Scl< T > &divisor)
Definition: BC.hpp:1082
Scl< T > BigIntFactorial(unsigned long n)
Definition: BC.hpp:1117
void PowMod(const Scl< T > &exp, const Scl< T > &m)
#define OPCODE(a, b, op)
Definition: Scl.hpp:282
Scl< T > operator+(const Scl< T > &b, unsigned long ul)
Definition: Scl.hpp:328
#define NRVAL(name)
Definition: Scl.hpp:277
Scl< T > operator-(const Scl< T > &b, unsigned long ul)
Definition: Scl.hpp:354
void pow(unsigned long exp)
Definition: BC.hpp:761
void Div2Exp(unsigned long exponent_of_2)
Scl< T > operator-()
Definition: Scl.hpp:91
Scl< T > operator%(const Scl< T > &b, unsigned long ul)
Definition: Scl.hpp:401
T data
Definition: Scl.hpp:34
Scl< T > operator-=(const Scl< T > &rhs)
MSKaccmodee MSKint32t MSKsoltypee MSKstakeye MSKrealt MSKrealt * sl
Definition: mosek.h:3209
Scl< T > Mod2Exp(const Scl< T > &b, unsigned long exponent_of_2)
Definition: BC.hpp:1033
Scl< T > operator+=(const Scl< T > &rhs)
Scl< T > hypot(const Scl< T > &a, const Scl< T > &b)
Definition: Scl.hpp:601
static double castDouble(Scl< T > &ref)
bool operator>=(const Scl< T > &rhs) const
Scl< T > & BigIntPow(unsigned long base, unsigned long exp) NRVAL(r)
Definition: Scl.hpp:588
void Mod2Exp(unsigned long exponent_of_2)
void quo(const Scl< T > &divisor)
Scl< T > Div2Exp(const Scl< T > &b, unsigned long exponent_of_2)
Definition: BC.hpp:1012
Scl< T > Size(const Scl< T > &r)
Definition: Scl.hpp:595
Scl< T > operator*=(const Scl< T > &rhs)
Scl< T > abs(const Scl< T > &b)
Definition: Scl.hpp:522
bool operator==(const Scl< T > &rhs) const
void rem(const Scl< T > &divisor)
Scl< T > rem(const Scl< T > ÷nd, const Scl< T > &divisor)
Definition: BC.hpp:1096
MSKCONST char * str
Definition: mosek.h:2317
const T & rep() const
Definition: Scl.hpp:36
Scl()
Definition: Scl.hpp:38
bool operator<=(const Scl< T > &rhs) const
Scl< T > operator/=(const Scl< T > &rhs)
Scl< T > pow(const Scl< T > &base, int exp)
Definition: Scl.hpp:539
void Mul2Exp(unsigned long exponent_of_2)
Scl< T > gcd(const Scl< T > &b1, const Scl< T > &b2)
Definition: BC.hpp:1026
Scl< T > GCD(const Scl< T > &b1, const Scl< T > &b2)
Definition: BC.hpp:1019
void rem(const Scl< T > &divisor)
Definition: BC.hpp:785
Scl< T > operator=(const Scl< T > &rhs)
MSKrescodee r
Definition: mosek.h:2321
Scl< T > operator%=(const Scl< T > &rhs)
bool operator>(const Scl< T > &rhs) const
MSKstreamtypee MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t a
Definition: mosek.h:3833
Scl(double d)
Definition: Scl.hpp:40
#define NONRCODE(code)
Definition: Scl.hpp:279
#define NRCODE(code)
Definition: Scl.hpp:278
T & rep()
Definition: Scl.hpp:35
Scl< T > sqrt(const Scl< T > &b)
Definition: Scl.hpp:567
Scl< T > operator/(const Scl< T > &b, unsigned long ul)
Definition: Scl.hpp:383
~Scl()
Definition: Scl.hpp:49
void GCD(const Scl< T > &b2)
void factorial(unsigned long n)
bool operator!=(const Scl< T > &rhs) const
Scl< T > PowMod(const Scl< T > &b, const Scl< T > &exp, const Scl< T > &m)
Definition: BC.hpp:1047
bool operator<(const Scl< T > &rhs) const
void factorial(unsigned long n)
Definition: BC.hpp:749