Loading...
Searching...
No Matches
generics.cc File Reference
`#include "misc/auxiliary.h"`
`#include "factory/factory.h"`
`#include "misc/mylimits.h"`
`#include "reporter/reporter.h"`
`#include "coeffs/coeffs.h"`
`#include "coeffs/longrat.h"`
`#include "coeffs/numbers.h"`
`#include "coeffs/si_gmp.h"`
`#include "coeffs/generics.h"`
`#include "coeffs/rintegers.h"`
`#include <string.h>`

Go to the source code of this file.

## Data Structures

struct | gcp

## Functions

static void | gCoeffWrite (const coeffs r, BOOLEAN b)
static char * | gCoeffName (const coeffs r)
static void | gKillChar (coeffs r)
static void | gSetChar (coeffs r)
static number | gMult (number a, number b, const coeffs cf)
static number | gSub (number a, number b, const coeffs cf)
static number | gAdd (number a, number b, const coeffs cf)
static number | gDiv (number a, number b, const coeffs cf)
static number | gIntMod (number a, number b, const coeffs cf)
static number | gExactDiv (number a, number b, const coeffs cf)
static number | gInit (long i, const coeffs cf)
static number | gInitMPZ (mpz_t i, const coeffs cf)
static int | gSize (number a, const coeffs)
static long | gInt (number &a, const coeffs)
static void | gMPZ (mpz_t result, number &n, const coeffs r)
static number | gInpNeg (number a, const coeffs r)
static number | gInvers (number a, const coeffs r)
static number | gCopy (number a, const coeffs r)
static number | gRePart (number a, const coeffs r)
static number | gImPart (number a, const coeffs r)
static void | gWriteLong (number a, const coeffs r)
static void | gWriteShort (number a, const coeffs r)
static const char * | gRead (const char *s, number *a, const coeffs r)
static void | gNormalize (number &a, const coeffs r)
static BOOLEAN | gGreater (number a, number b, const coeffs r)
static BOOLEAN | gEqual (number a, number b, const coeffs r)
static BOOLEAN | gIsZero (number a, const coeffs r)
static BOOLEAN | gIsOne (number a, const coeffs r)
static BOOLEAN | gIsMOne (number a, const coeffs r)
static BOOLEAN | gGreaterZero (number a, const coeffs r)
static void | gPower (number a, int i, number *result, const coeffs r)
static number | gGcd (number a, number b, const coeffs)
static number | gSubringGcd (number a, number b, const coeffs)
static number | gGetDenom (number &a, const coeffs)
static number | gGetNumerator (number &a, const coeffs)
static number | gQuotRem (number a, number b, number *rem, const coeffs r)
static number | gLcm (number a, number b, const coeffs r)
static number | gNormalizeHelper (number a, number b, const coeffs r)
static void | gDelete (number *a, const coeffs r)
static nMapFunc | gSetMap (const coeffs src, const coeffs dst)
static void | gWriteFd (number a, FILE *f, const coeffs r)
static number | gReadFd (s_buff f, const coeffs r)
static number | gFarey (number p, number n, const coeffs)
static number | gChineseRemainder (number *x, number *q, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs)
static number | gRandom (siRandProc p, number p1, number p2, const coeffs cf)
static BOOLEAN | gDivBy (number a, number b, const coeffs)
static number | gExtGcd (number a, number b, number *s, number *t, const coeffs)
static number | gGetUnit (number n, const coeffs r)
static BOOLEAN | gIsUnit (number a, const coeffs)
static int | gDivComp (number a, number b, const coeffs r)
static BOOLEAN | gDBTest (number a, const char *f, const int l, const coeffs r)
BOOLEAN | gInitChar (coeffs r, void *p)

## Variables

VAR coeffs | coeffs1
VAR coeffs | coeffs2

## Data Structure Documentation

## generic_pair

struct generic_pair

Definition at line 27 of file generics.cc.

Data Fields
number | a1 |
number | a2 |

## Function Documentation

## gAdd()

number gAdd | ( | number | a,
|  | number | b,
|  | const coeffs | cf )

static

