Data Structures | Typedefs | Functions
algext.h File Reference
#include <coeffs/coeffs.h>

Go to the source code of this file.

Data Structures

struct  AlgExtInfo
 struct for passing initialization parameters to naInitChar More...
 

Typedefs

typedef polyrec * poly
 

Functions

nMapFunc naSetMap (const coeffs src, const coeffs dst)
 Get a mapping function from src into the domain of this type (n_algExt) More...
 
BOOLEAN naInitChar (coeffs cf, void *infoStruct)
 Initialize the coeffs object. More...
 
BOOLEAN n2pInitChar (coeffs cf, void *infoStruct)
 
int naIsParam (number, const coeffs)
 if m == var(i)/1 => return i, More...
 
poly p_ExtGcd (poly p, poly &pFactor, poly q, poly &qFactor, ring r)
 assumes that p and q are univariate polynomials in r, mentioning the same variable; assumes a global monomial ordering in r; assumes that not both p and q are NULL; returns the gcd of p and q; moreover, afterwards pFactor and qFactor contain appropriate factors such that gcd(p, q) = p * pFactor + q * qFactor; leaves p and q unmodified More...
 
char * naCoeffString (const coeffs r)
 
char * naCoeffName (const coeffs r)
 

Data Structure Documentation

§ AlgExtInfo

struct AlgExtInfo

struct for passing initialization parameters to naInitChar

Definition at line 40 of file algext.h.

Data Fields
ring r

Typedef Documentation

§ poly

typedef polyrec* poly

Definition at line 54 of file algext.h.

Function Documentation

§ n2pInitChar()

BOOLEAN n2pInitChar ( coeffs  cf,
void *  infoStruct 
)

first check whether cf->extRing != NULL and delete old ring???

Definition at line 1696 of file algext.cc.

