My Project
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
Number.h File Reference
#include <boost/intrusive_ptr.hpp>
#include "kernel/mod2.h"
#include "coeffs/numbers.h"
#include "kernel/polys.h"
#include "polys/monomials/ring.h"

Go to the source code of this file.

Data Structures

class  Number
 

Enumerations

enum  poly_variant { POLY_VARIANT_RING , POLY_VARIANT_MODUL }
 

Functions

void intrusive_ptr_add_ref (ring r)
 
void intrusive_ptr_release (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)
 
Number operator/ (const Number &n1, const Number &n2)
 
bool operator== (const Number &n1, const Number &n2)
 
Number operator+ (const Number &n1, int n2)
 
Number operator* (const Number &n1, int n2)
 
Number operator- (const Number &n1, int n2)
 
Number operator/ (const Number &n1, int n2)
 
bool operator== (const Number &n1, int n2)
 
Number operator+ (int n1, const Number &n2)
 
Number operator- (int n1, const Number &n2)
 
Number operator/ (int n1, const Number &n2)
 
Number operator* (int n1, const Number &n2)
 
bool operator== (int n1, const Number &n2)
 

Enumeration Type Documentation

◆ poly_variant

Enumerator
POLY_VARIANT_RING 
POLY_VARIANT_MODUL 

Definition at line 24 of file Number.h.

25{
28};
@ POLY_VARIANT_MODUL
Definition: Number.h:27
@ POLY_VARIANT_RING
Definition: Number.h:26

Function Documentation

◆ intrusive_ptr_add_ref()

void intrusive_ptr_add_ref ( ring  r)
inline

Definition at line 9 of file Number.h.

10{
11 r->ref++;
12 //Print("ref count after add: %d", r->ref);
13}

◆ intrusive_ptr_release()

void intrusive_ptr_release ( ring  r)
inline

Definition at line 14 of file Number.h.

15{
16 if (r->ref<=0) rDelete(r);
17 else
18 {
19 r->ref--;
20 }
21 //Print("ref count after release: %d", r->ref);
22}
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:450

◆ operator*() [1/3]

Number operator* ( const Number n1,
const Number n2 
)
inline

Definition at line 227 of file Number.h.

228{
229 Number erg(n1);
230 erg*=n2;
231 return erg;
232}
Definition: Number.h:34

◆ operator*() [2/3]

Number operator* ( const Number n1,
int  n2 
)
inline

Definition at line 257 of file Number.h.

258{
259 Number erg(n1);
260 erg*=Number(n2,n1.r);
261 return erg;
262}
intrusive_ptr< ip_sring > r
Definition: Number.h:218

◆ operator*() [3/3]

Number operator* ( int  n1,
const Number n2 
)
inline

Definition at line 294 of file Number.h.

295{
296 Number erg(n2);
297 return erg*=Number(n1,n2.r);
298}

◆ operator+() [1/3]

Number operator+ ( const Number n1,
const Number n2 
)
inline

Definition at line 221 of file Number.h.

222{
223 Number erg(n1);
224 erg+=n2;
225 return erg;
226}

◆ operator+() [2/3]

Number operator+ ( const Number n1,
int  n2 
)
inline

Definition at line 251 of file Number.h.

252{
253 Number erg(n1);
254 erg+=Number(n2,n1.r);
255 return erg;
256}

◆ operator+() [3/3]

Number operator+ ( int  n1,
const Number n2 
)
inline

Definition at line 279 of file Number.h.

280{
281 Number erg(n2);
282 return erg+=Number(n1,n2.r);
283}

◆ operator-() [1/3]

Number operator- ( const Number n1,
const Number n2 
)
inline

Definition at line 233 of file Number.h.

234{
235 Number erg(n1);
236 erg-=n2;
237 return erg;
238}

◆ operator-() [2/3]

Number operator- ( const Number n1,
int  n2 
)
inline

Definition at line 263 of file Number.h.

264{
265 Number erg(n1);
266 erg-=Number(n2,n1.r);
267 return erg;
268}

◆ operator-() [3/3]

Number operator- ( int  n1,
const Number n2 
)
inline

Definition at line 284 of file Number.h.

285{
286 Number erg(n1,n2.r);
287 return erg-=n2;
288}

◆ operator/() [1/3]

Number operator/ ( const Number n1,
const Number n2 
)
inline

Definition at line 239 of file Number.h.

240{
241 Number erg(n1);
242 erg/=n2;
243 return erg;
244}

◆ operator/() [2/3]

Number operator/ ( const Number n1,
int  n2 
)
inline

Definition at line 269 of file Number.h.

270{
271 Number erg(n1);
272 erg/=Number(n2,n1.r);
273 return erg;
274}

◆ operator/() [3/3]

Number operator/ ( int  n1,
const Number n2 
)
inline

Definition at line 289 of file Number.h.

290{
291 Number erg(n1,n2.r);
292 return erg/=n2;
293}

◆ operator==() [1/3]

bool operator== ( const Number n1,
const Number n2 
)
inline

Definition at line 245 of file Number.h.

246{
247 if(n1.r!=n2.r)
248 return false;
249 return n_Equal(n1.n,n2.n,n1.r.get()->cf);
250}
number n
Definition: Number.h:217
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.
Definition: coeffs.h:457

◆ operator==() [2/3]

bool operator== ( const Number n1,
int  n2 
)
inline

Definition at line 275 of file Number.h.

276{
277 return n_Equal(n1.n,Number(n2,n1.r).n,n1.r.get()->cf);
278}

◆ operator==() [3/3]

bool operator== ( int  n1,
const Number n2 
)
inline

Definition at line 299 of file Number.h.

300{
301 return n2==Number(n1,n2.r);
302}