 |
My Project
debian-1:4.1.2-p1+ds-2
|
Go to the source code of this file.
|
static void * | interval_Init (blackbox *) |
|
static char * | interval_String (blackbox *, void *d) |
|
static void * | interval_Copy (blackbox *, void *d) |
|
static void | interval_Destroy (blackbox *, void *d) |
|
static BOOLEAN | interval_Assign (leftv result, leftv args) |
|
static BOOLEAN | length (leftv result, leftv arg) |
|
static interval * | intervalScalarMultiply (number a, interval *I) |
|
static interval * | intervalMultiply (interval *I, interval *J) |
|
static interval * | intervalAdd (interval *I, interval *J) |
|
static interval * | intervalSubtract (interval *I, interval *J) |
|
static bool | intervalEqual (interval *I, interval *J) |
|
static bool | intervalContainsZero (interval *I) |
|
static interval * | intervalPower (interval *I, int p) |
|
static BOOLEAN | interval_Op2 (int op, leftv result, leftv i1, leftv i2) |
|
static BOOLEAN | interval_serialize (blackbox *, void *d, si_link f) |
|
static BOOLEAN | interval_deserialize (blackbox **, void **d, si_link f) |
|
static void * | box_Init (blackbox *) |
|
static void * | box_Copy (blackbox *, void *d) |
|
static void | box_Destroy (blackbox *, void *d) |
|
static char * | box_String (blackbox *, void *d) |
|
static BOOLEAN | box_Assign (leftv result, leftv args) |
|
static BOOLEAN | box_Op2 (int op, leftv result, leftv b1, leftv b2) |
|
static BOOLEAN | box_OpM (int op, leftv result, leftv args) |
|
static BOOLEAN | box_serialize (blackbox *, void *d, si_link f) |
|
static BOOLEAN | box_deserialize (blackbox **, void **d, si_link f) |
|
static BOOLEAN | boxSet (leftv result, leftv args) |
|
static BOOLEAN | evalPolyAtBox (leftv result, leftv args) |
|
int SI_MOD_INIT() | interval (SModulFunctions *psModulFunctions) |
|
◆ box_Assign()
Definition at line 821 of file interval.cc.
846 int M =
m > (n-1) ? (n-1) :
m;
848 for (
i = 0;
i <=
M;
i++)
852 WerrorS(
"list contains non-intervals");
866 WerrorS(
"Input not supported: first argument not box, list, or interval");
883 result->data = (
void*) RES;
◆ box_Copy()
static void* box_Copy |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
|
static |
◆ box_deserialize()
◆ box_Destroy()
static void box_Destroy |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
|
static |
◆ box_Init()
static void* box_Init |
( |
blackbox * |
| ) |
|
|
static |
◆ box_Op2()
Definition at line 890 of file interval.cc.
894 Werror(
"first argument is not box but type(%d), second is type(%d)",
909 WerrorS(
"second argument not int");
917 int i = (int)(
long) b2->
Data();
921 WerrorS(
"index out of bounds");
941 WerrorS(
"second argument not box");
950 WerrorS(
"subtracting boxes from different rings not supported");
955 for (
i = 0;
i < n;
i++)
966 result->data = (
void*) RES;
975 WerrorS(
"second argument not box");
980 for (
i = 0;
i < n;
i++)
◆ box_OpM()
Definition at line 1000 of file interval.cc.
1009 WerrorS(
"can only intersect boxes");
1014 number lowerb[n], upperb[n];
1017 for (
i = 0;
i < n;
i++)
1019 lowerb[
i] =
B->intervals[
i]->lower;
1020 upperb[
i] =
B->intervals[
i]->upper;
1028 WerrorS(
"can only intersect boxes");
1033 for (
i = 0;
i < n;
i++)
1037 lowerb[
i] =
B->intervals[
i]->lower;
1041 upperb[
i] =
B->intervals[
i]->upper;
1047 result->data = (
void*) (-1);
1057 for (
i = 0;
i < n;
i++)
1063 result->data = (
void*) RES;
◆ box_serialize()
Definition at line 1072 of file interval.cc.
1080 memset(&
l, 0,
sizeof(
l));
1081 memset(&iv, 0,
sizeof(iv));
1084 l.data = (
void*)
"box";
1090 for (
i = 0;
i <
N;
i++)
1092 iv.
data = (
void*)
B->intervals[
i];
1093 f->m->Write(
f, &iv);
◆ box_String()
static char* box_String |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
|
static |
◆ boxSet()
◆ evalPolyAtBox()
Definition at line 1162 of file interval.cc.
1170 poly
p = (poly) args->
Data();
1172 int i, pot, n =
B->R->N;
1180 for (
i = 1;
i <= n;
i++)
1212 result->data = (
void*) RES;
◆ interval()
Definition at line 1221 of file interval.cc.
1223 blackbox *b_iv = (blackbox*)
omAlloc0(
sizeof(blackbox)),
1224 *b_bx = (blackbox*)
omAlloc0(
sizeof(blackbox));
1252 psModulFunctions->
iiAddCproc(
"rootisolation.lib",
"evalPolyAtBox",
FALSE,
◆ interval_Assign()
Definition at line 184 of file interval.cc.
210 n1 = (number) args->
CopyD();
214 WerrorS(
"Input not supported: first argument not int or number");
235 WerrorS(
"Input not supported: second argument not int or number");
256 result->data = (
void*) RES;
◆ interval_Copy()
static void* interval_Copy |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
|
static |
◆ interval_deserialize()
static BOOLEAN interval_deserialize |
( |
blackbox ** |
, |
|
|
void ** |
d, |
|
|
si_link |
f |
|
) |
| |
|
static |
Definition at line 762 of file interval.cc.
767 l->next =
f->m->Read(
f);
769 number lo = (number)
l->CopyD(),
770 up = (number)
l->next->CopyD();
◆ interval_Destroy()
static void interval_Destroy |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
|
static |
◆ interval_Init()
static void* interval_Init |
( |
blackbox * |
| ) |
|
|
static |
◆ interval_Op2()
Definition at line 438 of file interval.cc.
448 WerrorS(
"syntax: <interval> + <interval>");
456 WerrorS(
"adding intervals defined in different rings not supported");
467 WerrorS(
"syntax: <interval> - <interval>");
475 WerrorS(
"subtracting intervals defined in different rings not supported");
484 if (i1->
Typ() == i2->
Typ())
492 WerrorS(
"multiplying intervals defined in different rings not supported");
502 leftv iscalar, iinterv;
517 switch (iscalar->
Typ())
520 { n =
nInit((
int)(
long) iscalar->
Data());
break; }
522 { n = (number) iscalar->
CopyD();
break; }
524 {
WerrorS(
"first argument not int/number/interval");
return TRUE; }
546 WerrorS(
"second interval contains zero");
562 WerrorS(
"dividing intervals from different rings not supported");
586 WerrorS(
"first argument not int/number/interval");
606 { n =
nInit((
int)(
long) i2->
Data());
break; }
608 { n =
nCopy((number) i2->
Data());
break; }
611 WerrorS(
"second argument not int/number/interval");
618 WerrorS(
"<interval>/0 not supported");
636 WerrorS(
"syntax: <interval> ^ <int>");
639 int p = (int)(
long) i2->
Data();
642 WerrorS(
"<interval> ^ n not implemented for n < 0");
654 WerrorS(
"syntax: <interval> == <interval>");
671 WerrorS(
"syntax: <interval>[<int>]");
676 int n = (int)(
long) i2->
Data();
689 WerrorS(
"Allowed indices are 1 and 2");
696 number r = (number)
result->Data();
701 result->data = (
void*) out;
720 result->data = (
void*) RES;
◆ interval_serialize()
static BOOLEAN interval_serialize |
( |
blackbox * |
, |
|
|
void * |
d, |
|
|
si_link |
f |
|
) |
| |
|
static |
Definition at line 726 of file interval.cc.
734 memset(&
l, 0,
sizeof(
l));
735 memset(&lo, 0,
sizeof(lo));
736 memset(&up, 0,
sizeof(up));
739 l.data = (
void*)
"interval";
◆ interval_String()
static char* interval_String |
( |
blackbox * |
, |
|
|
void * |
d |
|
) |
| |
|
static |
◆ intervalAdd()
◆ intervalContainsZero()
static bool intervalContainsZero |
( |
interval * |
I | ) |
|
|
static |
◆ intervalEqual()
◆ intervalMultiply()
Definition at line 301 of file interval.cc.
310 int i, imax = 0, imin = 0;
311 for (
i = 1;
i < 4;
i++)
323 lo =
n_Copy(nums[imin], I->
R->cf);
324 up =
n_Copy(nums[imax], I->
R->cf);
327 for (
i = 0;
i < 4;
i++)
◆ intervalPower()
◆ intervalScalarMultiply()
◆ intervalSubtract()
◆ length()
◆ boxID
◆ intervalID
BOOLEAN blackboxDefaultOp2(int, leftv, leftv, leftv)
default procedure blackboxDefaultOp2, to be called as "default:" branch
static BOOLEAN interval_Assign(leftv result, leftv args)
void StringAppendS(const char *st)
static void * interval_Init(blackbox *)
static bool intervalEqual(interval *I, interval *J)
#define pGetExp(p, i)
Exponent.
static BOOLEAN length(leftv result, leftv arg)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
const CanonicalForm CFMap CFMap & N
static FORCE_INLINE BOOLEAN n_Greater(number a, number b, const coeffs r)
ordered fields: TRUE iff 'a' is larger than 'b'; in Z/pZ: TRUE iff la > lb, where la and lb are the l...
Class used for (list of) interpreter objects.
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
static interval * intervalSubtract(interval *I, interval *J)
static BOOLEAN interval_Op2(int op, leftv result, leftv i1, leftv i2)
static interval * intervalMultiply(interval *I, interval *J)
static char * interval_String(blackbox *, void *d)
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 BOOLEAN interval_serialize(blackbox *, void *d, si_link f)
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
int SI_MOD_INIT() interval(SModulFunctions *psModulFunctions)
static void * interval_Copy(blackbox *, void *d)
static void * box_Init(blackbox *)
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
box & setInterval(int, interval *)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static BOOLEAN interval_deserialize(blackbox **, void **d, si_link f)
static void box_Destroy(blackbox *, void *d)
void CleanUp(ring r=currRing)
static BOOLEAN box_serialize(blackbox *, void *d, si_link f)
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 BOOLEAN box_deserialize(blackbox **, void **d, si_link f)
STATIC_VAR int intervalID
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of 'a'; raise an error if 'a' is not invertible
static char * box_String(blackbox *, void *d)
void StringSetS(const char *st)
static interval * intervalPower(interval *I, int p)
void Werror(const char *fmt,...)
static BOOLEAN box_OpM(int op, leftv result, leftv args)
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff 'n' is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2),...
static void * box_Copy(blackbox *, void *d)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
void WerrorS(const char *s)
static BOOLEAN box_Op2(int op, leftv result, leftv b1, leftv b2)
static interval * intervalAdd(interval *I, interval *J)
static FORCE_INLINE void n_Power(number a, int b, number *res, const coeffs r)
fill res with the power a^b
static bool intervalContainsZero(interval *I)
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.
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static BOOLEAN boxSet(leftv result, leftv args)
BOOLEAN iiCheckTypes(leftv args, const short *type_list, int report)
check a list of arguemys against a given field of types return TRUE if the types match return FALSE (...
int(* iiAddCproc)(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
static void interval_Destroy(blackbox *, void *d)
BOOLEAN blackboxDefaultOpM(int op, leftv res, leftv args)
default procedure blackboxDefaultOpM, to be called as "default:" branch
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
static BOOLEAN box_Assign(leftv result, leftv args)
static interval * intervalScalarMultiply(number a, interval *I)
static BOOLEAN evalPolyAtBox(leftv result, leftv args)
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type