1#ifndef NUMBERCPP_HEADER
2#define NUMBERCPP_HEADER
3#include <boost/intrusive_ptr.hpp>
29template<poly_variant,
class,
class>
class PolyBase;
57 template <poly_variant,
class,
class>
friend class PolyBase;
66 number nc=
n_Copy(n2.
n,n2.
r.get()->cf);
110 number nv=
n_Sub(
n,n2.
n,
r.get()->cf);
122 number nv=
n_Div(
n,n2.
n,
r.get()->cf);
135 number n2n=
n_Init(n2,
r.get()->cf);
136 number nv=
n_Add(
n,n2n,
r.get()->cf);
144 number n2n=
n_Init(n2,
r.get()->cf);
145 number nv=
n_Mult(
n,n2n,
r.get()->cf);
153 number n2n=
n_Init(n2,
r.get()->cf);
154 number nv=
n_Sub(
n,n2n,
r.get()->cf);
162 number n2n=
n_Init(n2,
r.get()->cf);
163 number nv=
n_Div(
n,n2n,
r.get()->cf);
218 intrusive_ptr<ip_sring>
r;
Number operator-(const Number &n1, const Number &n2)
bool operator==(const Number &n1, const Number &n2)
void intrusive_ptr_add_ref(ring r)
Number operator+(const Number &n1, const Number &n2)
Number operator*(const Number &n1, const Number &n2)
Number operator/(const Number &n1, const Number &n2)
void intrusive_ptr_release(ring r)
Number & operator*=(int n2)
friend Number operator-(const Number &n1, const Number &n2)
Number & operator/=(int n2)
friend bool operator==(const Number &n1, const Number &n2)
friend Number operator+(const Number &n1, const Number &n2)
Number & operator-=(const Number &n2)
friend Number operator*(const Number &n1, const Number &n2)
intrusive_ptr< ip_sring > r
Number & operator=(const Number &n2)
Number & operator+=(int n2)
friend Number operator/(const Number &n1, const Number &n2)
Number & operator+=(const Number &n2)
Number & operator*=(const Number &n2)
Number & operator-=(int n2)
Number & operator=(int n2)
Number(int n, intrusive_ptr< ip_sring > r)
Number & operator/=(const Number &n2)
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of 'a' and 'b', i.e., a-b
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
void WerrorS(const char *s)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility layer for legacy polynomial operations (over currRing)
void rDelete(ring r)
unconditionally deletes fields in r