[35aab3] | 1 | #ifndef SYZ_H |
---|
| 2 | #define SYZ_H |
---|
| 3 | /**************************************** |
---|
| 4 | * Computer Algebra System SINGULAR * |
---|
| 5 | ****************************************/ |
---|
[50d54f8] | 6 | /* $Id: syz.h,v 1.4 2007-02-16 10:54:07 motsak Exp $ */ |
---|
[35aab3] | 7 | /* |
---|
| 8 | * ABSTRACT: Resolutions |
---|
| 9 | */ |
---|
| 10 | #include "structs.h" |
---|
| 11 | |
---|
| 12 | // Logarithm of estimate of maximal number of new components |
---|
| 13 | #define SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE 8 |
---|
| 14 | // Logarithm of "distance" between a new component and prev component |
---|
| 15 | #define SYZ_SHIFT_BASE_LOG (BIT_SIZEOF_LONG - 1 - SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE) |
---|
| 16 | #define SYZ_SHIFT_BASE (((long)1) << SYZ_SHIFT_BASE_LOG) |
---|
| 17 | struct sSObject{ |
---|
| 18 | poly p; |
---|
| 19 | poly p1,p2; /*- the pair p comes from -*/ |
---|
| 20 | poly lcm; /*- the lcm of p1,p2 -*/ |
---|
| 21 | poly syz; /*- the syzygy associated to p1,p2 -*/ |
---|
| 22 | int ind1,ind2; /*- the indeces of p1,p2 -*/ |
---|
| 23 | poly isNotMinimal; |
---|
| 24 | int syzind; |
---|
| 25 | int order; |
---|
| 26 | int length; |
---|
| 27 | int reference; |
---|
| 28 | }; |
---|
| 29 | typedef struct sSObject SObject; |
---|
| 30 | typedef SObject * SSet; |
---|
| 31 | typedef SSet * SRes; |
---|
| 32 | |
---|
| 33 | class ssyStrategy; |
---|
| 34 | typedef ssyStrategy * syStrategy; |
---|
| 35 | class ssyStrategy{ |
---|
| 36 | public: |
---|
| 37 | int ** truecomponents; |
---|
| 38 | long** ShiftedComponents; |
---|
| 39 | int ** backcomponents; |
---|
| 40 | int ** Howmuch; |
---|
| 41 | int ** Firstelem; |
---|
| 42 | int ** elemLength; |
---|
| 43 | intvec ** weights; |
---|
| 44 | intvec ** hilb_coeffs; |
---|
| 45 | resolvente res; //polynomial data for internal use only |
---|
| 46 | resolvente orderedRes; //polynomial data for internal use only |
---|
| 47 | SRes resPairs; //polynomial data for internal use only |
---|
| 48 | intvec * Tl; |
---|
| 49 | intvec * resolution; |
---|
| 50 | intvec * cw; |
---|
| 51 | intvec * betti; |
---|
| 52 | kBucket_pt bucket; |
---|
| 53 | kBucket_pt syz_bucket; |
---|
| 54 | ring syRing; |
---|
| 55 | resolvente fullres; |
---|
| 56 | resolvente minres; |
---|
| 57 | unsigned long ** sev; |
---|
| 58 | int length; |
---|
| 59 | int regularity; |
---|
| 60 | short list_length; |
---|
| 61 | short references; |
---|
| 62 | }; |
---|
| 63 | |
---|
| 64 | void sySchreyersSyzygiesM(polyset F,int Fmax,polyset* Shdl,int* Smax, |
---|
| 65 | BOOLEAN noSort); |
---|
| 66 | |
---|
| 67 | void sySchreyersSyzygiesB(polyset F,int Fmax,polyset* Shdl,int* Smax, |
---|
| 68 | BOOLEAN noSort); |
---|
| 69 | |
---|
| 70 | resolvente sySchreyerResolvente(ideal arg, int maxlength, int * length, |
---|
| 71 | BOOLEAN isMonomial=FALSE, BOOLEAN notReplace=FALSE); |
---|
| 72 | |
---|
| 73 | syStrategy sySchreyer(ideal arg, int maxlength); |
---|
| 74 | |
---|
| 75 | resolvente syResolvente(ideal arg, int maxlength, int * length, |
---|
| 76 | intvec *** weights, BOOLEAN minim); |
---|
| 77 | |
---|
| 78 | resolvente syReorder(resolvente res,int length, |
---|
| 79 | syStrategy syzstr,BOOLEAN toCopy/*=TRUE*/,resolvente totake/*=NULL*/); |
---|
| 80 | |
---|
| 81 | syStrategy syResolution(ideal arg, int maxlength,intvec * w, BOOLEAN minim); |
---|
| 82 | |
---|
| 83 | void syMinimizeResolvente(resolvente res, int length, int first); |
---|
| 84 | |
---|
| 85 | intvec * syBetti(resolvente res,int length, int * regularity, |
---|
| 86 | intvec* weights=NULL,BOOLEAN tomin=TRUE, int * row_shift=NULL); |
---|
| 87 | |
---|
| 88 | ideal syMinBase(ideal arg); |
---|
| 89 | |
---|
| 90 | BOOLEAN syTestOrder(ideal i); |
---|
| 91 | |
---|
| 92 | void syReOrderResolventFB(resolvente res,int length, int initial=1); |
---|
| 93 | |
---|
| 94 | resolvente syLaScala1(ideal arg,int * length); |
---|
| 95 | syStrategy syLaScala3(ideal arg,int * length); |
---|
[50d54f8] | 96 | |
---|
| 97 | syStrategy syLaScala(ideal arg, int& maxlength, intvec* weights = NULL); |
---|
| 98 | |
---|
[35aab3] | 99 | syStrategy syHilb(ideal arg,int * length); |
---|
| 100 | syStrategy syKosz(ideal arg,int * length); |
---|
| 101 | |
---|
| 102 | void syDeleteRes(resolvente * res,int length); |
---|
| 103 | void syKillComputation(syStrategy syzstr, ring r=currRing); |
---|
[30b8381] | 104 | intvec * syBettiOfComputation(syStrategy syzstr, BOOLEAN minim=TRUE,int * row_shift=NULL, intvec *weights=NULL); |
---|
[35aab3] | 105 | BOOLEAN syBetti1(leftv res, leftv u); |
---|
| 106 | BOOLEAN syBetti2(leftv res, leftv u, leftv w); |
---|
| 107 | int syLength(syStrategy syzstr); |
---|
| 108 | int sySize(syStrategy syzstr); |
---|
| 109 | int syDim(syStrategy syzstr); |
---|
| 110 | syStrategy syCopy(syStrategy syzstr); |
---|
| 111 | void syPrint(syStrategy syzstr); |
---|
[42f5a8] | 112 | lists syConvRes(syStrategy syzstr,BOOLEAN toDel=FALSE,int add_row_shift=0); |
---|
[35aab3] | 113 | syStrategy syConvList(lists li,BOOLEAN toDel=FALSE); |
---|
| 114 | syStrategy syForceMin(lists li); |
---|
| 115 | syStrategy syMinimize(syStrategy syzstr); |
---|
| 116 | void syKillEmptyEntres(resolvente res,int length); |
---|
| 117 | |
---|
| 118 | extern int * currcomponents; |
---|
| 119 | extern long * currShiftedComponents; |
---|
| 120 | |
---|
| 121 | int syzcomp1dpc(poly p1, poly p2); |
---|
| 122 | void syDeletePair(SObject * so); |
---|
| 123 | void syInitializePair(SObject * so); |
---|
| 124 | void syCopyPair(SObject * argso, SObject * imso); |
---|
| 125 | void syCompactifyPairSet(SSet sPairs, int sPlength, int first); |
---|
| 126 | void syCompactify1(SSet sPairs, int* sPlength, int first); |
---|
| 127 | SRes syInitRes(ideal arg,int * length, intvec * Tl, intvec * cw=NULL); |
---|
| 128 | void syResetShiftedComponents(syStrategy syzstr, int index,int hilb=0); |
---|
| 129 | void syEnlargeFields(syStrategy syzstr,int index); |
---|
| 130 | void syEnterPair(syStrategy syzstr, SObject * so, int * sPlength,int index); |
---|
| 131 | SSet syChosePairs(syStrategy syzstr, int *index, int *howmuch, int * actdeg); |
---|
| 132 | int syInitSyzMod(syStrategy syzstr, int index, int init=17); |
---|
| 133 | long syReorderShiftedComponents(long * sc, int n); |
---|
| 134 | void syGaussForOne(ideal arg,int gen,int ModComp,int from=-1,int till=0); |
---|
| 135 | void syEnterPair(SSet sPairs, SObject * so, int * sPlength,int index); |
---|
| 136 | void syEnterPair(syStrategy syzstr, SObject * so, int * sPlength,int index); |
---|
| 137 | syStrategy syKosz(ideal arg,int * length); |
---|
| 138 | |
---|
| 139 | resolvente syReorder(resolvente res,int length, |
---|
| 140 | syStrategy syzstr,BOOLEAN toCopy=TRUE,resolvente totake=NULL); |
---|
| 141 | |
---|
| 142 | #endif |
---|