Definition at line 76 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfAdd(aa->a1,bb->a1,coeffs1);
cc->a2=coeffs2->cfAdd(aa->a2,bb->a2,coeffs2);
n_Test((number)cc,cf);
return (number)cc;
}
cf
CanonicalForm cf
Definition cfModGcd.cc:4091
b
CanonicalForm b
Definition cfModGcd.cc:4111
n_Test
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r).
Definition coeffs.h:715
coeffs1
VAR coeffs coeffs1
Definition generics.cc:33
coeffs2
VAR coeffs coeffs2
Definition generics.cc:33
omalloc
#define omalloc(size)
Definition omAllocDecl.h:228

## gChineseRemainder()

number gChineseRemainder | ( | number * | x,
|  | number * | q,
|  | int | rl,
|  | BOOLEAN | sym,
|  | CFArray & | inv_cache,
|  | const coeffs | )

static

Definition at line 398 of file generics.cc.

{
printf("gChineseREmainder\n");
return NULL;
}
NULL
#define NULL
Definition omList.c:12

## gCoeffName()

char * gCoeffName | ( | const coeffs | r | ) |

static

Definition at line 41 of file generics.cc.

{
return coeffs1->cfCoeffName(coeffs1);
}

## gCoeffWrite()

void gCoeffWrite | ( | const coeffs | r,
|  | BOOLEAN | b )

static

Definition at line 35 of file generics.cc.

{
printf("debug: ");
coeffs1->cfCoeffWrite(coeffs1,b);
}

## gCopy()

number gCopy | ( | number | a,
|  | const coeffs | r )

static

Definition at line 180 of file generics.cc.

{
gcp aa=(gcp)a;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfCopy(aa->a1,coeffs1);
cc->a2=coeffs2->cfCopy(aa->a2,coeffs2);
return (number)cc;
}

## gDBTest()

BOOLEAN gDBTest | ( | number | a,
|  | const char * | f,
|  | const int | l,
|  | const coeffs | r )

static

Definition at line 462 of file generics.cc.

{
if (a==NULL)
printf("NULL in %s:%d\n",f,l);
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
l
int l
Definition cfEzgcd.cc:100
f
FILE * f
Definition checklibs.c:9

## gDelete()

void gDelete | ( | number * | a,
|  | const coeffs | r )

static

Definition at line 365 of file generics.cc.

{
if (*a!=NULL)
{
gcp aa=(gcp)*a;
coeffs1->cfDelete(&aa->a1,coeffs1);
coeffs2->cfDelete(&aa->a2,coeffs2);
omFree(aa);
*a=NULL;
}
}
omFree
#define omFree(addr)
Definition omAllocDecl.h:261

## gDiv()

number gDiv | ( | number | a,
|  | number | b,
|  | const coeffs | cf )

static

Definition at line 86 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfDiv(aa->a1,bb->a1,coeffs1);
cc->a2=coeffs2->cfDiv(aa->a2,bb->a2,coeffs2);
n_Test((number)cc,cf);
return (number)cc;
}

## gDivBy()

BOOLEAN gDivBy | ( | number | a,
|  | number | b,
|  | const coeffs | )

static

Definition at line 408 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
BOOLEAN b1=coeffs1->cfDivBy(aa->a1,bb->a1,coeffs1);
BOOLEAN b2=coeffs2->cfDivBy(aa->a2,bb->a2,coeffs2);
if (b1!=b2)
{
printf("gDivBy:%d,%d\n",b1,b2);
}
return b1;
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88

## gDivComp()

int gDivComp | ( | number | a,
|  | number | b,
|  | const coeffs | r )

static

Definition at line 450 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
int i1=coeffs1->cfDivComp(aa->a1,bb->a1,coeffs1);
int i2=coeffs2->cfDivComp(aa->a2,bb->a2,coeffs2);
if (i1!=i2)
{
printf("gDivComp:%d,%d\n",i1,i2);
}
return i1;
}

## gEqual()

BOOLEAN gEqual | ( | number | a,
|  | number | b,
|  | const coeffs | r )

static

Definition at line 243 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
BOOLEAN b1=coeffs1->cfEqual(aa->a1,bb->a1,coeffs1);
BOOLEAN b2=coeffs2->cfEqual(aa->a2,bb->a2,coeffs2);
if (b1!=b2)
{
printf("gEqual\n");
}
return b1;
}

## gExactDiv()

number gExactDiv | ( | number | a,
|  | number | b,
|  | const coeffs | cf )

static

Definition at line 106 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfExactDiv(aa->a1,bb->a1,coeffs1);
cc->a2=coeffs2->cfExactDiv(aa->a2,bb->a2,coeffs2);
n_Test((number)cc,cf);
return (number)cc;
}

## gExtGcd()

number gExtGcd | ( | number | a,
|  | number | b,
|  | number * | s,
|  | number * | t,
|  | const coeffs | )

static

Definition at line 420 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
gcp cc=(gcp)omalloc(sizeof(*cc));
gcp ss=(gcp)omalloc(sizeof(*ss));
gcp tt=(gcp)omalloc(sizeof(*ss));
cc->a1=coeffs1->cfExtGcd(aa->a1,bb->a1,&ss->a1,&tt->a1,coeffs1);
cc->a2=coeffs2->cfExtGcd(aa->a2,bb->a2,&ss->a2,&tt->a2,coeffs2);
return (number)cc;
}

## gFarey()

number gFarey | ( | number | p,
|  | number | n,
|  | const coeffs | )

static

Definition at line 390 of file generics.cc.

{
gcp aa=(gcp)p;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfFarey(aa->a1,n,coeffs1);
cc->a2=coeffs2->cfFarey(aa->a2,n,coeffs2);
return (number)cc;
}
p
int p
Definition cfModGcd.cc:4086

## gGcd()

number gGcd | ( | number | a,
|  | number | b,
|  | const coeffs | )

static

Definition at line 308 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfGcd(aa->a1,bb->a1,coeffs1);
cc->a2=coeffs2->cfGcd(aa->a2,bb->a2,coeffs2);
return (number)cc;
}

## gGetDenom()

number gGetDenom | ( | number & | a,
|  | const coeffs | )

static

Definition at line 326 of file generics.cc.

{
gcp aa=(gcp)a;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfGetDenom(aa->a1,coeffs1);
cc->a2=coeffs2->cfGetDenom(aa->a2,coeffs2);
return (number)cc;
}

## gGetNumerator()

number gGetNumerator | ( | number & | a,
|  | const coeffs | )

static

Definition at line 334 of file generics.cc.

{
gcp aa=(gcp)a;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfGetNumerator(aa->a1,coeffs1);
cc->a2=coeffs2->cfGetNumerator(aa->a2,coeffs2);
return (number)cc;
}

## gGetUnit()

number gGetUnit | ( | number | n,
|  | const coeffs | r )

static

Definition at line 431 of file generics.cc.

{
gcp aa=(gcp)n;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfGetUnit(aa->a1,coeffs1);
cc->a2=coeffs2->cfGetUnit(aa->a2,coeffs2);
return (number)cc;
}

## gGreater()

BOOLEAN gGreater | ( | number | a,
|  | number | b,
|  | const coeffs | r )

static

Definition at line 231 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
BOOLEAN b1=coeffs1->cfGreater(aa->a1,bb->a1,coeffs1);
BOOLEAN b2=coeffs2->cfGreater(aa->a2,bb->a2,coeffs2);
if (b1!=b2)
{
printf("gGreater\n");
}
return b1;
}

## gGreaterZero()

BOOLEAN gGreaterZero | ( | number | a,
|  | const coeffs | r )

static

Definition at line 289 of file generics.cc.

{
gcp aa=(gcp)a;
BOOLEAN b1=coeffs1->cfGreaterZero(aa->a1,coeffs1);
BOOLEAN b2=coeffs2->cfGreaterZero(aa->a2,coeffs2);
if (b1!=b2)
{
printf("gGreaterZero\n");
}
return b1;
}

## gImPart()

number gImPart | ( | number | a,
|  | const coeffs | r )

static

Definition at line 196 of file generics.cc.

{
gcp aa=(gcp)a;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfRePart(aa->a1,coeffs1);
cc->a2=coeffs2->cfRePart(aa->a2,coeffs2);
return (number)cc;
}

## gInit()

number gInit | ( | long | i,
|  | const coeffs | cf )

static

Definition at line 116 of file generics.cc.

{
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfInit(i,coeffs1);
cc->a2=coeffs2->cfInit(i,coeffs2);
n_Test((number)cc,cf);
return (number)cc;
}
i
int i
Definition cfEzgcd.cc:132

