My Project
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
interval Struct Reference

#include <interval.h>

Public Member Functions

 interval (const ring r=currRing)
 
 interval (number, const ring r=currRing)
 
 interval (number, number, const ring r=currRing)
 
 interval (interval *)
 
 ~interval ()
 
intervalsetRing (ring)
 

Data Fields

number lower
 
number upper
 
ring R
 

Detailed Description

Definition at line 6 of file interval.h.

Constructor & Destructor Documentation

◆ interval() [1/4]

interval::interval ( const ring  r = currRing)

Definition at line 14 of file interval.cc.

15{
16 lower = n_Init(0, r->cf);
17 upper = n_Init(0, r->cf);
18 R = rIncRefCnt(r);
19}
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:535
static ring rIncRefCnt(ring r)
Definition: ring.h:837
number lower
Definition: interval.h:8
ring R
Definition: interval.h:10
number upper
Definition: interval.h:9

◆ interval() [2/4]

interval::interval ( number  a,
const ring  r = currRing 
)

Definition at line 21 of file interval.cc.

22{
23 // dangerous: check if a is in coefs r->cf
24 lower = a;
25 upper = n_Copy(a, r->cf);
26 R = rIncRefCnt(r);
27}
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:448

◆ interval() [3/4]

interval::interval ( number  a,
number  b,
const ring  r = currRing 
)

Definition at line 29 of file interval.cc.

30{
31 lower = a;
32 upper = b;
33 R = rIncRefCnt(r);
34}
CanonicalForm b
Definition: cfModGcd.cc:4103

◆ interval() [4/4]

interval::interval ( interval I)

Definition at line 36 of file interval.cc.

37{
38 lower = n_Copy(I->lower, I->R->cf);
39 upper = n_Copy(I->upper, I->R->cf);
40 R = rIncRefCnt(I->R);
41}

◆ ~interval()

interval::~interval ( )

Definition at line 43 of file interval.cc.

44{
45 n_Delete(&lower, R->cf);
46 n_Delete(&upper, R->cf);
48}
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:452
static void rDecRefCnt(ring r)
Definition: ring.h:838

Member Function Documentation

◆ setRing()

interval & interval::setRing ( ring  r)

Definition at line 50 of file interval.cc.

51{
52 if (R != r)
53 {
54 // check if coefficient fields are equal
55 // if not pass numbers to new cf-field
56 if (R->cf != r->cf)
57 {
58 nMapFunc fun = n_SetMap(R->cf, r->cf);
59 number lo = fun(lower, R->cf, r->cf),
60 up = fun(upper, R->cf, r->cf);
61 n_Delete(&lower, R->cf);
62 n_Delete(&upper, R->cf);
63 lower = lo;
64 upper = up;
65 }
67 R = rIncRefCnt(r);
68 }
69
70 return *this;
71}
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:697
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73

Field Documentation

◆ lower

number interval::lower

Definition at line 8 of file interval.h.

◆ R

ring interval::R

Definition at line 10 of file interval.h.

◆ upper

number interval::upper

Definition at line 9 of file interval.h.


The documentation for this struct was generated from the following files: