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

Go to the source code of this file.

Data Structures

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

Functions

nMapFunc ntSetMap (const coeffs src, const coeffs dst)
 Get a mapping function from src into the domain of this type (n_transExt) More...
 
BOOLEAN ntInitChar (coeffs cf, void *infoStruct)
 Initialize the coeffs object. More...
 
number ntDiff (number a, number d, const coeffs cf)
 
int ntIsParam (number, const coeffs)
 if m == var(i)/1 => return i, More...
 

Data Structure Documentation

struct TransExtInfo

struct for passing initialization parameters to naInitChar

Definition at line 92 of file transext.h.

Data Fields
ring r

Function Documentation

number ntDiff ( number  a,
number  d,
const coeffs  cf 
)

Definition at line 814 of file transext.cc.

815 {
816  //check_N(a,cf);
817  //check_N(d,cf);
818  ntTest(a);
819  ntTest(d);
820 
821  if (IS0(d))
822  {
823  WerrorS("ringvar expected");
824  return NULL;
825  }
826  fraction t = (fraction) d;
827  if (!DENIS1(t))
828  {
829  WerrorS("expected differentiation by a variable");
830  return NULL;
831  }
832  int k=p_Var(NUM(t),ntRing);
833  if (k==0)
834  {
835  WerrorS("expected differentiation by a variable");
836  return NULL;
837  }
838 
839  if (IS0(a)) return ntCopy(a, cf);
840 
841  fraction fa = (fraction)a;
842  fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
843  if (DENIS1(fa))
844  {
845  NUM(result) = p_Diff(NUM(fa),k,ntRing);
846  //DEN(result) = NULL; // done by ..Alloc0..
847  if (NUM(result)==NULL)
848  {
850  return(NULL);
851  }
852  COM(result) = COM(fa);
853  //check_N((number)result,cf);
854  ntTest((number)result);
855  return (number)result;
856  }
857 
858  poly fg = p_Mult_q(p_Copy(DEN(fa),ntRing),p_Diff(NUM(fa),k,ntRing),ntRing);
859  poly gf = p_Mult_q(p_Copy(NUM(fa),ntRing),p_Diff(DEN(fa),k,ntRing),ntRing);
860  NUM(result) = p_Sub(fg,gf,ntRing);
861  if (NUM(result)==NULL) return(NULL);
862  DEN(result) = pp_Mult_qq(DEN(fa), DEN(fa), ntRing);
863  COM(result) = COM(fa) + COM(fa) + DIFF_COMPLEXITY;
864  heuristicGcdCancellation((number)result, cf);
865 
866  //check_N((number)result,cf);
867  ntTest((number)result);
868  return (number)result;
869 }
poly p_Diff(poly a, int k, const ring r)
Definition: p_polys.cc:1809
const poly a
Definition: syzextra.cc:212
#define DIFF_COMPLEXITY
complexity increase due to * and /
Definition: transext.cc:64
#define ntTest(a)
Definition: transext.cc:77
#define COM(f)
Definition: transext.cc:70
void * ADDRESS
Definition: auxiliary.h:161
void WerrorS(const char *s)
Definition: feFopen.cc:24
int k
Definition: cfEzgcd.cc:93
poly p_Sub(poly p1, poly p2, const ring r)
Definition: p_polys.cc:1901
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:810
static poly pp_Mult_qq(poly p, poly q, const ring r)
Definition: p_polys.h:1076
number ntCopy(number a, const coeffs cf)
Definition: transext.cc:394
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
void heuristicGcdCancellation(number a, const coeffs cf)
Definition: transext.cc:1281
#define NULL
Definition: omList.c:10
#define ntRing
Definition: transext.cc:84
polyrec * poly
Definition: hilb.h:10
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
int p_Var(poly m, const ring r)
Definition: p_polys.cc:4462
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1026
return result
Definition: facAbsBiFact.cc:76
omBin fractionObjectBin
Definition: transext.cc:93
BOOLEAN ntInitChar ( coeffs  cf,
void *  infoStruct 
)

Initialize the coeffs object.

Definition at line 2539 of file transext.cc.

