My Project
Loading...
Searching...
No Matches
Data Structures | Functions
transext.h File Reference
#include "coeffs/coeffs.h"
#include "polys/monomials/ring.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...
 
poly gcd_over_Q (poly f, poly g, const ring r)
 helper routine for calling singclap_gcd_r More...
 

Data Structure Documentation

◆ TransExtInfo

struct TransExtInfo

struct for passing initialization parameters to naInitChar

Definition at line 88 of file transext.h.

Data Fields
ring r

Function Documentation

◆ gcd_over_Q()

poly gcd_over_Q ( poly  f,
poly  g,
const ring  r 
)

helper routine for calling singclap_gcd_r

Definition at line 275 of file transext.cc.

276{
277 poly res;
278 f=p_Copy(f,r);
279 p_Cleardenom(f, r);
280 g=p_Copy(g,r);
281 p_Cleardenom(g, r);
283 p_Delete(&f, r);
284 p_Delete(&g, r);
285 return res;
286}
g
Definition: cfModGcd.cc:4090
FILE * f
Definition: checklibs.c:9
poly singclap_gcd_r(poly f, poly g, const ring r)
Definition: clapsing.cc:68
CanonicalForm res
Definition: facAbsFact.cc:60
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2845
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:899
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:844

◆ ntDiff()

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

Definition at line 897 of file transext.cc.

898{
899 //check_N(a,cf);
900 //check_N(d,cf);
901 ntTest(a);
902 ntTest(d);
903
904 if (IS0(d))
905 {
906 WerrorS("ringvar expected");
907 return NULL;
908 }
909 fraction t = (fraction) d;
910 if (!DENIS1(t))
911 {
912 WerrorS("expected differentiation by a variable");
913 return NULL;
914 }
915 int k=p_Var(NUM(t),ntRing);
916 if (k==0)
917 {
918 WerrorS("expected differentiation by a variable");
919 return NULL;
920 }
921
922 if (IS0(a)) return ntCopy(a, cf);
923
924 fraction fa = (fraction)a;
925 fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
926 if (DENIS1(fa))
927 {
928 NUM(result) = p_Diff(NUM(fa),k,ntRing);
929 //DEN(result) = NULL; // done by ..Alloc0..
930 if (NUM(result)==NULL)
931 {
933 return(NULL);
934 }
936 //check_N((number)result,cf);
937 ntTest((number)result);
938 return (number)result;
939 }
940
941 poly fg = p_Mult_q(p_Copy(DEN(fa),ntRing),p_Diff(NUM(fa),k,ntRing),ntRing);
942 poly gf = p_Mult_q(p_Copy(NUM(fa),ntRing),p_Diff(DEN(fa),k,ntRing),ntRing);
943 NUM(result) = p_Sub(fg,gf,ntRing);
944 if (NUM(result)==NULL) return(NULL);
945 DEN(result) = pp_Mult_qq(DEN(fa), DEN(fa), ntRing);
948
949 //check_N((number)result,cf);
950 ntTest((number)result);
951 return (number)result;
952}
void * ADDRESS
Definition: auxiliary.h:119
int k
Definition: cfEzgcd.cc:99
CanonicalForm cf
Definition: cfModGcd.cc:4083
static BOOLEAN fa(leftv res, leftv args)
Definition: cohomo.cc:3764
return result
Definition: facAbsBiFact.cc:75
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
#define NULL
Definition: omList.c:12
poly p_Diff(poly a, int k, const ring r)
Definition: p_polys.cc:1898
int p_Var(poly m, const ring r)
Definition: p_polys.cc:4656
poly p_Sub(poly p1, poly p2, const ring r)
Definition: p_polys.cc:1990
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1112
static poly pp_Mult_qq(poly p, poly q, const ring r)
Definition: p_polys.h:1149
static void heuristicGcdCancellation(number a, const coeffs cf)
forward declarations
Definition: transext.cc:1398
#define ntRing
Definition: transext.cc:80
#define COM(f)
Definition: transext.cc:69
static number ntCopy(number a, const coeffs cf)
Definition: transext.cc:372
#define ntTest(a)
Definition: transext.cc:76
VAR omBin fractionObjectBin
Definition: transext.cc:89
#define DIFF_COMPLEXITY
complexity increase due to diff
Definition: transext.cc:63

◆ ntInitChar()

BOOLEAN ntInitChar ( coeffs  cf,
void *  infoStruct 
)

Initialize the coeffs object.

