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

§ TransExtInfo

struct TransExtInfo

struct for passing initialization parameters to naInitChar

Definition at line 92 of file transext.h.

Data Fields
ring r

Function Documentation

§ ntDiff()

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

Definition at line 811 of file transext.cc.

812 {
813  //check_N(a,cf);
814  //check_N(d,cf);
815  ntTest(a);
816  ntTest(d);
817 
818  if (IS0(d))
819  {
820  WerrorS("ringvar expected");
821  return NULL;
822  }
823  fraction t = (fraction) d;
824  if (!DENIS1(t))
825  {
826  WerrorS("expected differentiation by a variable");
827  return NULL;
828  }
829  int k=p_Var(NUM(t),ntRing);
830  if (k==0)
831  {
832  WerrorS("expected differentiation by a variable");
833  return NULL;
834  }
835 
836  if (IS0(a)) return ntCopy(a, cf);
837 
838  fraction fa = (fraction)a;
839  fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
840  if (DENIS1(fa))
841  {
842  NUM(result) = p_Diff(NUM(fa),k,ntRing);
843  //DEN(result) = NULL; // done by ..Alloc0..
844  if (NUM(result)==NULL)
845  {
847  return(NULL);
848  }
849  COM(result) = COM(fa);
850  //check_N((number)result,cf);
851  ntTest((number)result);
852  return (number)result;
853  }
854 
855  poly fg = p_Mult_q(p_Copy(DEN(fa),ntRing),p_Diff(NUM(fa),k,ntRing),ntRing);
856  poly gf = p_Mult_q(p_Copy(NUM(fa),ntRing),p_Diff(DEN(fa),k,ntRing),ntRing);
857  NUM(result) = p_Sub(fg,gf,ntRing);
858  if (NUM(result)==NULL) return(NULL);
859  DEN(result) = pp_Mult_qq(DEN(fa), DEN(fa), ntRing);
860  COM(result) = COM(fa) + COM(fa) + DIFF_COMPLEXITY;
861  heuristicGcdCancellation((number)result, cf);
862 
863  //check_N((number)result,cf);
864  ntTest((number)result);
865  return (number)result;
866 }
poly p_Diff(poly a, int k, const ring r)
Definition: p_polys.cc:1819
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:115
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:1911
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:804
static poly pp_Mult_qq(poly p, poly q, const ring r)
Definition: p_polys.h:1070
number ntCopy(number a, const coeffs cf)
Definition: transext.cc:391
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
void heuristicGcdCancellation(number a, const coeffs cf)
Definition: transext.cc:1278
#define NULL
Definition: omList.c:10
Definition: readcf.cc:156
#define ntRing
Definition: transext.cc:81
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:4464
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1020
return result
Definition: facAbsBiFact.cc:76
omBin fractionObjectBin
Definition: transext.cc:90

§ ntInitChar()

BOOLEAN ntInitChar ( coeffs  cf,
void *  infoStruct 
)

Initialize the coeffs object.

Definition at line 2536 of file transext.cc.