1697 {
1698  assume( infoStruct != NULL );
1699 
1700  AlgExtInfo *e = (AlgExtInfo *)infoStruct;
1701  /// first check whether cf->extRing != NULL and delete old ring???
1702 
1703  assume(e->r != NULL); // extRing;
1704  assume(e->r->cf != NULL); // extRing->cf;
1705 
1706  assume( cf != NULL );
1707 
1708  e->r->ref ++; // increase the ref.counter for the ground poly. ring!
1709  const ring R = e->r; // no copy!
1710  cf->extRing = R;
1711 
1712  /* propagate characteristic up so that it becomes
1713  directly accessible in cf: */
1714  cf->ch = R->cf->ch;
1715  cf->is_field=FALSE;
1716  cf->is_domain=TRUE;
1717 
1718  cf->cfCoeffString = n2pCoeffString;
1719  cf->cfCoeffName = n2pCoeffName;
1720 
1721  cf->cfGreaterZero = naGreaterZero;
1722  cf->cfGreater = naGreater;
1723  cf->cfEqual = naEqual;
1724  cf->cfIsZero = naIsZero;
1725  cf->cfIsOne = naIsOne;
1726  cf->cfIsMOne = naIsMOne;
1727  cf->cfInit = naInit;
1728  cf->cfFarey = naFarey;
1729  cf->cfChineseRemainder= naChineseRemainder;
1730  cf->cfInt = naInt;
1731  cf->cfInpNeg = naNeg;
1732  cf->cfAdd = naAdd;
1733  cf->cfSub = naSub;
1734  cf->cfMult = n2pMult;
1735  cf->cfDiv = n2pDiv;
1736  cf->cfPower = n2pPower;
1737  cf->cfCopy = naCopy;
1738 
1739  cf->cfWriteLong = naWriteLong;
1740 
1741  if( rCanShortOut(n2pRing) )
1742  cf->cfWriteShort = naWriteShort;
1743  else
1744  cf->cfWriteShort = naWriteLong;
1745 
1746  cf->cfRead = n2pRead;
1747  cf->cfDelete = naDelete;
1748  cf->cfSetMap = naSetMap;
1749  cf->cfGetDenom = naGetDenom;
1750  cf->cfGetNumerator = naGetNumerator;
1751  cf->cfRePart = naCopy;
1752  cf->cfCoeffWrite = n2pCoeffWrite;
1753  cf->cfNormalize = n2pNormalize;
1754  cf->cfKillChar = naKillChar;
1755 #ifdef LDEBUG
1756  cf->cfDBTest = naDBTest;
1757 #endif
1758  cf->cfGcd = naGcd;
1759  cf->cfNormalizeHelper = naLcmContent;
1760  cf->cfSize = naSize;
1761  cf->nCoeffIsEqual = n2pCoeffIsEqual;
1762  cf->cfInvers = n2pInvers;
1763  cf->convFactoryNSingN=naConvFactoryNSingN;
1764  cf->convSingNFactoryN=naConvSingNFactoryN;
1765  cf->cfParDeg = naParDeg;
1766 
1767  cf->iNumberOfParameters = rVar(R);
1768  cf->pParameterNames = (const char**)R->names;
1769  cf->cfParameter = naParameter;
1770  cf->has_simple_Inverse=FALSE;
1771  /* cf->has_simple_Alloc= FALSE; */
1772 
1773  if( nCoeff_is_Q(R->cf) )
1774  {
1775  cf->cfClearContent = naClearContent;
1776  cf->cfClearDenominators = naClearDenominators;
1777  }
1778 
1779  return FALSE;
1780 }
void n2pNormalize(number &a, const coeffs cf)
Definition: algext.cc:1551
void naDelete(number *a, const coeffs cf)
Definition: algext.cc:285
ring r
Definition: algext.h:40
BOOLEAN naIsZero(number a, const coeffs cf)
Definition: algext.cc:279
#define FALSE
Definition: auxiliary.h:95
number n2pInvers(number a, const coeffs cf)
Definition: algext.cc:1680
number naChineseRemainder(number *x, number *q, int rl, BOOLEAN, CFArray &inv_cache, const coeffs cf)
Definition: algext.cc:1386
void naKillChar(coeffs cf)
Definition: algext.cc:1334
const char * n2pRead(const char *s, number *a, const coeffs cf)
Definition: algext.cc:1583
number naSub(number a, number b, const coeffs cf)
Definition: algext.cc:455
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
nMapFunc naSetMap(const coeffs src, const coeffs dst)
Get a mapping function from src into the domain of this type (n_algExt)
Definition: algext.cc:1030
number naInit(long i, const coeffs cf)
Definition: algext.cc:346
#define TRUE
Definition: auxiliary.h:99
number naParameter(const int iParameter, const coeffs cf)
return the specified parameter as a number in the given alg. field
Definition: algext.cc:1091
long naInt(number &a, const coeffs cf)
Definition: algext.cc:352
BOOLEAN naGreater(number a, number b, const coeffs cf)
Definition: algext.cc:365
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:840
#define n2pRing
Definition: algext.cc:1535
static BOOLEAN rCanShortOut(const ring r)
Definition: ring.h:574
void n2pCoeffWrite(const coeffs cf, BOOLEAN details)
Definition: algext.cc:1668
int naParDeg(number a, const coeffs cf)
Definition: algext.cc:1083
BOOLEAN naGreaterZero(number a, const coeffs cf)
forward declarations
Definition: algext.cc:385
char * n2pCoeffName(const coeffs cf)
Definition: algext.cc:1640
number naFarey(number p, number n, const coeffs cf)
Definition: algext.cc:1398
int naSize(number a, const coeffs cf)
Definition: algext.cc:721
BOOLEAN naEqual(number a, number b, const coeffs cf)
Definition: algext.cc:294
number naConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
Definition: algext.cc:763
number naGetDenom(number &a, const coeffs cf)
Definition: algext.cc:316
BOOLEAN naDBTest(number a, const char *f, const int l, const coeffs r)
Definition: algext.cc:240
#define assume(x)
Definition: mod2.h:403
number n2pMult(number a, number b, const coeffs cf)
Definition: algext.cc:1558
char * n2pCoeffString(const coeffs cf)
Definition: algext.cc:1612
const ring R
Definition: DebugPrint.cc:36
number n2pDiv(number a, number b, const coeffs cf)
Definition: algext.cc:1567
void naWriteLong(number a, const coeffs cf)
Definition: algext.cc:578
static BOOLEAN n2pCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
Definition: algext.cc:1592
number naLcmContent(number a, number b, const coeffs cf)
Definition: algext.cc:652
void n2pPower(number a, int exp, number *b, const coeffs cf)
Definition: algext.cc:1576
#define NULL
Definition: omList.c:10
number naAdd(number a, number b, const coeffs cf)
Definition: algext.cc:444
struct for passing initialization parameters to naInitChar
Definition: algext.h:40
CanonicalForm naConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
Definition: algext.cc:769
number naCopy(number a, const coeffs cf)
Definition: algext.cc:303
number naGcd(number a, number b, const coeffs cf)
Definition: algext.cc:783
void naClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: algext.cc:1117
void naClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: algext.cc:1318
number naNeg(number a, const coeffs cf)
this is in-place, modifies a
Definition: algext.cc:339
BOOLEAN naIsOne(number a, const coeffs cf)
Definition: algext.cc:322
BOOLEAN naIsMOne(number a, const coeffs cf)
Definition: algext.cc:330
void naWriteShort(number a, const coeffs cf)
Definition: algext.cc:596
number naGetNumerator(number &a, const coeffs cf)
Definition: algext.cc:311