Definition at line 2636 of file transext.cc.

2637{
2638
2639 assume( infoStruct != NULL );
2640
2641 TransExtInfo *e = (TransExtInfo *)infoStruct;
2642
2643 assume( e->r != NULL); // extRing;
2644 assume( e->r->cf != NULL); // extRing->cf;
2645 assume( e->r->qideal == NULL );
2646
2647 assume( cf != NULL );
2648 assume(getCoeffType(cf) == n_transExt); // coeff type;
2649
2650 ring R = e->r;
2651 assume(R != NULL);
2652
2653 rIncRefCnt(R); // increase the ref.counter for the ground poly. ring!
2654
2655 cf->extRing = R;
2656 /* propagate characteristic up so that it becomes
2657 directly accessible in cf: */
2658 cf->ch = R->cf->ch;
2659
2660 cf->is_field=TRUE;
2661 cf->is_domain=TRUE;
2662 cf->rep=n_rep_rat_fct;
2663
2664 cf->factoryVarOffset = R->cf->factoryVarOffset + rVar(R);
2665
2666 cf->cfCoeffName = naCoeffName; // FIXME? TODO? // extern char* naCoeffString(const coeffs r);
2667
2668 cf->cfGreaterZero = ntGreaterZero;
2669 cf->cfGreater = ntGreater;
2670 cf->cfEqual = ntEqual;
2671 cf->cfIsZero = ntIsZero;
2672 cf->cfIsOne = ntIsOne;
2673 cf->cfIsMOne = ntIsMOne;
2674 cf->cfInit = ntInit;
2675 cf->cfFarey = ntFarey;
2676 cf->cfChineseRemainder = ntChineseRemainder;
2677 cf->cfInt = ntInt;
2678 cf->cfAdd = ntAdd;
2679 cf->cfInpAdd = ntInpAdd;
2680 cf->cfInpNeg = ntNeg;
2681 cf->cfSub = ntSub;
2682 cf->cfMult = ntMult;
2683 cf->cfInpMult = ntInpMult;
2684 cf->cfDiv = ntDiv;
2685 cf->cfExactDiv = ntExactDiv;
2686 cf->cfPower = ntPower;
2687 cf->cfCopy = ntCopy;
2688 cf->cfWriteLong = ntWriteLong;
2689 cf->cfRead = ntRead;
2690 cf->cfNormalize = ntNormalize;
2691 cf->cfDelete = ntDelete;
2692 cf->cfSetMap = ntSetMap;
2693 cf->cfGetDenom = ntGetDenom;
2694 cf->cfGetNumerator = ntGetNumerator;
2695 //cf->cfRePart = ntCopy;
2696 //cf->cfImPart = ntImPart;
2697 cf->cfCoeffWrite = ntCoeffWrite;
2698#ifdef LDEBUG
2699 cf->cfDBTest = ntDBTest;
2700#endif
2701 //cf->cfGcd = ntGcd_dummy;
2702 cf->cfSubringGcd = ntGcd;
2703 cf->cfNormalizeHelper = ntNormalizeHelper;
2704 cf->cfSize = ntSize;
2705 cf->nCoeffIsEqual = ntCoeffIsEqual;
2706 cf->cfInvers = ntInvers;
2707 cf->cfKillChar = ntKillChar;
2708 cf->cfInitMPZ = ntInitMPZ;
2709 cf->cfMPZ = ntMPZ;
2710
2711 if( rCanShortOut(ntRing) )
2712 cf->cfWriteShort = ntWriteShort;
2713 else
2714 cf->cfWriteShort = ntWriteLong;
2715
2716 cf->convFactoryNSingN =ntConvFactoryNSingN;
2717 cf->convSingNFactoryN =ntConvSingNFactoryN;
2718 cf->cfParDeg = ntParDeg;
2719
2720 cf->iNumberOfParameters = rVar(R);
2721 cf->pParameterNames = (const char**)R->names;
2722 cf->cfParameter = ntParameter;
2723 cf->has_simple_Inverse= FALSE;
2724 /* cf->has_simple_Alloc= FALSE; */
2725
2726
2727 if( nCoeff_is_Q(R->cf) )
2728 cf->cfClearContent = ntClearContent;
2729
2730 cf->cfClearDenominators = ntClearDenominators;
2731
2732 return FALSE;
2733}
char * naCoeffName(const coeffs r)
Definition: algext.cc:1345
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:38
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:803
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:422
@ n_rep_rat_fct
(fraction), see transext.h
Definition: coeffs.h:114
#define assume(x)
Definition: mod2.h:389
static ring rIncRefCnt(ring r)
Definition: ring.h:837
static BOOLEAN rCanShortOut(const ring r)
Definition: ring.h:586
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:592
#define R
Definition: sirandom.c:27
static int ntSize(number a, const coeffs cf)
Definition: transext.cc:1903
static BOOLEAN ntDBTest(number a, const char *f, const int l, const coeffs r)
Definition: transext.cc:140
static number ntParameter(const int iParameter, const coeffs cf)
return the specified parameter as a number in the given trans.ext.
Definition: transext.cc:2286
static void ntWriteLong(number a, const coeffs cf)
Definition: transext.cc:1641
static BOOLEAN ntCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
Definition: transext.cc:1727
static const char * ntRead(const char *s, number *a, const coeffs cf)
Definition: transext.cc:1691
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:2170
static number ntSub(number a, number b, const coeffs cf)
Definition: transext.cc:1034
static long ntInt(number &a, const coeffs cf)
Definition: transext.cc:773
static void ntDelete(number *a, const coeffs cf)
Definition: transext.cc:313
static BOOLEAN ntIsOne(number a, const coeffs cf)
Definition: transext.cc:669
static BOOLEAN ntIsZero(number a, const coeffs cf)
Definition: transext.cc:306
static number ntGetNumerator(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:506
static CanonicalForm ntConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
Definition: transext.cc:2268
static void ntClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2427
static BOOLEAN ntIsMOne(number a, const coeffs cf)
Definition: transext.cc:678
static void ntMPZ(mpz_t m, number &n, const coeffs r)
Definition: transext.cc:2619
static void ntCoeffWrite(const coeffs cf, BOOLEAN details)
Definition: transext.cc:856
static number ntGcd(number a, number b, const coeffs cf)
Definition: transext.cc:1830
static number ntConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
Definition: transext.cc:2256
static void ntClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2334
static number ntInvers(number a, const coeffs cf)
Definition: transext.cc:1270
static number ntNormalizeHelper(number a, number b, const coeffs cf)
Definition: transext.cc:1749
static void ntPower(number a, int exp, number *b, const coeffs cf)
Definition: transext.cc:1336
number ntInit(long i, const coeffs cf)
Definition: transext.cc:704
static number ntGetDenom(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:567
static void ntInpMult(number &a, number b, const coeffs cf)
Definition: transext.cc:1141
static void ntKillChar(coeffs cf)
Definition: transext.cc:2250
static void ntInpAdd(number &a, number b, const coeffs cf)
Definition: transext.cc:995
static void ntWriteShort(number a, const coeffs cf)
Definition: transext.cc:1666
static number ntDiv(number a, number b, const coeffs cf)
Definition: transext.cc:1224
static int ntParDeg(number a, const coeffs cf)
Definition: transext.cc:2277
static BOOLEAN ntGreaterZero(number a, const coeffs cf)
Definition: transext.cc:796
static number ntChineseRemainder(number *x, number *q, int rl, BOOLEAN, CFArray &inv_cache, const coeffs cf)
Definition: transext.cc:2571
static number ntMult(number a, number b, const coeffs cf)
Definition: transext.cc:1073
static number ntNeg(number a, const coeffs cf)
this is in-place, modifies a
Definition: transext.cc:691
static number ntAdd(number a, number b, const coeffs cf)
Definition: transext.cc:954
static number ntFarey(number p, number n, const coeffs cf)
Definition: transext.cc:2601
static void ntNormalize(number &a, const coeffs cf)
Definition: transext.cc:1701
static BOOLEAN ntEqual(number a, number b, const coeffs cf)
Definition: transext.cc:326
static BOOLEAN ntGreater(number a, number b, const coeffs cf)
Definition: transext.cc:806
static number ntExactDiv(number a, number b, const coeffs cf)
Definition: transext.cc:1719
static number ntInitMPZ(mpz_t m, const coeffs r)
Definition: transext.cc:2611
struct for passing initialization parameters to naInitChar
Definition: transext.h:88

◆ ntIsParam()

int ntIsParam ( number  m,
const  coeffs 
)

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

Definition at line 2308 of file transext.cc.

2309{
2310 ntTest(m);
2312
2313 const ring R = cf->extRing;
2314 assume( R != NULL );
2315
2316 fraction f = (fraction)m;
2317
2318 if( DEN(f) != NULL )
2319 return 0;
2320
2321 return p_Var( NUM(f), R );
2322}
int m
Definition: cfEzgcd.cc:128

◆ 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)

Z/p --> Z/p(T)

K(T') --> K(T)

K(T') --> K'(T)

K(T') --> K(T)

K(T') --> K'(T)

default

Definition at line 2170 of file transext.cc.

2171{
2172 /* dst is expected to be a rational function field */
2174
2175 int h = 0; /* the height of the extension tower given by dst */
2176 coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */
2177 coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
2178
2179 /* for the time being, we only provide maps if h = 1 and if b is Q or
2180 some field Z/pZ: */
2181 if (h==0)
2182 {
2183 if (((src->rep==n_rep_gap_rat) || (src->rep==n_rep_gap_gmp))
2184 && (nCoeff_is_Q(dst->extRing->cf) || nCoeff_is_Z(dst->extRing->cf)))
2185 return ntMap00; /// Q or Z --> Q(T)
2186 if (src->rep==n_rep_gmp)
2187 return ntMapZ0; /// Z --> K(T)
2188 if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
2189 return ntMapP0; /// Z/p --> Q(T)
2190 if (nCoeff_is_Q_or_BI(src) && nCoeff_is_Zp(bDst))
2191 return ntMap0P; /// Q --> Z/p(T)
2192 if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
2193 {
2194 if (src->ch == dst->ch) return ntMapPP; /// Z/p --> Z/p(T)
2195 else return ntMapUP; /// Z/u --> Z/p(T)
2196 }
2197 if (nCoeff_is_Zn(src) && nCoeff_is_Zn(bDst))
2198 {
2199 if (mpz_cmp(src->modNumber,bDst->modNumber)==0) return ntMapPP; /// Z/p --> Z/p(T)
2200 }
2201 }
2202 if (h != 1) return NULL;
2203 //if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL;
2204
2205 /* Let T denote the sequence of transcendental extension variables, i.e.,
2206 K[t_1, ..., t_s] =: K[T];
2207 Let moreover, for any such sequence T, T' denote any subsequence of T
2208 of the form t_1, ..., t_w with w <= s. */
2209
2210 if (rVar(src->extRing) > rVar(dst->extRing))
2211 return NULL;
2212
2213 for (int i = 0; i < rVar(src->extRing); i++)
2214 if (strcmp(rRingVar(i, src->extRing), rRingVar(i, dst->extRing)) != 0)
2215 return NULL;
2216
2217 if (src->type==n_transExt)
2218 {
2219 if (src->extRing->cf==dst->extRing->cf)
2220 return ntCopyMap; /// K(T') --> K(T)
2221 else
2222 return ntGenMap; /// K(T') --> K'(T)
2223 }
2224 else
2225 {
2226 if (src->extRing->cf==dst->extRing->cf)
2227 return ntCopyAlg; /// K(T') --> K(T)
2228 else
2229 return ntGenAlg; /// K(T') --> K'(T)
2230 }
2231
2232 return NULL; /// default
2233}
int i
Definition: cfEzgcd.cc:132
static FORCE_INLINE BOOLEAN nCoeff_is_Z(const coeffs r)
Definition: coeffs.h:813
static FORCE_INLINE BOOLEAN nCoeff_is_Q_or_BI(const coeffs r)
Definition: coeffs.h:826
static FORCE_INLINE BOOLEAN nCoeff_is_Zn(const coeffs r)
Definition: coeffs.h:823
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition: coeffs.h:797
@ n_rep_gap_rat
(number), see longrat.h
Definition: coeffs.h:111
@ n_rep_gap_gmp
(), see rinteger.h, new impl.
Definition: coeffs.h:112
@ n_rep_gmp
(mpz_ptr), see rmodulon,h
Definition: coeffs.h:115
STATIC_VAR Poly * h
Definition: janet.cc:971
The main handler for Singular numbers which are suitable for Singular polynomials.
static char * rRingVar(short i, const ring r)
Definition: ring.h:577
static number ntCopyAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:2092
static number ntMapPP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2133
static number ntMapZ0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1954
static number ntMap0P(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2109
static number ntMapP0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1968
static number ntMapUP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2148
static number ntGenMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:2013
static number ntMap00(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1930
static number ntGenAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:2099
static number ntCopyMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1984
static coeffs nCoeff_bottom(const coeffs r, int &height)
Definition: transext.cc:292