2537 {
2538 
2539  assume( infoStruct != NULL );
2540 
2541  TransExtInfo *e = (TransExtInfo *)infoStruct;
2542 
2543  assume( e->r != NULL); // extRing;
2544  assume( e->r->cf != NULL); // extRing->cf;
2545  assume( e->r->qideal == NULL );
2546 
2547  assume( cf != NULL );
2548  assume(getCoeffType(cf) == n_transExt); // coeff type;
2549 
2550  ring R = e->r;
2551  assume(R != NULL);
2552 
2553  R->ref ++; // increase the ref.counter for the ground poly. ring!
2554 
2555  cf->extRing = R;
2556  /* propagate characteristic up so that it becomes
2557  directly accessible in cf: */
2558  cf->ch = R->cf->ch;
2559 
2560  cf->is_field=TRUE;
2561  cf->is_domain=TRUE;
2562  cf->rep=n_rep_rat_fct;
2563 
2564  cf->factoryVarOffset = R->cf->factoryVarOffset + rVar(R);
2565 
2566  cf->cfCoeffString = naCoeffString; // FIXME? TODO? // extern char* naCoeffString(const coeffs r);
2567  cf->cfCoeffName = naCoeffName; // FIXME? TODO? // extern char* naCoeffString(const coeffs r);
2568 
2569  cf->cfGreaterZero = ntGreaterZero;
2570  cf->cfGreater = ntGreater;
2571  cf->cfEqual = ntEqual;
2572  cf->cfIsZero = ntIsZero;
2573  cf->cfIsOne = ntIsOne;
2574  cf->cfIsMOne = ntIsMOne;
2575  cf->cfInit = ntInit;
2576  cf->cfFarey = ntFarey;
2577  cf->cfChineseRemainder = ntChineseRemainder;
2578  cf->cfInt = ntInt;
2579  cf->cfInpNeg = ntNeg;
2580  cf->cfAdd = ntAdd;
2581  cf->cfSub = ntSub;
2582  cf->cfMult = ntMult;
2583  cf->cfDiv = ntDiv;
2584  cf->cfExactDiv = ntDiv;
2585  cf->cfPower = ntPower;
2586  cf->cfCopy = ntCopy;
2587  cf->cfWriteLong = ntWriteLong;
2588  cf->cfRead = ntRead;
2589  cf->cfNormalize = ntNormalize;
2590  cf->cfDelete = ntDelete;
2591  cf->cfSetMap = ntSetMap;
2592  cf->cfGetDenom = ntGetDenom;
2593  cf->cfGetNumerator = ntGetNumerator;
2594  cf->cfRePart = ntCopy;
2595  cf->cfImPart = ntImPart;
2596  cf->cfCoeffWrite = ntCoeffWrite;
2597 #ifdef LDEBUG
2598  cf->cfDBTest = ntDBTest;
2599 #endif
2600  //cf->cfGcd = ntGcd_dummy;
2601  cf->cfSubringGcd = ntGcd;
2602  cf->cfNormalizeHelper = ntNormalizeHelper;
2603  cf->cfSize = ntSize;
2604  cf->nCoeffIsEqual = ntCoeffIsEqual;
2605  cf->cfInvers = ntInvers;
2606  cf->cfKillChar = ntKillChar;
2607 
2608  if( rCanShortOut(ntRing) )
2609  cf->cfWriteShort = ntWriteShort;
2610  else
2611  cf->cfWriteShort = ntWriteLong;
2612 
2613  cf->convFactoryNSingN =ntConvFactoryNSingN;
2614  cf->convSingNFactoryN =ntConvSingNFactoryN;
2615  cf->cfParDeg = ntParDeg;
2616 
2617  cf->iNumberOfParameters = rVar(R);
2618  cf->pParameterNames = (const char**)R->names;
2619  cf->cfParameter = ntParameter;
2620  cf->has_simple_Inverse= FALSE;
2621  /* cf->has_simple_Alloc= FALSE; */
2622 
2623 
2624  if( nCoeff_is_Q(R->cf) )
2625  cf->cfClearContent = ntClearContent;
2626 
2627  cf->cfClearDenominators = ntClearDenominators;
2628 
2629  return FALSE;
2630 }
long ntInt(number &a, const coeffs cf)
Definition: transext.cc:682
number ntNormalizeHelper(number a, number b, const coeffs cf)
Definition: transext.cc:1613
number ntImPart(number a, const coeffs cf)
Definition: transext.cc:607
void ntWriteLong(number a, const coeffs cf)
Definition: transext.cc:1512
void ntDelete(number *a, const coeffs cf)
Definition: transext.cc:332
char * naCoeffName(const coeffs r)
Definition: algext.cc:1363
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:39
#define FALSE
Definition: auxiliary.h:94
number ntDiv(number a, number b, const coeffs cf)
Definition: transext.cc:1044
BOOLEAN ntIsMOne(number a, const coeffs cf)
Definition: transext.cc:581
number ntMult(number a, number b, const coeffs cf)
Definition: transext.cc:949
number ntSub(number a, number b, const coeffs cf)
Definition: transext.cc:910
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
#define TRUE
Definition: auxiliary.h:98
int ntSize(number a, const coeffs cf)
Definition: transext.cc:1777
BOOLEAN ntIsZero(number a, const coeffs cf)
Definition: transext.cc:325
void ntWriteShort(number a, const coeffs cf)
Definition: transext.cc:1537
BOOLEAN ntDBTest(number a, const char *f, const int l, const coeffs r)
Definition: transext.cc:172
(fraction), see transext.h
Definition: coeffs.h:114
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:2103
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 rCanShortOut(const ring r)
Definition: ring.h:577
BOOLEAN ntIsOne(number a, const coeffs cf)
Definition: transext.cc:572
void ntNormalize(number &a, const coeffs cf)
Definition: transext.cc:1572
number ntInvers(number a, const coeffs cf)
Definition: transext.cc:1804
BOOLEAN ntGreater(number a, number b, const coeffs cf)
Definition: transext.cc:710
static int ntParDeg(number a, const coeffs cf)
Definition: transext.cc:2206
const char * ntRead(const char *s, number *a, const coeffs cf)
Definition: transext.cc:1562
static void ntClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2352
CanonicalForm ntConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
Definition: transext.cc:2197
number ntInit(long i, const coeffs cf)
Definition: transext.cc:613
#define assume(x)
Definition: mod2.h:394
number ntFarey(number p, number n, const coeffs cf)
Definition: transext.cc:2526
number ntGetDenom(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:470
const ring R
Definition: DebugPrint.cc:36
number ntNeg(number a, const coeffs cf)
this is in-place, modifies a
Definition: transext.cc:594
static BOOLEAN ntCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
Definition: transext.cc:1591
struct for passing initialization parameters to naInitChar
Definition: transext.h:92
BOOLEAN ntGreaterZero(number a, const coeffs cf)
forward declarations
Definition: transext.cc:763
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:425
number ntCopy(number a, const coeffs cf)
Definition: transext.cc:391
static void ntClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2263
#define NULL
Definition: omList.c:10
number ntAdd(number a, number b, const coeffs cf)
Definition: transext.cc:869
static number ntParameter(const int iParameter, const coeffs cf)
return the specified parameter as a number in the given trans.ext.
Definition: transext.cc:2215
BOOLEAN ntEqual(number a, number b, const coeffs cf)
Definition: transext.cc:345
void ntPower(number a, int exp, number *b, const coeffs cf)
Definition: transext.cc:1094
void ntKillChar(coeffs cf)
Definition: transext.cc:2180
number ntConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
Definition: transext.cc:2185
number ntGetNumerator(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:409
#define ntRing
Definition: transext.cc:81
number ntChineseRemainder(number *x, number *q, int rl, BOOLEAN, CFArray &inv_cache, const coeffs cf)
Definition: transext.cc:2496
number ntGcd(number a, number b, const coeffs cf)
Definition: transext.cc:1701
void ntCoeffWrite(const coeffs cf, BOOLEAN details)
Definition: transext.cc:773

§ ntIsParam()

int ntIsParam ( number  ,
const coeffs   
)

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

Definition at line 2237 of file transext.cc.

2238 {
2239  ntTest(m);
2241 
2242  const ring R = cf->extRing;
2243  assume( R != NULL );
2244 
2245  fraction f = (fraction)m;
2246 
2247  if( DEN(f) != NULL )
2248  return 0;
2249 
2250  return p_Var( NUM(f), R );
2251 }
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:39
f
Definition: cfModGcd.cc:4022
#define ntTest(a)
Definition: transext.cc:77
#define assume(x)
Definition: mod2.h:394
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
Definition: readcf.cc:156
int p_Var(poly m, const ring r)
Definition: p_polys.cc:4464

§ ntSetMap()

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

2104 {
2105  /* dst is expected to be a rational function field */
2106  assume(getCoeffType(dst) == n_transExt);
2107 
2108  if( src == dst ) return ndCopyMap;
2109 
2110  int h = 0; /* the height of the extension tower given by dst */
2111  coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */
2112  coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
2113 
2114  /* for the time being, we only provide maps if h = 1 and if b is Q or
2115  some field Z/pZ: */
2116  if (h==0)
2117  {
2118  if ((src->rep==n_rep_gap_rat) && nCoeff_is_Q(bDst))
2119  return ntMap00; /// Q or Z --> Q(T)
2120  if (src->rep==n_rep_gap_gmp)
2121  return ntMapZ0; /// Z --> K(T)
2122  if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
2123  return ntMapP0; /// Z/p --> Q(T)
2124  if (nCoeff_is_Q_or_BI(src) && nCoeff_is_Zp(bDst))
2125  return ntMap0P; /// Q --> Z/p(T)
2126  if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
2127  {
2128  if (src->ch == dst->ch) return ntMapPP; /// Z/p --> Z/p(T)
2129  else return ntMapUP; /// Z/u --> Z/p(T)
2130  }
2131  }
2132  if (h != 1) return NULL;
2133  //if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL;
2134 
2135  /* Let T denote the sequence of transcendental extension variables, i.e.,
2136  K[t_1, ..., t_s] =: K[T];
2137  Let moreover, for any such sequence T, T' denote any subsequence of T
2138  of the form t_1, ..., t_w with w <= s. */
2139 
2140  if (rVar(src->extRing) > rVar(dst->extRing))
2141  return NULL;
2142 
2143  for (int i = 0; i < rVar(src->extRing); i++)
2144  if (strcmp(rRingVar(i, src->extRing), rRingVar(i, dst->extRing)) != 0)
2145  return NULL;
2146 
2147  if (src->type==n_transExt)
2148  {
2149  if (src->extRing->cf==dst->extRing->cf)
2150  return ntCopyMap; /// K(T') --> K(T)
2151  else
2152  return ntGenMap; /// K(T') --> K'(T)
2153  }
2154  else
2155  {
2156  if (src->extRing->cf==dst->extRing->cf)
2157  return ntCopyAlg; /// K(T') --> K(T)
2158  else
2159  return ntGenAlg; /// K(T') --> K'(T)
2160  }
2161 
2162  return NULL; /// default
2163 }
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition: coeffs.h:834
number ntMap00(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1863
number ntMapUP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2081
number ntGenMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1946
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:39
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
Definition: numbers.cc:244
static FORCE_INLINE BOOLEAN nCoeff_is_Q_or_BI(const coeffs r)
Definition: coeffs.h:846
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
(), see rinteger.h, new impl.
Definition: coeffs.h:112
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:840
static coeffs nCoeff_bottom(const coeffs r, int &height)
Definition: transext.cc:311
number ntCopyMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1917
number ntMapPP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2066
#define assume(x)
Definition: mod2.h:394
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:2032
number ntMapP0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1901
int i
Definition: cfEzgcd.cc:123
static char * rRingVar(short i, const ring r)
Definition: ring.h:568
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:425
(number), see longrat.h
Definition: coeffs.h:111
#define NULL
Definition: omList.c:10
number ntMapZ0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1887
number ntMap0P(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2042
static Poly * h
Definition: janet.cc:978
number ntCopyAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:2025