## gInitChar()

BOOLEAN gInitChar | ( | coeffs | r,
|  | void * | p )

Definition at line 468 of file generics.cc.

{
coeffs1=nInitChar(n_Z_1,(void*)1);
coeffs2=nInitChar(n_Z_2,(void*)1);
r->is_field=FALSE;
r->is_domain=TRUE;
r->rep=n_rep_unknown;
r->ch = 0;
r->cfKillChar=gKillChar;
//r->nCoeffIsEqual=gCoeffsEqual;
r->cfCoeffName=gCoeffName;
r->cfCoeffWrite=gCoeffWrite;
r->cfMult = gMult;
r->cfSub = gSub;
r->cfAdd = gAdd;
r->cfDiv = gDiv;
r->cfInit = gInit;
r->cfSize = gSize;
r->cfInt = gInt;
r->cfDivComp = gDivComp;
r->cfIsUnit = gIsUnit;
r->cfGetUnit = gGetUnit;
r->cfExtGcd = gExtGcd;
r->cfDivBy = gDivBy;
r->cfInpNeg = gInpNeg;
r->cfInvers= gInvers;
r->cfCopy = gCopy;
r->cfRePart = gCopy;
//r->cfImPart = ndReturn0;
r->cfWriteLong = gWriteLong;
r->cfWriteShort = gWriteShort;
r->cfRead = gRead;
r->cfNormalize=gNormalize;
r->cfGreater = gGreater;
r->cfEqual = gEqual;
r->cfIsZero = gIsZero;
r->cfIsOne = gIsOne;
r->cfIsMOne = gIsMOne;
r->cfGreaterZero = gGreaterZero;
r->cfPower = gPower;
r->cfGetDenom = gGetDenom;
r->cfGetNumerator = gGetNumerator;
r->cfGcd = gGcd;
r->cfLcm = gGcd;
r->cfDelete= gDelete;
r->cfSetMap = gSetMap;
//r->cfInpMult=ndInpMult;
r->cfRandom=gRandom;
r->cfWriteFd=gWriteFd;
r->cfReadFd=gReadFd;
r->type=n_Z;
#ifdef LDEBUG
r->cfDBTest=gDBTest;
#endif
return FALSE;
}
FALSE
#define FALSE
Definition auxiliary.h:97
n_Z
@ n_Z
only used if HAVE_RINGS is defined
Definition coeffs.h:43
nInitChar
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition numbers.cc:412
n_rep_unknown
@ n_rep_unknown
Definition coeffs.h:116
gDivComp
static int gDivComp(number a, number b, const coeffs r)
Definition generics.cc:450
gWriteFd
static void gWriteFd(number a, FILE *f, const coeffs r)
Definition generics.cc:381
gCopy
static number gCopy(number a, const coeffs r)
Definition generics.cc:180
gGcd
static number gGcd(number a, number b, const coeffs)
Definition generics.cc:308
gMult
static number gMult(number a, number b, const coeffs cf)
Definition generics.cc:56
gIsMOne
static BOOLEAN gIsMOne(number a, const coeffs r)
Definition generics.cc:278
gWriteShort
static void gWriteShort(number a, const coeffs r)
Definition generics.cc:209
gDivBy
static BOOLEAN gDivBy(number a, number b, const coeffs)
Definition generics.cc:408
gNormalize
static void gNormalize(number &a, const coeffs r)
Definition generics.cc:225
gInt
static long gInt(number &a, const coeffs)
Definition generics.cc:143
gAdd
static number gAdd(number a, number b, const coeffs cf)
Definition generics.cc:76
gIsUnit
static BOOLEAN gIsUnit(number a, const coeffs)
Definition generics.cc:439
gPower
static void gPower(number a, int i, number *result, const coeffs r)
Definition generics.cc:300
gInpNeg
static number gInpNeg(number a, const coeffs r)
Definition generics.cc:165
gGreaterZero
static BOOLEAN gGreaterZero(number a, const coeffs r)
Definition generics.cc:289
gKillChar
static void gKillChar(coeffs r)
Definition generics.cc:45
gGetUnit
static number gGetUnit(number n, const coeffs r)
Definition generics.cc:431
gInit
static number gInit(long i, const coeffs cf)
Definition generics.cc:116
gCoeffWrite
static void gCoeffWrite(const coeffs r, BOOLEAN b)
Definition generics.cc:35
gGetDenom
static number gGetDenom(number &a, const coeffs)
Definition generics.cc:326
gEqual
static BOOLEAN gEqual(number a, number b, const coeffs r)
Definition generics.cc:243
gGetNumerator
static number gGetNumerator(number &a, const coeffs)
Definition generics.cc:334
gRandom
static number gRandom(siRandProc p, number p1, number p2, const coeffs cf)
Definition generics.cc:403
gGreater
static BOOLEAN gGreater(number a, number b, const coeffs r)
Definition generics.cc:231
gExtGcd
static number gExtGcd(number a, number b, number *s, number *t, const coeffs)
Definition generics.cc:420
gWriteLong
static void gWriteLong(number a, const coeffs r)
Definition generics.cc:204
gDBTest
static BOOLEAN gDBTest(number a, const char *f, const int l, const coeffs r)
Definition generics.cc:462
gRead
static const char * gRead(const char *s, number *a, const coeffs r)
Definition generics.cc:214
gReadFd
static number gReadFd(s_buff f, const coeffs r)
Definition generics.cc:385
gSetMap
static nMapFunc gSetMap(const coeffs src, const coeffs dst)
Definition generics.cc:376
gIsZero
static BOOLEAN gIsZero(number a, const coeffs r)
Definition generics.cc:255
gCoeffName
static char * gCoeffName(const coeffs r)
Definition generics.cc:41
gInvers
static number gInvers(number a, const coeffs r)
Definition generics.cc:172
gDelete
static void gDelete(number *a, const coeffs r)
Definition generics.cc:365
gSize
static int gSize(number a, const coeffs)
Definition generics.cc:132
gSub
static number gSub(number a, number b, const coeffs cf)
Definition generics.cc:66
gDiv
static number gDiv(number a, number b, const coeffs cf)
Definition generics.cc:86
gIsOne
static BOOLEAN gIsOne(number a, const coeffs r)
Definition generics.cc:267

