- Timestamp:
- Jul 25, 2013, 12:47:23 PM (11 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 2ea18609e14482a4ddbe0fd0d68b8d5885268a0c
- Parents:
- c3066da943ed65e5390f6c04d9a69f7710bfc83547e8b0441e7692a4a4b6c2f23817976fe5203f1c
- Location:
- Singular
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/classify_aeq.lib
r47e8b04 r87977c7 668 668 { 669 669 def R=basering; 670 def O=changeord( "Ds");670 def O=changeord(list(list("Ds",nvars(R)))); 671 671 setring O; 672 672 ideal I=imap(R,I); … … 717 717 { 718 718 def R=basering;//up till now the ordering of the base ring is ds 719 def O=changeord( "Ds");719 def O=changeord(list(list("Ds",nvars(R)))); 720 720 setring O; 721 721 ideal I=imap(R,I); … … 1377 1377 ideal I=4t3,7t6+10t9; 1378 1378 ideal G=t4,t7+t10; 1379 sagbiM OD(I,G,18);1379 sagbiMod(I,G,18); 1380 1380 */ 1381 1381 -
Singular/LIB/gitfan.lib
rc3066d r87977c7 27 27 28 28 LIB "parallel.lib"; // for parallelWaitAll 29 LIB "general.lib"; 29 30 30 31 //////////////////////////////////////////////////// 31 proc mod_init() 32 { 33 LIB"gfanlib.so"; 34 } 35 36 static proc int2face(int n, int r) 32 33 proc int2face(int n, int r) 37 34 { 38 35 int k = r-1; … … 43 40 while(2^k > n0){ 44 41 k--; 45 //v[size(v)+1] = 0;46 42 } 47 43 … … 56 52 ///////////////////////////////// 57 53 58 proc isAface(ideal a, intvec gam0 )54 proc isAface(ideal a, intvec gam0, int n) 59 55 "USAGE: isAface(a,gam0); a: ideal, gam0:intvec 60 56 PURPOSE: Checks whether the face of the positive orthant, … … 66 62 " 67 63 { 68 poly pz;69 70 64 // special case: gam0 is the zero-cone: 71 65 if (size(gam0) == 1 and gam0[1] == 0){ 72 ideal G;66 poly pz; ideal G; 73 67 74 68 // is an a-face if and only if RL0(0,...,0) = const … … 93 87 } 94 88 95 96 // ring is too big: Switch to KK[T_i; e_i\in gam0] instead: 89 // ring is too big: Switch to KK[T_i | e_i\in gam0] instead: 90 intvec w=ringlist(basering)[3][1][2]; 91 intvec w0; 97 92 string initNewRing = "ring Rgam0 = 0,("; 98 93 99 94 for (int i=1; i<size(gam0); i++){ 100 95 initNewRing = initNewRing + string(var(gam0[i])) + ","; 101 } 102 96 w0[i]=w[gam0[i]]; 97 } 98 99 w0 = w0,w[gam0[i]],1; 100 initNewRing = initNewRing + string(var(gam0[size(gam0)])) + ",U),Wp("+string(w0)+");"; 101 def R = basering; 102 execute(initNewRing); 103 104 ideal agam0 = imap(R,a); 105 106 for (i = 1; i<=size(agam0); i=i+1) 107 { 108 if (size(agam0[i]) == 1) 109 { return(0,0); } 110 } 111 112 poly p = var(1); // first entry of g; p = prod T_i with i element of g 113 for ( i = 2; i <= nvars(basering); i++ ) { 114 p = p * var(i); 115 } 116 // p is now the product over all T_i, with e_i in gam0 117 118 agam0 = agam0, p - 1; // rad-membership 119 agam0 = timeStd(agam0,5); 120 // "timestd finished after: "+string(timer-t); 121 // int timeout = 0; 122 if (attrib(agam0,"isSB") < 1) 123 { 124 kill agam0; kill Rgam0; kill initNewRing; kill w; kill w0; setring R; kill R; 125 return(0,1); 126 // // "timestd failed in "+string(gam0)+", falling back to saturation!"; 127 // setring R; kill Rgam0; 128 129 // initNewRing = "ring Rgam0 = 0,("; 130 131 // w0 = 0; 132 // for (i=1; i<size(gam0); i++){ 133 // initNewRing = initNewRing + string(var(gam0[i])) + ","; 134 // w0[i]=w[gam0[i]]; 135 // } 136 137 // w0 = w0,w[gam0[i]]; 138 // initNewRing = initNewRing + string(var(gam0[size(gam0)])) + "),Wp("+string(w0)+");"; 139 // execute(initNewRing); 140 141 // ideal G = imap(R,a); 142 143 // timeout = 1; 144 // int t=rtimer; 145 // for(int k=nvars(basering); k>0; k--) { G=sat(G,var(k))[1]; } 146 // t = (rtimer - t) div 1000; 147 // string(n)+": saturation successful after "+string(t)+" with: "+string(G<>1); 148 } 149 150 // does G contain 1?, i.e. is G = 1? 151 if(agam0 <> 1) { 152 kill agam0; kill Rgam0; kill initNewRing; kill w; kill w0; setring R; kill R; 153 return(1,0); // true 154 } 155 156 kill agam0; kill Rgam0; kill initNewRing; kill w; kill w0; setring R; kill R; 157 return(0,0); // false 158 } 159 example 160 { 161 echo = 2; 162 163 ring R = 0,(T(1..4)),dp; 164 ideal I = T(1)*T(2)-T(4); 165 166 intvec w = 1,4; 167 intvec v = 1,2,4; 168 169 isAface(I,w); // should be 0 170 "-----------"; 171 isAface(I,v); // should be 1 172 } 173 174 175 proc isAfaceNonZero(ideal a, intvec gam0) 176 { 177 string initNewRing = "ring Rgam0 = 0,("; 178 for (int i=1; i<size(gam0); i++) 179 { initNewRing = initNewRing + string(var(gam0[i])) + ","; } 103 180 initNewRing = initNewRing + string(var(gam0[size(gam0)])) + "),dp;"; 104 181 def R = basering; … … 107 184 ideal agam0 = imap(R,a); 108 185 109 poly p = var(1); // first entry of g; p = prod T_i with i element of g 110 for ( i = 2; i <= nvars(basering); i++ ) { 111 p = p * var(i); 112 } 113 // p is now the product over all T_i, with e_i in gam0 114 115 agam0 = agam0, p - 1; // rad-membership 186 for ( i = 1; i<=size(agam0); i=i+1) 187 { if (size(agam0[i]) == 1) { return(0); } } 188 189 poly p = var(1); 190 for ( i = 2; i <= nvars(basering); i++ ) 191 { p = p * var(i); } 192 193 agam0 = agam0, p - 1; 116 194 ideal G = std(agam0); 117 195 118 // does G contain 1?, i.e. is G = 1? 119 if(G <> 1) { 120 return(1); // true 121 } 122 123 return(0); // false 124 } 125 example 126 { 127 echo = 2; 128 129 ring R = 0,(T(1..4)),dp; 130 ideal I = T(1)*T(2)-T(4); 131 132 intvec w = 1,4; 133 intvec v = 1,2,4; 134 135 isAface(I,w); // should be 0 136 "-----------"; 137 isAface(I,v); // should be 1 138 } 139 196 if(G <> 1) 197 { return(1); } 198 199 return(0); 200 } 140 201 //////////////////////////////////////////////////// 141 202 … … 145 206 list AF; 146 207 147 for(i = start; i <= end; i ++){208 for(i = start; i <= end; i=i+1){ 148 209 if(i < 2^r){ 210 string(i)+" "+string(size(AF)); 149 211 gam0 = int2face(i,r); 150 212 … … 165 227 166 228 proc afaces(ideal a, list #) 167 "USAGE: afaces(a, b, c); a: ideal, d: int, c: int229 "USAGE: afaces(a, b, c); a: ideal, b: int, c: int 168 230 PURPOSE: Returns a list of all a-faces (represented by intvecs). 169 231 Moreover, it is possible to specify a dimensional bound b, … … 210 272 211 273 // do remaining ones: 212 for(i = ncores * step +1; i < 2^r; i ++){274 for(i = ncores * step +1; i < 2^r; i=i+1){ 213 275 "another one needed"; 214 276 gam0 = int2face(i,r); … … 223 285 } 224 286 287 int l; 225 288 // read out afaces of out into AF: 226 for( i = 1; i <= size(out); i++){227 AF = AF + out[ i];289 for(l = 1; l <= size(out); l++){ 290 AF = AF + out[l]; 228 291 } 229 292 -
Singular/fehelp.cc
r47e8b04 r87977c7 99 99 * 100 100 *****************************************************************/ 101 // order is imp rotant -- first possible help is choosen101 // order is important -- first possible help is chosen 102 102 // moved to LIB/help.cnf 103 103 static heBrowser_s *heHelpBrowsers=NULL; … … 117 117 118 118 BOOLEAN key_is_regexp = (strchr(str, '*') != NULL); 119 120 // try proc help and library help 121 if (! key_is_regexp && heOnlineHelp(str)) return; 122 119 123 heEntry_s hentry; 120 124 memset(&hentry,0,sizeof(hentry)); … … 127 131 return; 128 132 } 129 130 // try proc help and library help131 if (! key_is_regexp && heOnlineHelp(str)) return;132 133 133 134 // Try to match approximately with key in index file … … 191 192 char *matches=StringEndS(); 192 193 PrintS(matches); 194 omFree(matches); 193 195 PrintLn(); 194 omFree(matches);195 196 return; 196 197 } … … 687 688 static BOOLEAN heOnlineHelp(char* s) 688 689 { 689 idhdl h=IDROOT->get(s,myynest);690 690 char *ss; 691 691 idhdl h; 692 693 if ((ss=strstr(s,"::"))!=NULL) 694 { 695 *ss='\0'; 696 ss+=2; 697 h=ggetid(s); 698 if (h!=NULL) 699 { 700 Print("help for %s from package %s\n",ss,s); 701 char s_help[200]; 702 strcpy(s_help,ss); 703 strcat(s_help,"_help"); 704 idhdl hh=IDPACKAGE(h)->idroot->get(s_help,0); 705 hePrintHelpStr(hh,s_help,s); 706 return TRUE; 707 } 708 else Print("package %s not found\n",s); 709 return TRUE; /* do not search the manual */ 710 } 711 h=IDROOT->get(s,myynest); 692 712 // try help for a procedure 693 713 if (h!=NULL) … … 707 727 return TRUE; 708 728 } 709 else710 {711 char s_help[200];712 strcpy(s_help,s);713 strcat(s_help,"_help");714 idhdl hh=IDROOT->get(s_help,0);715 hePrintHelpStr(hh,s_help,"Top");716 }717 729 } 718 730 else if (IDTYP(h)==PACKAGE_CMD) … … 720 732 idhdl hh=IDPACKAGE(h)->idroot->get("info",0); 721 733 hePrintHelpStr(hh,"info",s); 722 } 723 else if ((ss=strstr(s,"::"))!=NULL) 724 { 725 *ss='\0'; 726 ss+=2; 727 h=ggetid(s); 728 if (h!=NULL) 729 { 730 Print("help for %s from package %s\n",ss,s); 731 char s_help[200]; 732 strcpy(s_help,ss); 733 strcat(s_help,"_help"); 734 idhdl hh=IDPACKAGE(h)->idroot->get(s_help,0); 735 hePrintHelpStr(hh,s_help,s); 736 } 737 else Print("package %s not found\n",s); 734 return TRUE; 738 735 } 739 736 return FALSE; … … 892 889 if (feResource(*p, warn) == NULL) 893 890 { 894 if (warn) Warn("res source `%c` not found",*p);891 if (warn) Warn("resource `%c` not found",*p); 895 892 return FALSE; 896 893 } … … 899 896 if (getenv("DISPLAY") == NULL) 900 897 { 901 if (warn) WarnS("res source `D` not found");898 if (warn) WarnS("resource `D` not found"); 902 899 return FALSE; 903 900 } … … 984 981 { 985 982 char sys[MAX_SYSCMD_LEN]; 986 // char url[MAXPATHLEN];987 983 const char *p=heHelpBrowsers[br].action; 988 984 if (p==NULL) {PrintS("no action ?\n"); return;} … … 1067 1063 } 1068 1064 Print("running `%s`\n",sys); 1069 /*int dummy=*/(void) system(sys);1065 (void) system(sys); 1070 1066 } 1071 1067 -
Singular/misc_ip.cc
r47e8b04 r87977c7 49 49 && (mpz_cmp_si(n,(long)ui)==0)) 50 50 { 51 L->m[index].rtyp = INT_CMD; L->m[index].data = (void*) ui;51 L->m[index].rtyp = INT_CMD; L->m[index].data = (void*)(long)ui; 52 52 return; 53 53 } … … 63 63 if ((((unsigned long)i)==ui) && (((i<<3)>>3)==i)) 64 64 { 65 L->m[index].rtyp = INT_CMD; L->m[index].data = (void*) i;65 L->m[index].rtyp = INT_CMD; L->m[index].data = (void*)(long)i; 66 66 } 67 67 else -
Singular/pcv.cc
r47e8b04 r87977c7 149 149 { 150 150 res->rtyp=INT_CMD; 151 res->data=(void*) pcvMinDeg((poly)h->Data());151 res->data=(void*)(long)pcvMinDeg((poly)h->Data()); 152 152 return FALSE; 153 153 } … … 156 156 { 157 157 res->rtyp=INT_CMD; 158 res->data=(void*) pcvMinDeg((matrix)h->Data());158 res->data=(void*)(long)pcvMinDeg((matrix)h->Data()); 159 159 return FALSE; 160 160 } … … 400 400 int d1=(int)(long)h->Data(); 401 401 res->rtyp=INT_CMD; 402 res->data=(void*) pcvDim(d0,d1);402 res->data=(void*)(long)pcvDim(d0,d1); 403 403 return FALSE; 404 404 } -
Singular/pyobject.cc
r47e8b04 r87977c7 101 101 { 102 102 // Sone python modules needs argc, argv set for some reason 103 char* argv = "";103 char* argv = (char*)""; 104 104 PySys_SetArgv(1, &argv); 105 105 PyRun_SimpleString("from sys import path, modules"); … … 256 256 PyErr_Fetch(&pType, &pMessage, &pTraceback); 257 257 258 Werror ("pyobject error occured");259 Werror (PyString_AsString(pMessage));258 WerrorS("pyobject error occured"); 259 WerrorS(PyString_AsString(pMessage)); 260 260 261 261 Py_XDECREF(pType); … … 580 580 case '<': case '>': case EQUAL_EQUAL: case NOTEQUAL: case GE: case LE: 581 581 { 582 res->data = (void *) lhs.compare(op, PythonCastDynamic(arg2));582 res->data = (void *)(long)(lhs.compare(op, PythonCastDynamic(arg2))); 583 583 res->rtyp = INT_CMD; 584 584 return FALSE; -
Singular/singular-libs
r47e8b04 r87977c7 41 41 # for new libs 42 42 43 SLIB1 = ffsolve.lib decomp.lib template.lib findifs.lib finitediff.lib locnormal.lib modnormal.lib \ 43 SLIB1 = classifyci.lib classify_aeq.lib ffsolve.lib decomp.lib template.lib\ 44 findifs.lib finitediff.lib \ 45 locnormal.lib modnormal.lib \ 44 46 JMBTest.lib JMSConst.lib multigrading.lib parallel.lib realizationMatroids.lib ringgb.lib \ 45 47 schreyer.lib symodstd.lib derham.lib polybori.lib
Note: See TracChangeset
for help on using the changeset viewer.