Changeset e9ad8a6 in git
- Timestamp:
- Jun 2, 1998, 5:30:06 PM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 3e51af9f276f204e3b6cfcf1258c17b8f270f019
- Parents:
- 98aa53fd19f83e591c2dccae346010e080a9f7bc
- Location:
- Singular
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ChangeLog
r98aa53 re9ad8a6 1 Tue Jun 2 17:28:48 MET DST 1998 hannes 2 * introduced /* */ comments 3 * some code cleanups 1 4 Fri May 29 17:00:27 MET DST 1998 hannes 2 5 * change res to nres (cmd), resu to res(standard.lib) -
Singular/comm.h
r98aa53 re9ad8a6 103 103 typedef class skstdLink * stdLink; 104 104 105 class skstdLink 105 class skstdLink 106 106 { 107 107 public: … … 146 146 LSet Warteliste; 147 147 int Wartelistemax, Wartelistel; 148 int aktuell; // Index des Polynoms in l, das als nächstes verarbeitet wird. 148 int aktuell; // Index des Polynoms in l, das als nächstes verarbeitet wird. 149 149 150 150 int procnum; -
Singular/febase.cc
r98aa53 re9ad8a6 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: febase.cc,v 1.3 6 1998-05-25 13:04:54Singular Exp $ */4 /* $Id: febase.cc,v 1.37 1998-06-02 15:29:51 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: i/o system … … 119 119 #define SINGULAR_RELATIVE_DATA_DIR "../share/Singular" 120 120 121 static char* SearchPath = NULL;122 static char* ExpandedExecutable = NULL;121 static char* feSearchPath = NULL; 122 static char* feExpandedExecutable = NULL; 123 123 124 124 char* feGetExpandedExecutable(const char* argv0) 125 125 { 126 if ( ExpandedExecutable == NULL)126 if (feExpandedExecutable == NULL) 127 127 { 128 128 if (argv0 != NULL) 129 ExpandedExecutable = find_executable(argv0);130 } 131 return ExpandedExecutable;129 feExpandedExecutable = find_executable(argv0); 130 } 131 return feExpandedExecutable; 132 132 } 133 133 … … 152 152 return temp2; 153 153 } 154 else 154 else 155 155 return NULL; 156 156 } … … 160 160 // Env-variables + Relative Data Dir + Burned-in data dir 161 161 char* feGetSearchPath(const char* argv0) 162 { 163 if ( SearchPath == NULL)162 { 163 if (feSearchPath == NULL) 164 164 { 165 165 char *env = NULL, *sibbling = NULL, *path; 166 166 int plength = 0, tmp; 167 167 168 168 #ifdef MSDOS 169 169 env=getenv("SPATH"); … … 171 171 env=getenv("SINGULARPATH"); 172 172 #endif 173 173 174 174 if (env != NULL) 175 175 plength = strlen(env) + 1; … … 177 177 if (argv0 != NULL) 178 178 sibbling = feRemovePathnameHead(feGetExpandedExecutable(argv0)); 179 179 180 180 if (sibbling != NULL) 181 181 plength += strlen(sibbling) + strlen(SINGULAR_RELATIVE_DATA_DIR) + 2; 182 182 183 183 plength += strlen(SINGULAR_DATADIR) + 2; 184 184 185 185 path = (char*) AllocL(plength*sizeof(char)); 186 SearchPath = path;187 186 feSearchPath = path; 187 188 188 if (env != NULL) 189 189 { … … 194 194 path++; 195 195 } 196 196 197 197 if (sibbling != NULL) 198 198 { … … 209 209 FreeL(sibbling); 210 210 } 211 211 212 212 tmp = strlen(SINGULAR_DATADIR); 213 213 memcpy(path,SINGULAR_DATADIR, tmp); … … 215 215 *path = '\0'; 216 216 } 217 return SearchPath;217 return feSearchPath; 218 218 } 219 219 … … 268 268 FreeL(res); 269 269 #else 270 if (where!=NULL) strcpy(where,path); 271 if ((*mode=='r') && (path[0]!=DIR_SEP)&&(path[0]!='.') 272 &&(f==NULL)) 270 if (where!=NULL) 271 strcpy(where,path); 272 if ((*mode=='r') 273 && (path[0]!=DIR_SEP) 274 && (path[0]!='.') 275 && (f==NULL)) 273 276 { 274 277 char found = 0; … … 293 296 if(!access(s, R_OK)) { found++; break; } 294 297 #else 295 f= myfopen(s,mode);298 f=fopen(s,mode); /* do not need myfopen: we test only the access */ 296 299 if (f!=NULL) { found++; fclose(f); break; } 297 300 #endif … … 682 685 int i; 683 686 BOOLEAN done = FALSE; 684 687 685 688 for (i=0;;i++) 686 689 { … … 689 692 if (mode[i] == 'b') done = TRUE; 690 693 } 691 694 692 695 if (! done) 693 696 { … … 720 723 721 724 722 725 -
Singular/febase.h
r98aa53 re9ad8a6 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: febase.h,v 1.1 7 1998-05-25 21:28:31 obachmanExp $ */6 /* $Id: febase.h,v 1.18 1998-06-02 15:29:52 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 22 22 */ 23 23 #ifndef unix 24 extern FILE *myfopen(char *path, char *mode); 24 extern FILE *myfopen(char *path, char *mode); 25 25 #else 26 26 #define myfopen fopen … … 64 64 /* the C++-part: */ 65 65 66 enum feBufferTypes 66 enum feBufferTypes 67 67 { 68 68 BT_none = 0, // entry level … … 76 76 }; 77 77 78 enum feBufferInputs 78 enum feBufferInputs 79 79 { 80 80 BI_stdin = 1, -
Singular/febase.inc
r98aa53 re9ad8a6 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: febase.inc,v 1.1 0 1998-05-07 17:53:25Singular Exp $ */4 /* $Id: febase.inc,v 1.11 1998-06-02 15:29:53 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: handling of 'voices' … … 302 302 //Print("----------------\n"); 303 303 //} 304 if (currentVoice->oldb!=NULL) 305 { 306 myyoldbuffer(currentVoice->oldb); 307 currentVoice->oldb=NULL; 308 } 309 if ((currentVoice->prev==NULL)&&(currentVoice->sw==BI_file)) 310 { 311 currentVoice->prev=feInitStdin(); 312 } 313 if (currentVoice->prev!=NULL) 314 { 315 //printf("exitVoice typ %d(%s)\n", 316 // currentVoice->typ,BT_name[currentVoice->typ]); 317 if (currentVoice->typ==BT_if) 318 { 319 currentVoice->prev->ifsw=2; 320 } 321 else 322 { 323 currentVoice->prev->ifsw=0; 324 } 325 if ((currentVoice->sw == BI_file) 326 && (currentVoice->files!=NULL)) 327 { 328 fclose(currentVoice->files); 329 } 330 if (currentVoice->filename!=NULL) 331 { 332 FreeL((ADDRESS)currentVoice->filename); 333 currentVoice->filename=NULL; 334 } 335 if (currentVoice->buffer!=NULL) 336 { 337 FreeL((ADDRESS)currentVoice->buffer); 338 currentVoice->buffer=NULL; 339 } 340 yylineno=currentVoice->prev->curr_lineno; 341 } 342 Voice *p=currentVoice->prev; 343 delete currentVoice; 344 currentVoice=p; 345 return currentVoice==0; 304 if (currentVoice!=NULL) 305 { 306 if (currentVoice->oldb!=NULL) 307 { 308 myyoldbuffer(currentVoice->oldb); 309 currentVoice->oldb=NULL; 310 } 311 if ((currentVoice->prev==NULL)&&(currentVoice->sw==BI_file)) 312 { 313 currentVoice->prev=feInitStdin(); 314 } 315 if (currentVoice->prev!=NULL) 316 { 317 //printf("exitVoice typ %d(%s)\n", 318 // currentVoice->typ,BT_name[currentVoice->typ]); 319 if (currentVoice->typ==BT_if) 320 { 321 currentVoice->prev->ifsw=2; 322 } 323 else 324 { 325 currentVoice->prev->ifsw=0; 326 } 327 if ((currentVoice->sw == BI_file) 328 && (currentVoice->files!=NULL)) 329 { 330 fclose(currentVoice->files); 331 } 332 if (currentVoice->filename!=NULL) 333 { 334 FreeL((ADDRESS)currentVoice->filename); 335 currentVoice->filename=NULL; 336 } 337 if (currentVoice->buffer!=NULL) 338 { 339 FreeL((ADDRESS)currentVoice->buffer); 340 currentVoice->buffer=NULL; 341 } 342 yylineno=currentVoice->prev->curr_lineno; 343 } 344 Voice *p=currentVoice->prev; 345 delete currentVoice; 346 currentVoice=p; 347 } 348 return currentVoice==NULL; 346 349 } 347 350 … … 432 435 int feReadLine(char* b, int l) 433 436 { 437 char *s=NULL; 438 int offset; /* will not be used if s==NULL*/ 434 439 // try to read from the buffer into b, max l chars 435 if ((currentVoice->buffer!=NULL) 436 && (currentVoice->buffer[currentVoice->fptr]!='\0')) 437 { 438 NewBuff: 439 int i=0; 440 int startfptr=currentVoice->fptr; 441 l--; 442 loop 443 { 444 char c= 445 b[i]=currentVoice->buffer[currentVoice->fptr]; 446 i++; 447 if (yy_noeof==noeof_block) 448 { 449 if (c<' ') yylineno++; 450 else if (c=='}') break; 451 } 452 else 453 { 454 if ((c<' ') || 455 (c==';') || 456 (c==')') 457 ) 458 break; 459 } 460 if (i>=l) break; 440 if (currentVoice!=NULL) 441 { 442 if((currentVoice->buffer!=NULL) 443 && (currentVoice->buffer[currentVoice->fptr]!='\0')) 444 { 445 NewBuff: 446 int i=0; 447 int startfptr=currentVoice->fptr; 448 l--; 449 loop 450 { 451 char c= 452 b[i]=currentVoice->buffer[currentVoice->fptr]; 453 i++; 454 if (yy_noeof==noeof_block) 455 { 456 if (c<' ') yylineno++; 457 else if (c=='}') break; 458 } 459 else 460 { 461 if ((c<' ') || 462 (c==';') || 463 (c==')') 464 ) 465 break; 466 } 467 if (i>=l) break; 468 currentVoice->fptr++; 469 if(currentVoice->buffer[currentVoice->fptr]=='\0') break; 470 } 471 b[i]='\0'; 472 if (currentVoice->sw==BI_buffer) 473 { 474 if (startfptr==0) 475 { 476 char *anf=currentVoice->buffer; 477 char *ss=strchr(anf,'\n'); 478 int len; 479 if (ss==NULL) len=strlen(anf); 480 else len=ss-anf; 481 char *s=(char *)AllocL(len+2); 482 strncpy(s,anf,len+2); 483 s[len+1]='\0'; 484 fePrintEcho(s); 485 FreeL((ADDRESS)s); 486 } 487 else if (/*(startfptr>0) &&*/ 488 (currentVoice->buffer[startfptr-1]=='\n')) 489 { 490 char *anf=currentVoice->buffer+startfptr; 491 char *ss=strchr(anf,'\n'); 492 int len; 493 if (ss==NULL) len=strlen(anf); 494 else len=ss-anf; 495 char *s=(char *)AllocL(len+2); 496 strncpy(s,anf,len+2); 497 s[len+1]='\0'; 498 yylineno++; 499 fePrintEcho(s); 500 FreeL((ADDRESS)s); 501 } 502 } 461 503 currentVoice->fptr++; 462 if(currentVoice->buffer[currentVoice->fptr]=='\0') break; 463 } 464 b[i]='\0'; 465 if (currentVoice->sw==BI_buffer) 466 { 467 if (startfptr==0) 468 { 469 char *anf=currentVoice->buffer; 470 char *ss=strchr(anf,'\n'); 471 int len; 472 if (ss==NULL) len=strlen(anf); 473 else len=ss-anf; 474 char *s=(char *)AllocL(len+2); 475 strncpy(s,anf,len+2); 476 s[len+1]='\0'; 477 fePrintEcho(s); 478 FreeL((ADDRESS)s); 479 } 480 else if (/*(startfptr>0) &&*/ 481 (currentVoice->buffer[startfptr-1]=='\n')) 482 { 483 char *anf=currentVoice->buffer+startfptr; 484 char *ss=strchr(anf,'\n'); 485 int len; 486 if (ss==NULL) len=strlen(anf); 487 else len=ss-anf; 488 char *s=(char *)AllocL(len+2); 489 strncpy(s,anf,len+2); 490 s[len+1]='\0'; 491 yylineno++; 492 fePrintEcho(s); 493 FreeL((ADDRESS)s); 494 } 495 } 496 currentVoice->fptr++; 497 return i; 498 } 499 // no buffer there or e-o-buffer or eoln: 500 if (currentVoice->sw!=BI_buffer) 501 { 502 currentVoice->fptr=0; 503 if (currentVoice->buffer==NULL) 504 currentVoice->buffer=(char *)AllocL(4096-sizeof(ADDRESS)); 505 } 506 char *s; 507 int offset=0; 508 NewRead: 509 yylineno++; 510 if (currentVoice->sw==BI_stdin) 511 { 512 feShowPrompt(); 513 s=fe_fgets_stdin(currentVoice->buffer+offset,(4096-1-sizeof(ADDRESS))-offset); 514 } 515 else if (currentVoice->sw==BI_file) 516 { 517 s=fgets(currentVoice->buffer+offset,(4096-1-sizeof(ADDRESS))-offset, 518 currentVoice->files); 519 } 520 else /* BI_buffer */ 521 { 522 return 0; 504 return i; 505 } 506 // no buffer there or e-o-buffer or eoln: 507 if (currentVoice->sw!=BI_buffer) 508 { 509 currentVoice->fptr=0; 510 if (currentVoice->buffer==NULL) 511 currentVoice->buffer=(char *)AllocL(4096-sizeof(ADDRESS)); 512 } 513 offset=0; 514 NewRead: 515 yylineno++; 516 if (currentVoice->sw==BI_stdin) 517 { 518 feShowPrompt(); 519 s=fe_fgets_stdin(currentVoice->buffer+offset,(4096-1-sizeof(ADDRESS))-offset); 520 } 521 else if (currentVoice->sw==BI_file) 522 { 523 s=fgets(currentVoice->buffer+offset,(4096-1-sizeof(ADDRESS))-offset, 524 currentVoice->files); 525 } 526 //else /* BI_buffer */ s==NULL => return 0 527 //{ 528 // return 0; 529 //} 523 530 } 524 531 if (s!=NULL) … … 544 551 /* else if (s==NULL) */ 545 552 { 553 char *err=NULL; 546 554 switch(yy_noeof) 547 555 { 548 case 0:549 return 0;550 556 case noeof_brace: 551 557 case noeof_block: 552 WerrorS("premature end of file while reading {...}");558 err="{...}"; 553 559 break; 554 560 case noeof_asstring: 555 WerrorS("premature end of file while reading till `.`");561 err="till `.`"; 556 562 break; 557 563 case noeof_string: 558 WerrorS("premature end of file while reading string");564 err="string"; 559 565 break; 560 566 case noeof_bracket: 561 WerrorS("premature end of file while reading (...)");567 err="(...)"; 562 568 break; 563 569 case noeof_procname: 564 WerrorS("premature end of file while reading proc");570 err="proc"; 565 571 break; 566 } 572 case noeof_comment: 573 err="/*...*/"; 574 break; 575 default: 576 break; 577 } 578 if (err!=NULL) 579 Werror("premature end of file while reading %s",err); 567 580 return 0; 568 581 } -
Singular/fglm.h
r98aa53 re9ad8a6 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglm.h,v 1. 8 1998-04-14 15:28:00Singular Exp $2 // $Id: fglm.h,v 1.9 1998-06-02 15:29:54 Singular Exp $ 3 3 4 4 /**************************************** 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* 7 /* 8 8 * ABSTRACT - The FGLM-Algorithm 9 * The main header file for the fglm algorithm 9 * The main header file for the fglm algorithm 10 10 * (See fglm.cc for details) 11 11 */ … … 41 41 { 42 42 public: 43 int insertions; 43 int insertions; 44 44 poly monom; 45 fglmVector v; 45 fglmVector v; 46 46 int var; 47 47 fglmDelem( poly & m, fglmVector mv, int v ); … … 58 58 // Warning: There is no check, if the ideal is really 0-dimensional and minimal. 59 59 // If it is minimal but not reduced, then it returns FALSE, otherwise TRUE. 60 // Warning: There is no check, if the rings are compatible for fglm (see 60 // Warning: There is no check, if the rings are compatible for fglm (see 61 61 // fglm.cc for functions to check this) 62 62 // if switchBack==TRUE, then the procedure sets the ring as currentRing which was … … 73 73 // first is the sourceRing, second is the given ideal in sourceRing. 74 74 // Returns the groebnerbasis of the sourceIdeal in the currentRing. 75 // Checks, if the ideal is really a reduced groebner basis of a 75 // Checks, if the ideal is really a reduced groebner basis of a 76 76 // 0-dimensional Ideal. Returns TRUE if an error occoured. 77 77 BOOLEAN -
Singular/fglmgauss.h
r98aa53 re9ad8a6 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglmgauss.h,v 1. 2 1997-10-06 12:19:10 obachmanExp $2 // $Id: fglmgauss.h,v 1.3 1998-06-02 15:29:54 Singular Exp $ 3 3 4 4 /**************************************** 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* 7 /* 8 8 * ABSTRACT - header file for the gauss - reducer 9 9 * (used by fglm) … … 18 18 class gaussElem; 19 19 20 class gaussReducer 20 class gaussReducer 21 21 { 22 22 private: 23 23 int size; 24 int max; 25 gaussElem * elems; 24 int max; 25 gaussElem * elems; 26 26 BOOLEAN * isPivot; 27 27 int * perm; … … 32 32 gaussReducer( int dimen ); 33 33 ~gaussReducer(); 34 34 35 35 // reduce returns TRUE, if v reduces to 0, FALSE otherwise; 36 36 BOOLEAN reduce( fglmVector v ); 37 37 38 38 // if a vector does not reduce to zero, then it can be stored as a new gauss 39 // vector. 39 // vector. 40 40 // Has to be called after reduce! 41 41 void store(); 42 42 43 43 // if a vector reduces to zero, then one can get the corresponding fglmVector 44 // of the linear dependence 44 // of the linear dependence 45 45 // Has to be called after reduce! 46 46 fglmVector getDependence(); -
Singular/ipid.h
r98aa53 re9ad8a6 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: ipid.h,v 1.1 2 1998-05-04 14:11:38Singular Exp $ */6 /* $Id: ipid.h,v 1.13 1998-06-02 15:29:55 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: identfier handling … … 42 42 #ifdef RDEBUG 43 43 short no; /* unique id for rings */ 44 #endif 44 #endif 45 45 }; 46 46 -
Singular/kstd1.h
r98aa53 re9ad8a6 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kstd1.h,v 1. 5 1998-05-14 13:04:17Singular Exp $ */6 /* $Id: kstd1.h,v 1.6 1998-06-02 15:29:55 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 28 28 lists TraceStd(leftv,int , ideal F, ideal Q, tHomog h, intvec ** w,intvec *hilb=NULL, 29 29 int syzComp=0,int newIdeal=0); 30 #endif 30 #endif 31 31 32 32 /* the following global data are defined in kutil.cc */ -
Singular/libparse.h
r98aa53 re9ad8a6 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: libparse.h,v 1. 6 1998-05-31 15:42:24 krueger Exp $ */6 /* $Id: libparse.h,v 1.7 1998-06-02 15:29:56 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: lib parsing … … 17 17 char *procname, int line, long pos, 18 18 BOOLEAN pstatic = FALSE); 19 int yylplex(char *libname, char *libfile, lib_style_types *lib_style, 19 int yylplex(char *libname, char *libfile, lib_style_types *lib_style, 20 20 lp_modes=LOAD_LIB); 21 21 void reinit_yylp(); … … 42 42 # endif 43 43 44 #endif /* LIBPARSE_H */ 44 #endif /* LIBPARSE_H */ 45 45 46 46 -
Singular/longrat.h
r98aa53 re9ad8a6 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: longrat.h,v 1. 9 1998-05-27 17:14:07Singular Exp $ */6 /* $Id: longrat.h,v 1.10 1998-06-02 15:29:56 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: computation with long rational numbers … … 20 20 #else 21 21 # define HAVE_LIBGMP1 22 #endif 22 #endif 23 23 #endif 24 24 -
Singular/misc.cc
r98aa53 re9ad8a6 90 90 void m2_end(short i) 91 91 { 92 if (i==0) 92 #ifdef HAVE_TCL 93 if (tclmode) 94 PrintTCL('Q',0,NULL); 95 #endif 96 if (i<=0) 93 97 { 94 98 #ifdef HAVE_TCL 95 if (tclmode) 96 PrintTCL('Q',0,NULL); 97 else 99 if (!tclmode) 98 100 #endif 99 printf("Auf Wiedersehen.\n"); 101 if (BVERBOSE(0)) 102 { 103 if (i==0) 104 printf("Auf Wiedersehen.\n"); 105 else 106 printf("\n$Bye.\n"); 107 } 108 #ifndef macintosh 109 #ifdef HAVE_FEREAD 110 #ifdef HAVE_ATEXIT 111 fe_reset_input_mode(); 112 #else 113 fe_reset_input_mode(0,NULL); 114 #endif 115 #else 116 #ifdef HAVE_READLINE 117 fe_reset_input_mode(); 118 #endif 119 #endif 120 #endif 121 #ifdef sun 122 #ifndef __svr4__ 123 _cleanup(); 124 _exit(0); 125 #endif 126 #endif 127 exit(0); 100 128 } 101 129 else 102 130 { 103 131 #ifdef HAVE_TCL 104 if (tclmode) 105 PrintTCL('Q',0,NULL); 106 else 132 if (!tclmode) 107 133 #endif 108 134 printf("\nhalt %d\n",i); -
Singular/mmemory.h
r98aa53 re9ad8a6 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: mmemory.h,v 1. 8 1998-04-28 08:39:40 obachmanExp $ */6 /* $Id: mmemory.h,v 1.9 1998-06-02 15:29:58 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 17 17 18 18 #include "mod2.h" 19 19 20 20 #ifdef DO_DEEP_PROFILE 21 21 extern void _memcpyW(void* p1, void* p2, long l); 22 #define memcpyW(p1, p2, l) _memcpyW((void*) p1, (void*) p2, (long) l) 23 #else 22 #define memcpyW(p1, p2, l) _memcpyW((void*) p1, (void*) p2, (long) l) 23 #else 24 24 #define memcpyW(p1, p2, l) \ 25 25 do \ … … 40 40 while(0) 41 41 #endif 42 42 43 43 44 44 void mmSpecializeBlock( size_t ); … … 48 48 #ifdef HAVE_SBRK 49 49 int mmMemPhysical( void ); 50 #endif 50 #endif 51 51 52 52 #define mstrdup mmStrdup -
Singular/mpsr.h
r98aa53 re9ad8a6 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpsr.h,v 1. 9 1998-05-25 21:28:32 obachmanExp $ */4 /* $Id: mpsr.h,v 1.10 1998-06-02 15:29:58 Singular Exp $ */ 5 5 /*************************************************************** 6 6 * … … 102 102 #else 103 103 nSetChar(rg->ch, complete, rg->parameter,rg->P); 104 #endif 104 #endif 105 105 pChangeRing(rg->N, rg->OrdSgn, rg->order, rg->block0, rg->block1, 106 106 rg->wvhdl); … … 138 138 #define MPSR_QUIT_STRING "MPtcp:quit" 139 139 140 // some handy Macros for error handlings 140 // some handy Macros for error handlings 141 141 #ifdef MPSR_DEBUG 142 142 … … 250 250 } \ 251 251 while (0) 252 #undef mpsr_assume 252 #undef mpsr_assume 253 253 #define mpsr_assume(cond) ((void) 0) 254 254 -
Singular/mpsr_Get.h
r98aa53 re9ad8a6 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpsr_Get.h,v 1. 2 1997-04-09 12:20:02Singular Exp $ */4 /* $Id: mpsr_Get.h,v 1.3 1998-06-02 15:29:59 Singular Exp $ */ 5 5 /*************************************************************** 6 6 * … … 33 33 ***************************************************************/ 34 34 35 // the data structure which functions as external data 35 // the data structure which functions as external data 36 36 typedef struct mpsr_sleftv 37 37 { … … 71 71 MPT_Node_pt node, 72 72 mpsr_leftv mlv, 73 short quote); 73 short quote); 74 74 extern mpsr_Status_t mpsr_GetOperatorLeftv(MP_Link_pt link, 75 75 MPT_Node_pt node, 76 76 mpsr_leftv mlv, 77 short quote); 77 short quote); 78 78 extern MPT_Status_t mpsr_GetExternalData(MP_Link_pt link, 79 79 MPT_Arg_t *odata, … … 86 86 * 87 87 ***************************************************************/ 88 inline BOOLEAN NodeCheck(MPT_Node_pt node, MP_NodeType_t type, 88 inline BOOLEAN NodeCheck(MPT_Node_pt node, MP_NodeType_t type, 89 89 MP_DictTag_t dtag, MP_Common_t cv) 90 90 { -
Singular/mpsr_Put.h
r98aa53 re9ad8a6 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpsr_Put.h,v 1. 6 1998-01-16 14:29:56 krueger Exp $ */4 /* $Id: mpsr_Put.h,v 1.7 1998-06-02 15:29:59 Singular Exp $ */ 5 5 /*************************************************************** 6 6 * … … 11 11 * Change History (most recent first): 12 12 * o 1/97 obachman 13 * Updated putting routines to MP and MPP v1.1 13 * Updated putting routines to MP and MPP v1.1 14 14 * 15 15 ***************************************************************/ … … 31 31 * 32 32 ***************************************************************/ 33 // some often used flags settings for annotations 33 // some often used flags settings for annotations 34 34 #define MP_AnnotReqValTree \ 35 35 (MP_AnnotRequired | MP_AnnotValuated | MP_AnnotTreeScope) … … 170 170 { 171 171 command cmd = (command) v->Data(); 172 172 173 173 typecheck(v, COMMAND); 174 174 if (cmd->op == PROC_CMD) -
Singular/ndbm.cc
r98aa53 re9ad8a6 5 5 //**************************************************************************/ 6 6 // 7 // $Id: ndbm.cc,v 1. 9 1998-04-09 11:47:13 pohlExp $7 // $Id: ndbm.cc,v 1.10 1998-06-02 15:30:00 Singular Exp $ 8 8 // 9 9 //**************************************************************************/ … … 144 144 { 145 145 long hash; 146 146 147 147 hash = dcalchash(key); 148 148 for (db->dbm_hmask=0;; db->dbm_hmask=(db->dbm_hmask<<1)+1) { … … 233 233 } 234 234 return (0); 235 235 236 236 split: 237 237 if (key.dsize+dat.dsize+3*sizeof(short) >= PBLKSIZ) { … … 279 279 dbm_firstkey(DBM *db) 280 280 { 281 281 282 282 db->dbm_blkptr = 0L; 283 283 db->dbm_keyptr = 0; … … 290 290 struct stat statb; 291 291 datum item; 292 292 293 293 if (dbm_error(db) || fstat(db->dbm_pagf, &statb) < 0) 294 294 goto err; … … 348 348 long bn; 349 349 register b, i, n; 350 350 351 351 352 352 if (db->dbm_bitno > db->dbm_maxbno) … … 398 398 399 399 sp = (short *)buf; 400 if ((unsigned)n >= sp[0]) { 400 if ((unsigned)n >= (unsigned)sp[0]) 401 { 401 402 item.dptr = NULL; 402 403 item.dsize = 0; … … 483 484 register long hashl; 484 485 register int hashi; 485 486 486 487 hashl = 0; 487 488 hashi = 0; … … 504 505 { 505 506 register short *sp, *sp1; 506 register i 1, i2;507 register int i1, i2; 507 508 508 509 sp = (short *)buf; 509 510 i2 = sp[0]; 510 if ((unsigned)n >= i2 || (n & 1))511 if ((unsigned)n >= (unsigned)i2 || (n & 1)) 511 512 return (0); 512 if (n == i2-2) { 513 if (n == i2-2) 514 { 513 515 sp[0] -= 2; 514 516 return (1); -
Singular/polys-comp.h
r98aa53 re9ad8a6 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys-comp.h,v 1. 7 1998-04-30 15:29:34 obachmanExp $ */6 /* $Id: polys-comp.h,v 1.8 1998-06-02 15:30:01 Singular Exp $ */ 7 7 8 8 /*************************************************************** … … 25 25 } \ 26 26 while(0) 27 27 28 28 #define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE) \ 29 29 do \ … … 52 52 } \ 53 53 while(0) 54 54 55 55 #define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE) \ 56 56 do \ … … 70 70 } \ 71 71 while(0) 72 72 73 73 #define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 74 74 do \ … … 114 114 } \ 115 115 while(0) 116 116 117 117 #define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 118 118 do \ … … 145 145 } \ 146 146 while(0) 147 147 148 148 #define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE) \ 149 149 do \ … … 222 222 while(0) 223 223 224 224 225 225 #else // ! WORDS_BIGENDIAN 226 226 … … 233 233 } \ 234 234 while(0) 235 235 236 236 #define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE) \ 237 237 do \ … … 260 260 } \ 261 261 while(0) 262 262 263 263 #define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE) \ 264 264 do \ … … 280 280 } \ 281 281 while(0) 282 282 283 283 #define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 284 284 do \ … … 323 323 } \ 324 324 while(0) 325 325 326 326 #define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 327 327 do \ … … 354 354 } \ 355 355 while(0) 356 356 357 357 #define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE) \ 358 358 do \ … … 403 403 } \ 404 404 while(0) 405 405 406 406 #define _pMonComp_otEXPCOMP_nwGEN(p1, p2, length, d, actionD, actionE) \ 407 407 do \ -
Singular/polys-impl.h
r98aa53 re9ad8a6 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys-impl.h,v 1.2 1 1998-03-23 22:51:03 obachmanExp $ */6 /* $Id: polys-impl.h,v 1.22 1998-06-02 15:30:02 Singular Exp $ */ 7 7 8 8 /*************************************************************** … … 142 142 VarHighIndex = nvars - 1; 143 143 #else // ! WORDS_BIGENDIAN 144 temp *= sizeof(long)/sizeof(Exponent_t); 144 temp *= sizeof(long)/sizeof(Exponent_t); 145 145 VarHighIndex = temp -1; 146 146 VarLowIndex = temp - nvars; … … 153 153 pGetVarIndicies_Lex(nvars,pVarOffset,pVarCompIndex, \ 154 154 pVarLowIndex,pVarHighIndex) 155 155 156 156 157 157 … … 170 170 VarHighIndex = nvars-1; 171 171 #else // ! WORDS_BIGENDIAN 172 temp *= sizeof(long)/sizeof(Exponent_t); 172 temp *= sizeof(long)/sizeof(Exponent_t); 173 173 VarHighIndex = temp -1; 174 174 VarLowIndex = temp - nvars; … … 511 511 p1->coef = p2->coef; 512 512 p1->Order = Order; 513 513 514 514 for (;;) 515 515 { … … 554 554 const unsigned long* s2 = (unsigned long*) &(b->exp[0]); 555 555 #endif 556 556 557 557 for (;;) 558 558 { … … 625 625 /*************************************************************** 626 626 * 627 * Routines which implement low-level manipulations/operations 627 * Routines which implement low-level manipulations/operations 628 628 * on exponents and "are allowed" to access single exponetns 629 629 * -
Singular/polys.h
r98aa53 re9ad8a6 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys.h,v 1.1 4 1998-05-28 16:50:51Singular Exp $ */6 /* $Id: polys.h,v 1.15 1998-06-02 15:30:02 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT - all basic methods to manipulate polynomials … … 76 76 77 77 // Gets/Sets Component field w.r.t. of polys of global ring 78 #define pSetComp(p,k) _pSetComp(p,k) 78 #define pSetComp(p,k) _pSetComp(p,k) 79 79 #define pGetComp(p) _pGetComp(p) 80 80 #define pIncrComp(p) _pIncrComp(p) … … 84 84 85 85 // Gets/Sets Component field w.r.t. of polys of ring r 86 #define pRingSetComp(r,p,k) _pRingSetComp(r,p,k) 86 #define pRingSetComp(r,p,k) _pRingSetComp(r,p,k) 87 87 #define pRingGetComp(r,p) _pRingGetComp(r,p) 88 88 … … 96 96 97 97 // Increments/decrements ith exponent by one 98 #define pIncrExp(p,i) _pIncrExp(p,i) 99 #define pDecrExp(p,i) _pDecrExp(p,i) 98 #define pIncrExp(p,i) _pIncrExp(p,i) 99 #define pDecrExp(p,i) _pDecrExp(p,i) 100 100 101 101 // Gets Difference and sum of ith Exponent of m1, m2 … … 104 104 105 105 // Adds/Substracts v to/from the ith Exponent 106 #define pAddExp(p,i,v) _pAddExp(p,i,v) 107 #define pSubExp(p,i,v) _pSubExp(p,i,v) 106 #define pAddExp(p,i,v) _pAddExp(p,i,v) 107 #define pSubExp(p,i,v) _pSubExp(p,i,v) 108 108 #define pMultExp(p,i,v) _pMultExp(p,i,v) 109 109 … … 209 209 210 210 // return TRUE, if exponent and component of Lm(p1) and Lm(p2) are equal, 211 // FALSE otherwise; 211 // FALSE otherwise; 212 212 #define pEqual(p1, p2) _pEqual(p1, p2) // Assumes p1 != NULL & p2 != NULL 213 213 inline BOOLEAN pLmEqual(poly p1, poly p2) // no assumptions … … 265 265 void pCleardenom(poly p); 266 266 267 // homogenizes p by multiplying certain powers of the varnum-th variable 267 // homogenizes p by multiplying certain powers of the varnum-th variable 268 268 poly pHomogen (poly p, int varnum); 269 269 270 270 // replaces the maximal powers of the leading monomial of p2 in p1 by 271 271 // the same powers of n, utility for dehomogenization -
Singular/ring.h
r98aa53 re9ad8a6 7 7 * ABSTRACT - the interpreter related ring operations 8 8 */ 9 /* $Id: ring.h,v 1.1 4 1998-05-28 16:50:54Singular Exp $ */9 /* $Id: ring.h,v 1.15 1998-06-02 15:30:03 Singular Exp $ */ 10 10 11 11 /* includes */ … … 71 71 { 72 72 rOrderType_General = 0, // non-simple ordering as specified by currRing 73 rOrderType_CompExp, // simple ordering, component has priority 73 rOrderType_CompExp, // simple ordering, component has priority 74 74 rOrderType_ExpComp, // simple ordering, exponent vector has priority 75 75 // component not compatible with exp-vector order -
Singular/scanner.l
r98aa53 re9ad8a6 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 /* $Id: scanner.l,v 1.1 2 1998-04-07 08:30:32Singular Exp $ */5 /* $Id: scanner.l,v 1.13 1998-06-02 15:30:04 Singular Exp $ */ 6 6 #include <stdio.h> 7 7 #include <string.h> … … 28 28 static char * dupyytext() 29 29 { 30 //int i = strlen((char *)yytext);31 //if (i>0) yytext[i-1] = '\0';32 30 if (yyleng>0) yytext[yyleng-1] = '\0'; 33 31 return mstrdup((char *)yytext); … … 40 38 if (i>0) 41 39 { 42 yytext[i-1] = '\0'; 43 strcpy( rc, (char *)yytext ); 40 strncpy( rc, (char *)yytext, i-1 ); 44 41 } 45 42 else 43 { 46 44 i++; 45 } 47 46 rc[i-1] = '\n'; 48 47 rc[i] = '\n'; … … 93 92 \/\/[^\n]* { } 94 93 ^#![^\n]* { } 94 "/*" { 95 yy_noeof=noeof_comment; 96 loop 97 { 98 register int c; 99 while ( (c = yyinput()) != '*' && c != EOF ); 100 if ( c == '*' ) 101 { 102 while ( (c = yyinput()) == '*' ); 103 if ( c == '/' ) break; /* found the end */ 104 } 105 else 106 { 107 break; 108 } 109 } 110 yy_noeof=0; 111 } 95 112 pause[ \t\n]*[\.;] { fePause(); } 96 113 while { blocknest = 0; yy_noeof = noeof_brace; BEGIN(brace); … … 254 271 } 255 272 \$ { 256 #ifdef HAVE_TCL 257 if (tclmode) 258 PrintTCL('Q',0,NULL); 259 else 260 #endif 261 { if (BVERBOSE(0)) printf("\n$Bye.\n"); } 262 #ifndef macintosh 263 #ifdef HAVE_FEREAD 264 #ifdef HAVE_ATEXIT 265 fe_reset_input_mode(); 266 #else 267 fe_reset_input_mode(0,NULL); 268 #endif 269 #else 270 #ifdef HAVE_READLINE 271 fe_reset_input_mode(); 272 #endif 273 #endif 274 #endif 275 #ifdef sun 276 #ifndef __svr4__ 277 _cleanup(); 278 _exit(0); 279 #endif 280 #endif 281 exit(0); 273 m2_end(-1); 282 274 } 283 275 (quit|exit)[ \t\n]*[\.;]? { 284 #ifdef HAVE_TCL285 if (tclmode)286 PrintTCL('Q',0,NULL);287 else288 #endif289 276 #ifdef MM_STAT 290 277 mmStat(-500); 291 #endif292 { if (BVERBOSE(0)) printf("\nAuf Wiedersehen.\n"); }293 #ifndef macintosh294 #ifdef HAVE_FEREAD295 #ifdef HAVE_ATEXIT296 fe_reset_input_mode();297 #else298 fe_reset_input_mode(0,NULL);299 #endif300 #else301 #ifdef HAVE_READLINE302 fe_reset_input_mode();303 #endif304 #endif305 278 #endif 306 279 #ifdef MDEBUG … … 309 282 #endif 310 283 #endif 311 #ifdef sun 312 #ifndef __svr4__ 313 _cleanup(); 314 _exit(0); 315 #endif 316 #endif 317 exit(0); 284 m2_end(0); 318 285 } 319 286 -
Singular/silink.h
r98aa53 re9ad8a6 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: silink.h,v 1. 8 1997-08-12 17:14:43Singular Exp $ */6 /* $Id: silink.h,v 1.9 1998-06-02 15:30:04 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: general interface to links … … 38 38 { 39 39 si_link_extension m; // methods 40 char *mode; 41 char *name; // used for filename and/or further specs 40 char *mode; 41 char *name; // used for filename and/or further specs 42 42 void *data; // the link itself 43 43 BITSET flags; // 0=close open = 1: read = 2: write = 3 -
Singular/spSpolyLoop.h
r98aa53 re9ad8a6 17 17 spSpolyLoopProc spGetSpolyLoop(ring r, rOrderType_t ot, BOOLEAN homog); 18 18 19 inline spSpolyLoopProc spGetSpolyLoop(ring r, int modrank, int syzComp, 19 inline spSpolyLoopProc spGetSpolyLoop(ring r, int modrank, int syzComp, 20 20 BOOLEAN homog) 21 21 { … … 25 25 inline spSpolyLoopProc spGetSpolyLoop(ring r, kStrategy strat) 26 26 { 27 return spGetSpolyLoop(r, spGetOrderType(r, strat->ak, strat->syzComp), 28 ((strat->homog && strat->kModW==NULL && 27 return spGetSpolyLoop(r, spGetOrderType(r, strat->ak, strat->syzComp), 28 ((strat->homog && strat->kModW==NULL && 29 29 ! rHasSimpleLexOrder(r)))); 30 30 } … … 32 32 inline spSpolyLoopProc spGetSpolyLoop(ring r, kStrategy strat, int syzComp) 33 33 { 34 return spGetSpolyLoop(r, spGetOrderType(r, strat->ak, syzComp), 35 ((strat->homog && strat->kModW==NULL && 34 return spGetSpolyLoop(r, spGetOrderType(r, strat->ak, syzComp), 35 ((strat->homog && strat->kModW==NULL && 36 36 ! rHasSimpleLexOrder(r)))); 37 37 } -
Singular/structs.h
r98aa53 re9ad8a6 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: structs.h,v 1.1 1 1998-04-28 09:39:27 pohlExp $ */6 /* $Id: structs.h,v 1.12 1998-06-02 15:30:05 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 29 29 noeof_asstring, 30 30 noeof_block, 31 noeof_string,32 31 noeof_bracket, 33 noeof_procname 32 noeof_comment, 33 noeof_procname, 34 noeof_string 34 35 }; 35 36 -
Singular/tok.h
r98aa53 re9ad8a6 7 7 * ABSTRACT: token for interpreter, as types; general macros 8 8 */ 9 /* $Id: tok.h,v 1.1 7 1998-05-19 18:08:41Singular Exp $ */9 /* $Id: tok.h,v 1.18 1998-06-02 15:30:06 Singular Exp $ */ 10 10 11 11 #ifndef MYYSTYPE … … 29 29 #endif 30 30 31 #if defined(__cplusplus) 31 #if defined(__cplusplus) 32 32 inline int max(const int a, const int b) { return (a>b) ? a : b; } 33 33 inline int min(const int a, const int b) { return (a<b) ? a : b; }
Note: See TracChangeset
for help on using the changeset viewer.