§ naCoeffName()

char* naCoeffName ( const coeffs  r)

Definition at line 1363 of file algext.cc.

1364 {
1365  const char* const* p=n_ParameterNames(r);
1366  int l=0;
1367  int i;
1368  for(i=0; i<n_NumberOfParameters(r);i++)
1369  {
1370  l+=(strlen(p[i])+1);
1371  }
1372  static char s[200];
1373  s[0]='\0';
1374  snprintf(s,10+1,"%d",r->ch); /* Fp(a) or Q(a) */
1375  char tt[2];
1376  tt[0]=',';
1377  tt[1]='\0';
1378  for(i=0; i<n_NumberOfParameters(r);i++)
1379  {
1380  strcat(s,tt);
1381  strcat(s,p[i]);
1382  }
1383  return s;
1384 }
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition: coeffs.h:812
const CanonicalForm int s
Definition: facAbsFact.cc:55
return P p
Definition: myNF.cc:203
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition: coeffs.h:808
int i
Definition: cfEzgcd.cc:123
int l
Definition: cfEzgcd.cc:94

§ naCoeffString()

char* naCoeffString ( const coeffs  r)

Definition at line 1340 of file algext.cc.

1341 {
1342  const char* const* p=n_ParameterNames(r);
1343  int l=0;
1344  int i;
1345  for(i=0; i<n_NumberOfParameters(r);i++)
1346  {
1347  l+=(strlen(p[i])+1);
1348  }
1349  char *s=(char *)omAlloc(l+10+1);
1350  s[0]='\0';
1351  snprintf(s,10+1,"%d",r->ch); /* Fp(a) or Q(a) */
1352  char tt[2];
1353  tt[0]=',';
1354  tt[1]='\0';
1355  for(i=0; i<n_NumberOfParameters(r);i++)
1356  {
1357  strcat(s,tt);
1358  strcat(s,p[i]);
1359  }
1360  return s;
1361 }
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition: coeffs.h:812
const CanonicalForm int s
Definition: facAbsFact.cc:55
return P p
Definition: myNF.cc:203
#define omAlloc(size)
Definition: omAllocDecl.h:210
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition: coeffs.h:808
int i
Definition: cfEzgcd.cc:123
int l
Definition: cfEzgcd.cc:94

§ naInitChar()