## gInitMPZ()

number gInitMPZ | ( | mpz_t | i,
|  | const coeffs | cf )

static

Definition at line 124 of file generics.cc.

{
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfInitMPZ(i,coeffs1);
cc->a2=coeffs2->cfInitMPZ(i,coeffs2);
n_Test((number)cc,cf);
return (number)cc;
}

## gInpNeg()

number gInpNeg | ( | number | a,
|  | const coeffs | r )

static

Definition at line 165 of file generics.cc.

{
gcp aa=(gcp)a;
aa->a1=coeffs1->cfInpNeg(aa->a1,coeffs1);
aa->a2=coeffs2->cfInpNeg(aa->a2,coeffs2);
return (number)aa;
}

## gInt()

long gInt | ( | number & | a,
|  | const coeffs | )

static

Definition at line 143 of file generics.cc.

{
gcp aa=(gcp)a;
long s1=coeffs1->cfInt(aa->a1,coeffs1);
long s2=coeffs2->cfInt(aa->a2,coeffs2);
if (s1!=s2)
{
printf("gInt: %ld, %ld\n",s1,s2);
}
return s1;
}

## gIntMod()

number gIntMod | ( | number | a,
|  | number | b,
|  | const coeffs | cf )

static

Definition at line 96 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfIntMod(aa->a1,bb->a1,coeffs1);
cc->a2=coeffs2->cfIntMod(aa->a2,bb->a2,coeffs2);
n_Test((number)cc,cf);
return (number)cc;
}

## gInvers()

number gInvers | ( | number | a,
|  | const coeffs | r )

static

Definition at line 172 of file generics.cc.

{
gcp aa=(gcp)a;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfInvers(aa->a1,coeffs1);
cc->a2=coeffs2->cfInvers(aa->a2,coeffs2);
return (number)cc;
}

## gIsMOne()

BOOLEAN gIsMOne | ( | number | a,
|  | const coeffs | r )

static

Definition at line 278 of file generics.cc.

