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 813 of file transext.cc.

814 {
815  //check_N(a,cf);
816  //check_N(d,cf);
817  ntTest(a);
818  ntTest(d);
819 
820  if (IS0(d))
821  {
822  WerrorS("ringvar expected");
823  return NULL;
824  }
825  fraction t = (fraction) d;
826  if (!DENIS1(t))
827  {
828  WerrorS("expected differentiation by a variable");
829  return NULL;
830  }
831  int k=p_Var(NUM(t),ntRing);
832  if (k==0)
833  {
834  WerrorS("expected differentiation by a variable");
835  return NULL;
836  }
837 
838  if (IS0(a)) return ntCopy(a, cf);
839 
840  fraction fa = (fraction)a;
841  fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
842  if (DENIS1(fa))
843  {
844  NUM(result) = p_Diff(NUM(fa),k,ntRing);
845  //DEN(result) = NULL; // done by ..Alloc0..
846  if (NUM(result)==NULL)
847  {
849  return(NULL);
850  }
851  COM(result) = COM(fa);
852  //check_N((number)result,cf);
853  ntTest((number)result);
854  return (number)result;
855  }
856 
857  poly fg = p_Mult_q(p_Copy(DEN(fa),ntRing),p_Diff(NUM(fa),k,ntRing),ntRing);
858  poly gf = p_Mult_q(p_Copy(NUM(fa),ntRing),p_Diff(DEN(fa),k,ntRing),ntRing);
859  NUM(result) = p_Sub(fg,gf,ntRing);
860  if (NUM(result)==NULL) return(NULL);
861  DEN(result) = pp_Mult_qq(DEN(fa), DEN(fa), ntRing);
862  COM(result) = COM(fa) + COM(fa) + DIFF_COMPLEXITY;
863  heuristicGcdCancellation((number)result, cf);
864 
865  //check_N((number)result,cf);
866  ntTest((number)result);
867  return (number)result;
868 }
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:23
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:811
static poly pp_Mult_qq(poly p, poly q, const ring r)
Definition: p_polys.h:1075
number ntCopy(number a, const coeffs cf)
Definition: transext.cc:393
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
void heuristicGcdCancellation(number a, const coeffs cf)
Definition: transext.cc:1255
#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:4435
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1025
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 2503 of file transext.cc.