BOOLEAN naInitChar ( coeffs  cf,
void *  infoStruct 
)

Initialize the coeffs object.

first check whether cf->extRing != NULL and delete old ring???

Definition at line 1406 of file algext.cc.

1407 {
1408  assume( infoStruct != NULL );
1409 
1410  AlgExtInfo *e = (AlgExtInfo *)infoStruct;
1411  /// first check whether cf->extRing != NULL and delete old ring???
1412 
1413  assume(e->r != NULL); // extRing;
1414  assume(e->r->cf != NULL); // extRing->cf;
1415 
1416  assume((e->r->qideal != NULL) && // minideal has one
1417  (IDELEMS(e->r->qideal) == 1) && // non-zero generator
1418  (e->r->qideal->m[0] != NULL) ); // at m[0];
1419 
1420  assume( cf != NULL );
1421  assume(getCoeffType(cf) == n_algExt); // coeff type;
1422 
1423  e->r->ref ++; // increase the ref.counter for the ground poly. ring!
1424  const ring R = e->r; // no copy!
1425  cf->extRing = R;
1426 
1427  /* propagate characteristic up so that it becomes
1428  directly accessible in cf: */
1429  cf->ch = R->cf->ch;
1430 
1431  cf->is_field=TRUE;
1432  cf->is_domain=TRUE;
1433  cf->rep=n_rep_poly;
1434 
1435  #ifdef LDEBUG
1437  #endif
1438 
1439  cf->cfCoeffString = naCoeffString;
1440  cf->cfCoeffName = naCoeffName;
1441 
1442  cf->cfGreaterZero = naGreaterZero;
1443  cf->cfGreater = naGreater;
1444  cf->cfEqual = naEqual;
1445  cf->cfIsZero = naIsZero;
1446  cf->cfIsOne = naIsOne;
1447  cf->cfIsMOne = naIsMOne;
1448  cf->cfInit = naInit;
1449  cf->cfFarey = naFarey;
1450  cf->cfChineseRemainder= naChineseRemainder;
1451  cf->cfInt = naInt;
1452  cf->cfInpNeg = naNeg;
1453  cf->cfAdd = naAdd;
1454  cf->cfSub = naSub;
1455  cf->cfMult = naMult;
1456  cf->cfDiv = naDiv;
1457  cf->cfExactDiv = naDiv;
1458  cf->cfPower = naPower;
1459  cf->cfCopy = naCopy;
1460 
1461  cf->cfWriteLong = naWriteLong;
1462 
1463  if( rCanShortOut(naRing) )
1464  cf->cfWriteShort = naWriteShort;
1465  else
1466  cf->cfWriteShort = naWriteLong;
1467 
1468  cf->cfRead = naRead;
1469  cf->cfDelete = naDelete;
1470  cf->cfSetMap = naSetMap;
1471  cf->cfGetDenom = naGetDenom;
1472  cf->cfGetNumerator = naGetNumerator;
1473  cf->cfRePart = naCopy;
1474  cf->cfCoeffWrite = naCoeffWrite;
1475  cf->cfNormalize = naNormalize;
1476  cf->cfKillChar = naKillChar;
1477 #ifdef LDEBUG
1478  cf->cfDBTest = naDBTest;
1479 #endif
1480  cf->cfGcd = naGcd;
1481  cf->cfNormalizeHelper = naLcmContent;
1482  cf->cfSize = naSize;
1483  cf->nCoeffIsEqual = naCoeffIsEqual;
1484  cf->cfInvers = naInvers;
1485  cf->convFactoryNSingN=naConvFactoryNSingN;
1486  cf->convSingNFactoryN=naConvSingNFactoryN;
1487  cf->cfParDeg = naParDeg;
1488 
1489  cf->iNumberOfParameters = rVar(R);
1490  cf->pParameterNames = (const char**)R->names;
1491  cf->cfParameter = naParameter;
1492  cf->has_simple_Inverse= R->cf->has_simple_Inverse;
1493  /* cf->has_simple_Alloc= FALSE; */
1494 
1495  if( nCoeff_is_Q(R->cf) )
1496  {
1497  cf->cfClearContent = naClearContent;
1498  cf->cfClearDenominators = naClearDenominators;
1499  }
1500 
1501  return FALSE;
1502 }
void naDelete(number *a, const coeffs cf)
Definition: algext.cc:285
ring r
Definition: algext.h:40
BOOLEAN naIsZero(number a, const coeffs cf)
Definition: algext.cc:279
char * naCoeffName(const coeffs r)
Definition: algext.cc:1363
#define FALSE
Definition: auxiliary.h:95
number naChineseRemainder(number *x, number *q, int rl, BOOLEAN, CFArray &inv_cache, const coeffs cf)
Definition: algext.cc:1386
void naKillChar(coeffs cf)
Definition: algext.cc:1334
void naPower(number a, int exp, number *b, const coeffs cf)
Definition: algext.cc:501
number naSub(number a, number b, const coeffs cf)
Definition: algext.cc:455
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
const char * naRead(const char *s, number *a, const coeffs cf)
Definition: algext.cc:614
nMapFunc naSetMap(const coeffs src, const coeffs dst)
Get a mapping function from src into the domain of this type (n_algExt)
Definition: algext.cc:1030
number naInit(long i, const coeffs cf)
Definition: algext.cc:346
#define TRUE
Definition: auxiliary.h:99
number naParameter(const int iParameter, const coeffs cf)
return the specified parameter as a number in the given alg. field
Definition: algext.cc:1091
long naInt(number &a, const coeffs cf)
Definition: algext.cc:352
BOOLEAN naGreater(number a, number b, const coeffs cf)
Definition: algext.cc:365
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:840
char * naCoeffString(const coeffs r)
Definition: algext.cc:1340
static BOOLEAN naCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
Definition: algext.cc:687
static BOOLEAN rCanShortOut(const ring r)
Definition: ring.h:574
int naParDeg(number a, const coeffs cf)
Definition: algext.cc:1083
(poly), see algext.h
Definition: coeffs.h:113
BOOLEAN naGreaterZero(number a, const coeffs cf)
forward declarations
Definition: algext.cc:385
number naFarey(number p, number n, const coeffs cf)
Definition: algext.cc:1398
int naSize(number a, const coeffs cf)
Definition: algext.cc:721
BOOLEAN naEqual(number a, number b, const coeffs cf)
Definition: algext.cc:294
number naConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
Definition: algext.cc:763
number naDiv(number a, number b, const coeffs cf)
Definition: algext.cc:477
number naGetDenom(number &a, const coeffs cf)
Definition: algext.cc:316
BOOLEAN naDBTest(number a, const char *f, const int l, const coeffs r)
Definition: algext.cc:240
#define assume(x)
Definition: mod2.h:403
const ring R
Definition: DebugPrint.cc:36
number naMult(number a, number b, const coeffs cf)
Definition: algext.cc:466
void naWriteLong(number a, const coeffs cf)
Definition: algext.cc:578
#define IDELEMS(i)
Definition: simpleideals.h:24
number naInvers(number a, const coeffs cf)
Definition: algext.cc:831
void naCoeffWrite(const coeffs cf, BOOLEAN details)
Definition: algext.cc:394
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:425
#define p_Test(p, r)
Definition: p_polys.h:160
number naLcmContent(number a, number b, const coeffs cf)
Definition: algext.cc:652
#define naMinpoly
Definition: algext.cc:77
#define NULL
Definition: omList.c:10
number naAdd(number a, number b, const coeffs cf)
Definition: algext.cc:444
struct for passing initialization parameters to naInitChar
Definition: algext.h:40
CanonicalForm naConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
Definition: algext.cc:769
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
Definition: coeffs.h:36
number naCopy(number a, const coeffs cf)
Definition: algext.cc:303
number naGcd(number a, number b, const coeffs cf)
Definition: algext.cc:783
void naClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: algext.cc:1117
void naClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: algext.cc:1318
number naNeg(number a, const coeffs cf)
this is in-place, modifies a
Definition: algext.cc:339
#define naRing
Definition: algext.cc:68
polyrec * poly
Definition: hilb.h:10
BOOLEAN naIsOne(number a, const coeffs cf)
Definition: algext.cc:322
BOOLEAN naIsMOne(number a, const coeffs cf)
Definition: algext.cc:330
void naWriteShort(number a, const coeffs cf)
Definition: algext.cc:596
void naNormalize(number &a, const coeffs cf)
Definition: algext.cc:755
number naGetNumerator(number &a, const coeffs cf)
Definition: algext.cc:311