2540 {
2541 
2542  assume( infoStruct != NULL );
2543 
2544  TransExtInfo *e = (TransExtInfo *)infoStruct;
2545 
2546  assume( e->r != NULL); // extRing;
2547  assume( e->r->cf != NULL); // extRing->cf;
2548  assume( e->r->qideal == NULL );
2549 
2550  assume( cf != NULL );
2551  assume(getCoeffType(cf) == ID); // coeff type;
2552 
2553  ring R = e->r;
2554  assume(R != NULL);
2555 
2556  R->ref ++; // increase the ref.counter for the ground poly. ring!
2557 
2558  cf->extRing = R;
2559  /* propagate characteristic up so that it becomes
2560  directly accessible in cf: */
2561  cf->ch = R->cf->ch;
2562 
2563  cf->is_field=TRUE;
2564  cf->is_domain=TRUE;
2565  cf->rep=n_rep_rat_fct;
2566 
2567  cf->factoryVarOffset = R->cf->factoryVarOffset + rVar(R);
2568 
2569  cf->cfCoeffString = naCoeffString; // FIXME? TODO? // extern char* naCoeffString(const coeffs r);
2570 
2571  cf->cfGreaterZero = ntGreaterZero;
2572  cf->cfGreater = ntGreater;
2573  cf->cfEqual = ntEqual;
2574  cf->cfIsZero = ntIsZero;
2575  cf->cfIsOne = ntIsOne;
2576  cf->cfIsMOne = ntIsMOne;
2577  cf->cfInit = ntInit;
2578  cf->cfFarey = ntFarey;
2579  cf->cfChineseRemainder = ntChineseRemainder;
2580  cf->cfInt = ntInt;
2581  cf->cfInpNeg = ntNeg;
2582  cf->cfAdd = ntAdd;
2583  cf->cfSub = ntSub;
2584  cf->cfMult = ntMult;
2585  cf->cfDiv = ntDiv;
2586  cf->cfExactDiv = ntDiv;
2587  cf->cfPower = ntPower;
2588  cf->cfCopy = ntCopy;
2589  cf->cfWriteLong = ntWriteLong;
2590  cf->cfRead = ntRead;
2591  cf->cfNormalize = ntNormalize;
2592  cf->cfDelete = ntDelete;
2593  cf->cfSetMap = ntSetMap;
2594  cf->cfGetDenom = ntGetDenom;
2595  cf->cfGetNumerator = ntGetNumerator;
2596  cf->cfRePart = ntCopy;
2597  cf->cfImPart = ntImPart;
2598  cf->cfCoeffWrite = ntCoeffWrite;
2599 #ifdef LDEBUG
2600  cf->cfDBTest = ntDBTest;
2601 #endif
2602  //cf->cfGcd = ntGcd_dummy;
2603  cf->cfSubringGcd = ntGcd;
2604  cf->cfNormalizeHelper = ntNormalizeHelper;
2605  cf->cfSize = ntSize;
2606  cf->nCoeffIsEqual = ntCoeffIsEqual;
2607  cf->cfInvers = ntInvers;
2608  cf->cfKillChar = ntKillChar;
2609 
2610  if( rCanShortOut(ntRing) )
2611  cf->cfWriteShort = ntWriteShort;
2612  else
2613  cf->cfWriteShort = ntWriteLong;
2614 
2615  cf->convFactoryNSingN =ntConvFactoryNSingN;
2616  cf->convSingNFactoryN =ntConvSingNFactoryN;
2617  cf->cfParDeg = ntParDeg;
2618 
2619  cf->iNumberOfParameters = rVar(R);
2620  cf->pParameterNames = (const char**)R->names;
2621  cf->cfParameter = ntParameter;
2622  cf->has_simple_Inverse= FALSE;
2623  /* cf->has_simple_Alloc= FALSE; */
2624 
2625 
2626  if( nCoeff_is_Q(R->cf) )
2627  cf->cfClearContent = ntClearContent;
2628 
2629  cf->cfClearDenominators = ntClearDenominators;
2630 
2631  return FALSE;
2632 }
long ntInt(number &a, const coeffs cf)
Definition: transext.cc:685
number ntNormalizeHelper(number a, number b, const coeffs cf)
Definition: transext.cc:1616
number ntImPart(number a, const coeffs cf)
Definition: transext.cc:610
void ntWriteLong(number a, const coeffs cf)
Definition: transext.cc:1515
void ntDelete(number *a, const coeffs cf)
Definition: transext.cc:335
#define FALSE
Definition: auxiliary.h:140
number ntDiv(number a, number b, const coeffs cf)
Definition: transext.cc:1047
BOOLEAN ntIsMOne(number a, const coeffs cf)
Definition: transext.cc:584
number ntMult(number a, number b, const coeffs cf)
Definition: transext.cc:952
number ntSub(number a, number b, const coeffs cf)
Definition: transext.cc:913
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:537
#define TRUE
Definition: auxiliary.h:144
int ntSize(number a, const coeffs cf)
Definition: transext.cc:1780
BOOLEAN ntIsZero(number a, const coeffs cf)
Definition: transext.cc:328
void ntWriteShort(number a, const coeffs cf)
Definition: transext.cc:1540
BOOLEAN ntDBTest(number a, const char *f, const int l, const coeffs r)
Definition: transext.cc:175
(fraction), see transext.h
Definition: coeffs.h:113
nMapFunc ntSetMap(const coeffs src, const coeffs dst)
Get a mapping function from src into the domain of this type (n_transExt)
Definition: transext.cc:2106
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:829
char * naCoeffString(const coeffs r)
Definition: algext.cc:1346
static BOOLEAN rCanShortOut(const ring r)
Definition: ring.h:531
BOOLEAN ntIsOne(number a, const coeffs cf)
Definition: transext.cc:575
void ntNormalize(number &a, const coeffs cf)
Definition: transext.cc:1575
number ntInvers(number a, const coeffs cf)
Definition: transext.cc:1807
BOOLEAN ntGreater(number a, number b, const coeffs cf)
Definition: transext.cc:713
static int ntParDeg(number a, const coeffs cf)
Definition: transext.cc:2209
const char * ntRead(const char *s, number *a, const coeffs cf)
Definition: transext.cc:1565
static void ntClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2355
CanonicalForm ntConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
Definition: transext.cc:2200
number ntInit(long i, const coeffs cf)
Definition: transext.cc:616
#define assume(x)
Definition: mod2.h:405
number ntFarey(number p, number n, const coeffs cf)
Definition: transext.cc:2529
number ntGetDenom(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:473
const ring R
Definition: DebugPrint.cc:36
static const n_coeffType ID
Our own type!
Definition: transext.cc:80
number ntNeg(number a, const coeffs cf)
this is in-place, modifies a
Definition: transext.cc:597
static BOOLEAN ntCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
Definition: transext.cc:1594
struct for passing initialization parameters to naInitChar
Definition: transext.h:92
BOOLEAN ntGreaterZero(number a, const coeffs cf)
forward declarations
Definition: transext.cc:766
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:422
number ntCopy(number a, const coeffs cf)
Definition: transext.cc:394
static void ntClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2266
#define NULL
Definition: omList.c:10
number ntAdd(number a, number b, const coeffs cf)
Definition: transext.cc:872
static number ntParameter(const int iParameter, const coeffs cf)
return the specified parameter as a number in the given trans.ext.
Definition: transext.cc:2218
BOOLEAN ntEqual(number a, number b, const coeffs cf)
Definition: transext.cc:348
void ntPower(number a, int exp, number *b, const coeffs cf)
Definition: transext.cc:1097
void ntKillChar(coeffs cf)
Definition: transext.cc:2183
number ntConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
Definition: transext.cc:2188
number ntGetNumerator(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:412
#define ntRing
Definition: transext.cc:84
number ntChineseRemainder(number *x, number *q, int rl, BOOLEAN, CFArray &inv_cache, const coeffs cf)
Definition: transext.cc:2499
number ntGcd(number a, number b, const coeffs cf)
Definition: transext.cc:1704
void ntCoeffWrite(const coeffs cf, BOOLEAN details)
Definition: transext.cc:776
int ntIsParam ( number  ,
const coeffs   
)

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

Definition at line 2240 of file transext.cc.

2241 {
2242  ntTest(m);
2243  assume(getCoeffType(cf) == ID);
2244 
2245  const ring R = cf->extRing;
2246  assume( R != NULL );
2247 
2248  fraction f = (fraction)m;
2249 
2250  if( DEN(f) != NULL )
2251  return 0;
2252 
2253  return p_Var( NUM(f), R );
2254 }
#define ntTest(a)
Definition: transext.cc:77
#define assume(x)
Definition: mod2.h:405
const ring R
Definition: DebugPrint.cc:36
static const n_coeffType ID
Our own type!
Definition: transext.cc:80
int m
Definition: cfEzgcd.cc:119
FILE * f
Definition: checklibs.c:7
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:422
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define NULL
Definition: omList.c:10
int p_Var(poly m, const ring r)
Definition: p_polys.cc:4462
nMapFunc ntSetMap ( const coeffs  src,
const coeffs  dst 
)

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

Q or Z –> Q(T)

Z –> K(T)

Z/p –> Q(T)

Q –> Z/p(T)

Z/p –> Z/p(T)

Z/u –> Z/p(T)

K(T') –> K(T)

K(T') –> K'(T)

K(T') –> K(T)

K(T') –> K'(T)

default

Definition at line 2106 of file transext.cc.

2107 {
2108  /* dst is expected to be a rational function field */
2109  assume(getCoeffType(dst) == ID);
2110 
2111  if( src == dst ) return ndCopyMap;
2112 
2113  int h = 0; /* the height of the extension tower given by dst */
2114  coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */
2115  coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
2116 
2117  /* for the time being, we only provide maps if h = 1 and if b is Q or
2118  some field Z/pZ: */
2119  if (h==0)
2120  {
2121  if ((src->rep==n_rep_gap_rat) && nCoeff_is_Q(bDst))
2122  return ntMap00; /// Q or Z --> Q(T)
2123  if (src->rep==n_rep_gap_gmp)
2124  return ntMapZ0; /// Z --> K(T)
2125  if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
2126  return ntMapP0; /// Z/p --> Q(T)
2127  if (nCoeff_is_Q_or_BI(src) && nCoeff_is_Zp(bDst))
2128  return ntMap0P; /// Q --> Z/p(T)
2129  if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
2130  {
2131  if (src->ch == dst->ch) return ntMapPP; /// Z/p --> Z/p(T)
2132  else return ntMapUP; /// Z/u --> Z/p(T)
2133  }
2134  }
2135  if (h != 1) return NULL;
2136  //if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL;
2137 
2138  /* Let T denote the sequence of transcendental extension variables, i.e.,
2139  K[t_1, ..., t_s] =: K[T];
2140  Let moreover, for any such sequence T, T' denote any subsequence of T
2141  of the form t_1, ..., t_w with w <= s. */
2142 
2143  if (rVar(src->extRing) > rVar(dst->extRing))
2144  return NULL;
2145 
2146  for (int i = 0; i < rVar(src->extRing); i++)
2147  if (strcmp(rRingVar(i, src->extRing), rRingVar(i, dst->extRing)) != 0)
2148  return NULL;
2149 
2150  if (src->type==n_transExt)
2151  {
2152  if (src->extRing->cf==dst->extRing->cf)
2153  return ntCopyMap; /// K(T') --> K(T)
2154  else
2155  return ntGenMap; /// K(T') --> K'(T)
2156  }
2157  else
2158  {
2159  if (src->extRing->cf==dst->extRing->cf)
2160  return ntCopyAlg; /// K(T') --> K(T)
2161  else
2162  return ntGenAlg; /// K(T') --> K'(T)
2163  }
2164 
2165  return NULL; /// default
2166 }
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition: coeffs.h:823
number ntMap00(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1866
number ntMapUP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2084
number ntGenMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1949
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:38
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
Definition: numbers.cc:239
static FORCE_INLINE BOOLEAN nCoeff_is_Q_or_BI(const coeffs r)
Definition: coeffs.h:832
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:537
(), see rinteger.h, new impl.
Definition: coeffs.h:111
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:829
static coeffs nCoeff_bottom(const coeffs r, int &height)
Definition: transext.cc:314
number ntCopyMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1920
number ntMapPP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2069
#define assume(x)
Definition: mod2.h:405
The main handler for Singular numbers which are suitable for Singular polynomials.
number ntGenAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:2035
number ntMapP0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1904
static const n_coeffType ID
Our own type!
Definition: transext.cc:80
int i
Definition: cfEzgcd.cc:123
static char * rRingVar(short i, const ring r)
Definition: ring.h:522
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:422
(number), see longrat.h
Definition: coeffs.h:110
#define NULL
Definition: omList.c:10
number ntMapZ0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1890
number ntMap0P(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2045
static Poly * h
Definition: janet.cc:978
number ntCopyAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:2028