2504 {
2505 
2506  assume( infoStruct != NULL );
2507 
2508  TransExtInfo *e = (TransExtInfo *)infoStruct;
2509 
2510  assume( e->r != NULL); // extRing;
2511  assume( e->r->cf != NULL); // extRing->cf;
2512  assume( e->r->qideal == NULL );
2513 
2514  assume( cf != NULL );
2515  assume(getCoeffType(cf) == ID); // coeff type;
2516 
2517  ring R = e->r;
2518  assume(R != NULL);
2519 
2520  R->ref ++; // increase the ref.counter for the ground poly. ring!
2521 
2522  cf->extRing = R;
2523  /* propagate characteristic up so that it becomes
2524  directly accessible in cf: */
2525  cf->ch = R->cf->ch;
2526 
2527  cf->is_field=TRUE;
2528  cf->is_domain=TRUE;
2529  cf->rep=n_rep_rat_fct;
2530 
2531  cf->factoryVarOffset = R->cf->factoryVarOffset + rVar(R);
2532 
2533  cf->cfCoeffString = naCoeffString; // FIXME? TODO? // extern char* naCoeffString(const coeffs r);
2534 
2535  cf->cfGreaterZero = ntGreaterZero;
2536  cf->cfGreater = ntGreater;
2537  cf->cfEqual = ntEqual;
2538  cf->cfIsZero = ntIsZero;
2539  cf->cfIsOne = ntIsOne;
2540  cf->cfIsMOne = ntIsMOne;
2541  cf->cfInit = ntInit;
2542  cf->cfFarey = ntFarey;
2543  cf->cfChineseRemainder = ntChineseRemainder;
2544  cf->cfInt = ntInt;
2545  cf->cfInpNeg = ntNeg;
2546  cf->cfAdd = ntAdd;
2547  cf->cfSub = ntSub;
2548  cf->cfMult = ntMult;
2549  cf->cfDiv = ntDiv;
2550  cf->cfExactDiv = ntDiv;
2551  cf->cfPower = ntPower;
2552  cf->cfCopy = ntCopy;
2553  cf->cfWriteLong = ntWriteLong;
2554  cf->cfRead = ntRead;
2555  cf->cfNormalize = ntNormalize;
2556  cf->cfDelete = ntDelete;
2557  cf->cfSetMap = ntSetMap;
2558  cf->cfGetDenom = ntGetDenom;
2559  cf->cfGetNumerator = ntGetNumerator;
2560  cf->cfRePart = ntCopy;
2561  cf->cfImPart = ntImPart;
2562  cf->cfCoeffWrite = ntCoeffWrite;
2563 #ifdef LDEBUG
2564  cf->cfDBTest = ntDBTest;
2565 #endif
2566  //cf->cfGcd = ntGcd_dummy;
2567  cf->cfSubringGcd = ntGcd;
2568  cf->cfNormalizeHelper = ntNormalizeHelper;
2569  cf->cfSize = ntSize;
2570  cf->nCoeffIsEqual = ntCoeffIsEqual;
2571  cf->cfInvers = ntInvers;
2572  cf->cfKillChar = ntKillChar;
2573 
2574  if( rCanShortOut(ntRing) )
2575  cf->cfWriteShort = ntWriteShort;
2576  else
2577  cf->cfWriteShort = ntWriteLong;
2578 
2579  cf->convFactoryNSingN =ntConvFactoryNSingN;
2580  cf->convSingNFactoryN =ntConvSingNFactoryN;
2581  cf->cfParDeg = ntParDeg;
2582 
2583  cf->iNumberOfParameters = rVar(R);
2584  cf->pParameterNames = (const char**)R->names;
2585  cf->cfParameter = ntParameter;
2586  cf->has_simple_Inverse= FALSE;
2587  /* cf->has_simple_Alloc= FALSE; */
2588 
2589 
2590  if( nCoeff_is_Q(R->cf) )
2591  cf->cfClearContent = ntClearContent;
2592 
2593  cf->cfClearDenominators = ntClearDenominators;
2594 
2595  return FALSE;
2596 }
long ntInt(number &a, const coeffs cf)
Definition: transext.cc:684
number ntNormalizeHelper(number a, number b, const coeffs cf)
Definition: transext.cc:1581
number ntImPart(number a, const coeffs cf)
Definition: transext.cc:609
void ntWriteLong(number a, const coeffs cf)
Definition: transext.cc:1481
void ntDelete(number *a, const coeffs cf)
Definition: transext.cc:334
#define FALSE
Definition: auxiliary.h:140
number ntDiv(number a, number b, const coeffs cf)
Definition: transext.cc:1022
BOOLEAN ntIsMOne(number a, const coeffs cf)
Definition: transext.cc:583
number ntMult(number a, number b, const coeffs cf)
Definition: transext.cc:951
number ntSub(number a, number b, const coeffs cf)
Definition: transext.cc:912
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
#define TRUE
Definition: auxiliary.h:144
int ntSize(number a, const coeffs cf)
Definition: transext.cc:1745
BOOLEAN ntIsZero(number a, const coeffs cf)
Definition: transext.cc:327
void ntWriteShort(number a, const coeffs cf)
Definition: transext.cc:1506
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:2070
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:824
char * naCoeffString(const coeffs r)
Definition: algext.cc:1346
static BOOLEAN rCanShortOut(const ring r)
Definition: ring.h:534
BOOLEAN ntIsOne(number a, const coeffs cf)
Definition: transext.cc:574
void ntNormalize(number &a, const coeffs cf)
Definition: transext.cc:1541
number ntInvers(number a, const coeffs cf)
Definition: transext.cc:1772
BOOLEAN ntGreater(number a, number b, const coeffs cf)
Definition: transext.cc:712
static int ntParDeg(number a, const coeffs cf)
Definition: transext.cc:2173
const char * ntRead(const char *s, number *a, const coeffs cf)
Definition: transext.cc:1531
static void ntClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2319
CanonicalForm ntConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
Definition: transext.cc:2164
number ntInit(long i, const coeffs cf)
Definition: transext.cc:615
#define assume(x)
Definition: mod2.h:405
number ntFarey(number p, number n, const coeffs cf)
Definition: transext.cc:2493
number ntGetDenom(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:472
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:596
static BOOLEAN ntCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
Definition: transext.cc:1559
struct for passing initialization parameters to naInitChar
Definition: transext.h:92
BOOLEAN ntGreaterZero(number a, const coeffs cf)
forward declarations
Definition: transext.cc:765
number ntChineseRemainder(number *x, number *q, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs cf)
Definition: transext.cc:2463
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:393
static void ntClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2230
#define NULL
Definition: omList.c:10
number ntAdd(number a, number b, const coeffs cf)
Definition: transext.cc:871
static number ntParameter(const int iParameter, const coeffs cf)
return the specified parameter as a number in the given trans.ext.
Definition: transext.cc:2182
BOOLEAN ntEqual(number a, number b, const coeffs cf)
Definition: transext.cc:347
#define R
Definition: sirandom.c:26
void ntPower(number a, int exp, number *b, const coeffs cf)
Definition: transext.cc:1071
void ntKillChar(coeffs cf)
Definition: transext.cc:2147
number ntConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
Definition: transext.cc:2152
number ntGetNumerator(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:411
#define ntRing
Definition: transext.cc:84
number ntGcd(number a, number b, const coeffs cf)
Definition: transext.cc:1669
void ntCoeffWrite(const coeffs cf, BOOLEAN details)
Definition: transext.cc:775
int ntIsParam ( number  ,
const coeffs   
)

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

Definition at line 2204 of file transext.cc.

2205 {
2206  ntTest(m);
2207  assume(getCoeffType(cf) == ID);
2208 
2209  const ring R = cf->extRing;
2210  assume( R != NULL );
2211 
2212  fraction f = (fraction)m;
2213 
2214  if( DEN(f) != NULL )
2215  return 0;
2216 
2217  return p_Var( NUM(f), R );
2218 }
#define ntTest(a)
Definition: transext.cc:77
#define assume(x)
Definition: mod2.h:405
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
#define R
Definition: sirandom.c:26
int p_Var(poly m, const ring r)
Definition: p_polys.cc:4435
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 2070 of file transext.cc.

2071 {
2072  /* dst is expected to be a rational function field */
2073  assume(getCoeffType(dst) == ID);
2074 
2075  if( src == dst ) return ndCopyMap;
2076 
2077  int h = 0; /* the height of the extension tower given by dst */
2078  coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */
2079  coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
2080 
2081  /* for the time being, we only provide maps if h = 1 and if b is Q or
2082  some field Z/pZ: */
2083  if (h==0)
2084  {
2085  if ((src->rep==n_rep_gap_rat) && nCoeff_is_Q(bDst))
2086  return ntMap00; /// Q or Z --> Q(T)
2087  if (src->rep==n_rep_gap_gmp)
2088  return ntMapZ0; /// Z --> K(T)
2089  if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
2090  return ntMapP0; /// Z/p --> Q(T)
2091  if (nCoeff_is_Q_or_BI(src) && nCoeff_is_Zp(bDst))
2092  return ntMap0P; /// Q --> Z/p(T)
2093  if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
2094  {
2095  if (src->ch == dst->ch) return ntMapPP; /// Z/p --> Z/p(T)
2096  else return ntMapUP; /// Z/u --> Z/p(T)
2097  }
2098  }
2099  if (h != 1) return NULL;
2100  //if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL;
2101 
2102  /* Let T denote the sequence of transcendental extension variables, i.e.,
2103  K[t_1, ..., t_s] =: K[T];
2104  Let moreover, for any such sequence T, T' denote any subsequence of T
2105  of the form t_1, ..., t_w with w <= s. */
2106 
2107  if (rVar(src->extRing) > rVar(dst->extRing))
2108  return NULL;
2109 
2110  for (int i = 0; i < rVar(src->extRing); i++)
2111  if (strcmp(rRingVar(i, src->extRing), rRingVar(i, dst->extRing)) != 0)
2112  return NULL;
2113 
2114  if (src->type==n_transExt)
2115  {
2116  if (src->extRing->cf==dst->extRing->cf)
2117  return ntCopyMap; /// K(T') --> K(T)
2118  else
2119  return ntGenMap; /// K(T') --> K'(T)
2120  }
2121  else
2122  {
2123  if (src->extRing->cf==dst->extRing->cf)
2124  return ntCopyAlg; /// K(T') --> K(T)
2125  else
2126  return ntGenAlg; /// K(T') --> K'(T)
2127  }
2128 
2129  return NULL; /// default
2130 }
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition: coeffs.h:818
number ntMap00(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1830
number ntMapUP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2048
number ntGenMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1913
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:827
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
(), see rinteger.h, new impl.
Definition: coeffs.h:111
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:824
static coeffs nCoeff_bottom(const coeffs r, int &height)
Definition: transext.cc:313
number ntCopyMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1884
number ntMapPP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2033
#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:1999
number ntMapP0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1868
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:525
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:1854
number ntMap0P(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2009
static Poly * h
Definition: janet.cc:978
number ntCopyAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1992