Loading...
Searching...
No Matches
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 ()
interval & | setRing (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.

{
lower = n_Init(0, r->cf);
upper = n_Init(0, r->cf);
R = rIncRefCnt(r);
}
n_Init
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:541
rIncRefCnt
static ring rIncRefCnt(ring r)
Definition ring.h:849
interval::lower
number lower
Definition interval.h:8
interval::R
ring R
Definition interval.h:10
interval::upper
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.

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

## interval() [3/4]

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

Definition at line 29 of file interval.cc.

{
lower = a;
upper = b;
R = rIncRefCnt(r);
}
b
CanonicalForm b
Definition cfModGcd.cc:4111

## interval() [4/4]

interval::interval | ( | interval * | I | ) |

Definition at line 36 of file interval.cc.

{
lower = n_Copy(I->lower, I->R->cf);
upper = n_Copy(I->upper, I->R->cf);
R = rIncRefCnt(I->R);
}

## ~interval()

interval::~interval | ( |  | ) |

Definition at line 43 of file interval.cc.

{
n_Delete(&lower, R->cf);
n_Delete(&upper, R->cf);
rDecRefCnt(R);
}
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:461
rDecRefCnt
static void rDecRefCnt(ring r)
Definition ring.h:850

## Member Function Documentation

## setRing()

interval & interval::setRing | ( | ring | r | ) |

Definition at line 50 of file interval.cc.

{
if (R != r)
{
// check if coefficient fields are equal
// if not pass numbers to new cf-field
if (R->cf != r->cf)
{
nMapFunc fun = n_SetMap(R->cf, r->cf);
number lo = fun(lower, R->cf, r->cf),
up = fun(upper, R->cf, r->cf);
n_Delete(&lower, R->cf);
n_Delete(&upper, R->cf);
lower = lo;
upper = up;
}
rDecRefCnt(R);
R = rIncRefCnt(r);
}
return *this;
}
n_SetMap
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:703
nMapFunc
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition coeffs.h:80

## 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:

- Singular/dyn_modules/interval/interval.h
- Singular/dyn_modules/interval/interval.cc