Loading...
Searching...
No Matches
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

enum poly_variant

Enumerator
POLY_VARIANT_RING |
POLY_VARIANT_MODUL |

Definition at line 24 of file Number.h.

{
POLY_VARIANT_RING,
POLY_VARIANT_MODUL
};
POLY_VARIANT_MODUL
@ POLY_VARIANT_MODUL
Definition Number.h:27
POLY_VARIANT_RING
@ 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.

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

## intrusive_ptr_release()

void intrusive_ptr_release | ( | ring | r | ) |

inline

Definition at line 14 of file Number.h.

{
if (r->ref<=0) rDelete(r);
else
{
r->ref--;
}
//Print("ref count after release: %d", r->ref);
}
rDelete
void rDelete(ring r)
unconditionally deletes fields in r
Definition ring.cc:454

## operator*() [1/3]

Number operator* | ( | const Number & | n1,
|  | const Number & | n2 )

inline

Definition at line 227 of file Number.h.

{
Number erg(n1);
erg*=n2;
return erg;
}
Number
Definition Number.h:34

## operator*() [2/3]

Number operator* | ( | const Number & | n1,
|  | int | n2 )

inline

Definition at line 257 of file Number.h.

{
Number erg(n1);
erg*=Number(n2,n1.r);
return erg;
}
Number::r
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.

{
Number erg(n2);
return erg*=Number(n1,n2.r);
}

## operator+() [1/3]

Number operator+ | ( | const Number & | n1,
|  | const Number & | n2 )

inline

Definition at line 221 of file Number.h.

{
Number erg(n1);
erg+=n2;
return erg;
}

## operator+() [2/3]

Number operator+ | ( | const Number & | n1,
|  | int | n2 )

inline

Definition at line 251 of file Number.h.

{
Number erg(n1);
erg+=Number(n2,n1.r);
return erg;
}

## operator+() [3/3]

Number operator+ | ( | int | n1,
|  | const Number & | n2 )

inline

Definition at line 279 of file Number.h.

{
Number erg(n2);
return erg+=Number(n1,n2.r);
}

## operator-() [1/3]

Number operator- | ( | const Number & | n1,
|  | const Number & | n2 )

inline

Definition at line 233 of file Number.h.

{
Number erg(n1);
erg-=n2;
return erg;
}

## operator-() [2/3]

Number operator- | ( | const Number & | n1,
|  | int | n2 )

inline

Definition at line 263 of file Number.h.

{
Number erg(n1);
erg-=Number(n2,n1.r);
return erg;
}

## operator-() [3/3]

Number operator- | ( | int | n1,
|  | const Number & | n2 )

inline

Definition at line 284 of file Number.h.

{
Number erg(n1,n2.r);
return erg-=n2;
}

## operator/() [1/3]

Number operator/ | ( | const Number & | n1,
|  | const Number & | n2 )

inline

Definition at line 239 of file Number.h.

{
Number erg(n1);
erg/=n2;
return erg;
}

## operator/() [2/3]

Number operator/ | ( | const Number & | n1,
|  | int | n2 )

inline

Definition at line 269 of file Number.h.

{
Number erg(n1);
erg/=Number(n2,n1.r);
return erg;
}

## operator/() [3/3]

Number operator/ | ( | int | n1,
|  | const Number & | n2 )

inline

Definition at line 289 of file Number.h.

{
Number erg(n1,n2.r);
return erg/=n2;
}

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

bool operator== | ( | const Number & | n1,
|  | const Number & | n2 )

inline

Definition at line 245 of file Number.h.

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

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

bool operator== | ( | const Number & | n1,
|  | int | n2 )

inline

Definition at line 275 of file Number.h.

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

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

bool operator== | ( | int | n1,
|  | const Number & | n2 )

inline

Definition at line 299 of file Number.h.

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