§ naIsParam()

int naIsParam ( number  ,
const coeffs   
)

if m == var(i)/1 => return i,

Definition at line 1106 of file algext.cc.

1107 {
1109 
1110  const ring R = cf->extRing;
1111  assume( R != NULL );
1112 
1113  return p_Var( (poly)m, R );
1114 }
#define assume(x)
Definition: mod2.h:403
const ring R
Definition: DebugPrint.cc:36
int m
Definition: cfEzgcd.cc:119
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:425
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define NULL
Definition: omList.c:10
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
Definition: coeffs.h:36
polyrec * poly
Definition: hilb.h:10
int p_Var(poly m, const ring r)
Definition: p_polys.cc:4464
used to represent polys as coeffcients
Definition: coeffs.h:35

§ naSetMap()

nMapFunc naSetMap ( const coeffs  src,
const coeffs  dst 
)

Get a mapping function from src into the domain of this type (n_algExt)

Q or Z –> Q(a)

Z –> Q(a)

Z/p –> Q(a)

Q –> Z/p(a)

Z –> Z/p(a)

Z/p –> Z/p(a)

Z/u –> Z/p(a)

default

Definition at line 1030 of file algext.cc.

1031 {
1032  /* dst is expected to be an algebraic field extension */
1033  assume(getCoeffType(dst) == n_algExt);
1034 
1035  if( src == dst ) return ndCopyMap;
1036 
1037  int h = 0; /* the height of the extension tower given by dst */
1038  coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */
1039  coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
1040 
1041  /* for the time being, we only provide maps if h = 1 or 0 */
1042  if (h==0)
1043  {
1044  if ((src->rep==n_rep_gap_rat) && nCoeff_is_Q(bDst))
1045  return naMap00; /// Q or Z --> Q(a)
1046  if ((src->rep==n_rep_gap_gmp) && nCoeff_is_Q(bDst))
1047  return naMapZ0; /// Z --> Q(a)
1048  if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
1049  return naMapP0; /// Z/p --> Q(a)
1050  if (nCoeff_is_Q_or_BI(src) && nCoeff_is_Zp(bDst))
1051  return naMap0P; /// Q --> Z/p(a)
1052  if ((src->rep==n_rep_gap_gmp) && nCoeff_is_Zp(bDst))
1053  return naMapZ0; /// Z --> Z/p(a)
1054  if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
1055  {
1056  if (src->ch == dst->ch) return naMapPP; /// Z/p --> Z/p(a)
1057  else return naMapUP; /// Z/u --> Z/p(a)
1058  }
1059  }
1060  if (h != 1) return NULL;
1061  if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL;
1062  if ((!nCoeff_is_Zp(bSrc)) && (!nCoeff_is_Q_or_BI(bSrc))) return NULL;
1063 
1064  nMapFunc nMap=n_SetMap(src->extRing->cf,dst->extRing->cf);
1065  if (rSamePolyRep(src->extRing, dst->extRing) && (strcmp(rRingVar(0, src->extRing), rRingVar(0, dst->extRing)) == 0))
1066  {
1067  if (src->type==n_algExt)
1068  return ndCopyMap; // naCopyMap; /// K(a) --> K(a)
1069  else
1070  return naCopyTrans2AlgExt;
1071  }
1072  else if ((nMap!=NULL) && (strcmp(rRingVar(0,src->extRing),rRingVar(0,dst->extRing))==0) && (rVar (src->extRing) == rVar (dst->extRing)))
1073  {
1074  if (src->type==n_algExt)
1075  return naGenMap; // naCopyMap; /// K(a) --> K'(a)
1076  else
1077  return naGenTrans2AlgExt;
1078  }
1079 
1080  return NULL; /// default
1081 }
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition: coeffs.h:834
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
Definition: numbers.cc:244
number naMapZ0(number a, const coeffs src, const coeffs dst)
Definition: algext.cc:871
static FORCE_INLINE BOOLEAN nCoeff_is_Q_or_BI(const coeffs r)
Definition: coeffs.h:843
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
(), see rinteger.h, new impl.
Definition: coeffs.h:112
number naMap00(number a, const coeffs src, const coeffs dst)
Definition: algext.cc:861
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:840
number naMapP0(number a, const coeffs src, const coeffs dst)
Definition: algext.cc:883
number naCopyTrans2AlgExt(number a, const coeffs src, const coeffs dst)
Definition: algext.cc:903
number naMapPP(number a, const coeffs src, const coeffs dst)
Definition: algext.cc:964
#define assume(x)
Definition: mod2.h:403
The main handler for Singular numbers which are suitable for Singular polynomials.
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
number naGenMap(number a, const coeffs cf, const coeffs dst)
Definition: algext.cc:985
number naGenTrans2AlgExt(number a, const coeffs cf, const coeffs dst)
Definition: algext.cc:1000
BOOLEAN rSamePolyRep(ring r1, ring r2)
returns TRUE, if r1 and r2 represents the monomials in the same way FALSE, otherwise this is an analo...
Definition: ring.cc:1675
static char * rRingVar(short i, const ring r)
Definition: ring.h:565
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:725
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:425
static coeffs nCoeff_bottom(const coeffs r, int &height)
Definition: algext.cc:265
(number), see longrat.h
Definition: coeffs.h:111
#define NULL
Definition: omList.c:10
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
Definition: coeffs.h:36
number naMap0P(number a, const coeffs src, const coeffs dst)
Definition: algext.cc:951
number naMapUP(number a, const coeffs src, const coeffs dst)
Definition: algext.cc:974
static Poly * h
Definition: janet.cc:978