{
gcp aa=(gcp)a;
BOOLEAN b1=coeffs1->cfIsMOne(aa->a1,coeffs1);
BOOLEAN b2=coeffs2->cfIsMOne(aa->a2,coeffs2);
if (b1!=b2)
{
printf("gIsMOne\n");
}
return b1;
}

## gIsOne()

BOOLEAN gIsOne | ( | number | a,
|  | const coeffs | r )

static

Definition at line 267 of file generics.cc.

{
gcp aa=(gcp)a;
BOOLEAN b1=coeffs1->cfIsOne(aa->a1,coeffs1);
BOOLEAN b2=coeffs2->cfIsOne(aa->a2,coeffs2);
if (b1!=b2)
{
printf("gIsOne\n");
}
return b1;
}

## gIsUnit()

BOOLEAN gIsUnit | ( | number | a,
|  | const coeffs | )

static

Definition at line 439 of file generics.cc.

{
gcp aa=(gcp)a;
BOOLEAN b1=coeffs1->cfIsUnit(aa->a1,coeffs1);
BOOLEAN b2=coeffs2->cfIsUnit(aa->a2,coeffs2);
if (b1!=b2)
{
printf("gIsUnit:%d,%d\n",b1,b2);
}
return b1;
}

## gIsZero()

BOOLEAN gIsZero | ( | number | a,
|  | const coeffs | r )

static

Definition at line 255 of file generics.cc.

{
if (a==NULL) return TRUE;
gcp aa=(gcp)a;
BOOLEAN b1=coeffs1->cfIsZero(aa->a1,coeffs1);
BOOLEAN b2=coeffs2->cfIsZero(aa->a2,coeffs2);
if (b1!=b2)
{
printf("gIsZero\n");
}
return b1;
}

## gKillChar()

void gKillChar | ( | coeffs | r | ) |

static

Definition at line 45 of file generics.cc.

{
coeffs1->cfKillChar(coeffs1);
coeffs2->cfKillChar(coeffs2);
}

## gLcm()

number gLcm | ( | number | a,
|  | number | b,
|  | const coeffs | r )

static

Definition at line 347 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfLcm(aa->a1,bb->a1,coeffs1);
cc->a2=coeffs2->cfLcm(aa->a2,bb->a2,coeffs2);
return (number)cc;
}

## gMPZ()

void gMPZ | ( | mpz_t | result,
|  | number & | n,
|  | const coeffs | r )

static

Definition at line 154 of file generics.cc.

{
coeffs1->cfMPZ(result,n,coeffs1);
mpz_t r2;
coeffs2->cfMPZ(r2,n,coeffs2);
if(mpz_cmp(result,r2)!=0)
{
printf("gMPZ\n");
}
mpz_clear(r2);
}
result
return result
Definition facAbsBiFact.cc:76

## gMult()

number gMult | ( | number | a,
|  | number | b,
|  | const coeffs | cf )

static

Definition at line 56 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfMult(aa->a1,bb->a1,coeffs1);
cc->a2=coeffs2->cfMult(aa->a2,bb->a2,coeffs2);
n_Test((number)cc,cf);
return (number)cc;
}

## gNormalize()

void gNormalize | ( | number & | a,
|  | const coeffs | r )

static

Definition at line 225 of file generics.cc.

{
gcp aa=(gcp)a;
coeffs1->cfNormalize(aa->a1,coeffs1);
coeffs2->cfNormalize(aa->a2,coeffs2);
}

## gNormalizeHelper()

number gNormalizeHelper | ( | number | a,
|  | number | b,
|  | const coeffs | r )

static

Definition at line 356 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfNormalizeHelper(aa->a1,bb->a1,coeffs1);
cc->a2=coeffs2->cfNormalizeHelper(aa->a2,bb->a2,coeffs2);
return (number)cc;
}

## gPower()

void gPower | ( | number | a,
|  | int | i,
|  | number * | result,
|  | const coeffs | r )

static

Definition at line 300 of file generics.cc.

{
gcp aa=(gcp)a;
gcp cc=(gcp)omalloc(sizeof(*cc));
coeffs1->cfPower(aa->a1,i,&cc->a1,coeffs1);
coeffs2->cfPower(aa->a2,i,&cc->a2,coeffs2);
*result=(number)cc;
}

## gQuotRem()