§ p_ExtGcd()

poly p_ExtGcd ( poly  p,
poly pFactor,
poly  q,
poly qFactor,
ring  r 
)

assumes that p and q are univariate polynomials in r, mentioning the same variable; assumes a global monomial ordering in r; assumes that not both p and q are NULL; returns the gcd of p and q; moreover, afterwards pFactor and qFactor contain appropriate factors such that gcd(p, q) = p * pFactor + q * qFactor; leaves p and q unmodified

Definition at line 223 of file algext.cc.

224 {
225  assume((p != NULL) || (q != NULL));
226  poly a = p; poly b = q; BOOLEAN aCorrespondsToP = TRUE;
227  if (p_Deg(a, r) < p_Deg(b, r))
228  { a = q; b = p; aCorrespondsToP = FALSE; }
229  a = p_Copy(a, r); b = p_Copy(b, r);
230  poly aFactor = NULL; poly bFactor = NULL;
231  poly theGcd = p_ExtGcdHelper(a, aFactor, b, bFactor, r);
232  if (aCorrespondsToP) { pFactor = aFactor; qFactor = bFactor; }
233  else { pFactor = bFactor; qFactor = aFactor; }
234  return theGcd;
235 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:95
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:99
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:804
static poly p_ExtGcdHelper(poly &p, poly &pFactor, poly &q, poly &qFactor, ring r)
Definition: algext.cc:190
long p_Deg(poly a, const ring r)
Definition: p_polys.cc:586
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:403
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:86
const poly b
Definition: syzextra.cc:213