number gQuotRem | ( | number | a,
|  | number | b,
|  | number * | rem,
|  | const coeffs | r )

static

Definition at line 342 of file generics.cc.

{
printf("gQuotRem\n");
return NULL;
}

## gRandom()

number gRandom | ( | siRandProc | p,
|  | number | p1,
|  | number | p2,
|  | const coeffs | cf )

static

Definition at line 403 of file generics.cc.

{
printf("gRandom\n");
return NULL;
}

## gRead()

const char * gRead | ( | const char * | s,
|  | number * | a,
|  | const coeffs | r )

static

Definition at line 214 of file generics.cc.

{
gcp cc=(gcp)omalloc(sizeof(*cc));
const char* ss=coeffs1->cfRead(s,&(cc->a1),coeffs1);
number tmp=coeffs2->cfInit(1,coeffs2);
mpz_ptr tt=(mpz_ptr)tmp;
coeffs1->cfMPZ(tt,cc->a1,coeffs1);
cc->a2=(number)tt;
*a=(number)cc;
return ss;
}
s
const CanonicalForm int s
Definition facAbsFact.cc:51

## gReadFd()

number gReadFd | ( | s_buff | f,
|  | const coeffs | r )

static

Definition at line 385 of file generics.cc.

{
printf("gReadFd\n");
return NULL;
}

## gRePart()

number gRePart | ( | number | a,
|  | const coeffs | r )

static

Definition at line 188 of file generics.cc.

{
gcp aa=(gcp)a;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfRePart(aa->a1,coeffs1);
cc->a2=coeffs2->cfRePart(aa->a2,coeffs2);
return (number)cc;
}

## gSetChar()

void gSetChar | ( | coeffs | r | ) |

static

Definition at line 50 of file generics.cc.

{
coeffs1->cfSetChar(coeffs1);
coeffs2->cfSetChar(coeffs2);
}

## gSetMap()

nMapFunc gSetMap | ( | const coeffs | src,
|  | const coeffs | dst )

static

Definition at line 376 of file generics.cc.

{
printf("gSetMap\n");
return NULL;
}

## gSize()

int gSize | ( | number | a,
|  | const coeffs | )

static

Definition at line 132 of file generics.cc.

{
gcp aa=(gcp)a;
int s1=coeffs1->cfSize(aa->a1,coeffs1);
int s2=coeffs2->cfSize(aa->a2,coeffs2);
if (s1!=s2)
{
printf("gSize: %d, %d\n",s1,s2);
}
return s1;
}

## gSub()

number gSub | ( | number | a,
|  | number | b,
|  | const coeffs | cf )

static

Definition at line 66 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfSub(aa->a1,bb->a1,coeffs1);
cc->a2=coeffs2->cfSub(aa->a2,bb->a2,coeffs2);
n_Test((number)cc,cf);
return (number)cc;
}

## gSubringGcd()

number gSubringGcd | ( | number | a,
|  | number | b,
|  | const coeffs | )

static

Definition at line 317 of file generics.cc.

{
gcp aa=(gcp)a;
gcp bb=(gcp)b;
gcp cc=(gcp)omalloc(sizeof(*cc));
cc->a1=coeffs1->cfSubringGcd(aa->a1,bb->a1,coeffs1);
cc->a2=coeffs2->cfSubringGcd(aa->a2,bb->a2,coeffs2);
return (number)cc;
}

## gWriteFd()

void gWriteFd | ( | number | a,
|  | FILE * | f,
|  | const coeffs | r )

static

Definition at line 381 of file generics.cc.

{
printf("gWriteFd\n");
}

## gWriteLong()

void gWriteLong | ( | number | a,
|  | const coeffs | r )

static

Definition at line 204 of file generics.cc.

{
gcp aa=(gcp)a;
coeffs1->cfWriteLong(aa->a1,coeffs1);
}

## gWriteShort()

void gWriteShort | ( | number | a,
|  | const coeffs | r )

static

Definition at line 209 of file generics.cc.

{
gcp aa=(gcp)a;
coeffs1->cfWriteShort(aa->a1,coeffs1);
}

## Variable Documentation

## coeffs1

VAR coeffs coeffs1

Definition at line 33 of file generics.cc.

## coeffs2

VAR coeffs coeffs2

Definition at line 33 of file generics.cc.