Changeset 706c95 in git
- Timestamp:
- Jul 28, 1999, 7:51:08 PM (25 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- bb78517a1a700b9a02a09333203500c9bf99b4d5
- Parents:
- e82b5056a1be30c4e177376a20c03847146e8f11
- Location:
- Singular
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/random.lib
re82b505 r706c95 1 // $Id: random.lib,v 1. 8 1999-07-26 13:03:35Singular Exp $1 // $Id: random.lib,v 1.9 1999-07-28 17:51:08 Singular Exp $ 2 2 //system("random",787422842); 3 3 //(GMG/BM, last modified 22.06.96) 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: random.lib,v 1. 8 1999-07-26 13:03:35Singular Exp $";6 version="$Id: random.lib,v 1.9 1999-07-28 17:51:08 Singular Exp $"; 7 7 info=" 8 8 LIBRARY: random.lib PROCEDURES OF RANDOM MATRIX AND POLY OPERATIONS … … 258 258 " 259 259 { 260 ideal i = maxideal(1); 261 i[size(i)] = randomid(maxideal(1),1,b)[1]; 262 return(i); 260 ideal i=maxideal(1); 261 int k=size(i); 262 i[k]=0; 263 i=randomid(i,size(i),b); 264 ideal ires=maxideal(1); 265 ires[k]=i[1]+var(k); 266 return(ires); 263 267 } 264 268 example -
Singular/Makefile.in
re82b505 r706c95 67 67 CXXSOURCES=grammar.cc scanner.cc algmap.cc attrib.cc binom.cc clapconv.cc \ 68 68 clapmem.cc clapsing.cc claptmpl.cc cntrlc.cc \ 69 extra.cc febase.cc feread.cc \69 extra.cc febase.cc feread.cc fehelp.cc \ 70 70 ffields.cc hdegree.cc hilb.cc hutil.cc \ 71 71 ideals.cc intvec.cc iparith.cc \ … … 97 97 numbers.h stype.h clapconv.h ipconv.h maps.h page.h \ 98 98 subexpr.h clapsing.h ipid.h matpol.h polys.h syz.h \ 99 cntrlc.h ipprint.h ring.h timer.h sdb.h \99 cntrlc.h ipprint.h ring.h timer.h sdb.h fehelp.h \ 100 100 febase.h ipshell.h shortfl.h tok.h mpr_complex.h mpr_global.h \ 101 101 mmemory.h mmprivate.h mmheap.h mmpage.h page.h \ … … 121 121 122 122 OBJS=grammar.o scanner.o matpol.o binom.o mpr_complex.o gnumpfl.o gnumpc.o \ 123 febase.o feread.o timer.o intvec.o attrib.o lists.o\123 febase.o feread.o fehelp.o timer.o intvec.o attrib.o lists.o\ 124 124 longrat.o longrat0.o misc.o ring.o numbers.o maps.o\ 125 125 hilb.o comm.o kstd1.o kstd2.o kutil.o khstd.o kstdfac.o modulop.o spolys.o\ … … 354 354 355 355 OBJG1= grammar.og scanner.og matpol.og binom.og gnumpfl.og mpr_complex.og \ 356 febase.og feread.og timer.og intvec.og attrib.og lists.og gnumpc.og\357 longrat.og longrat0.og misc.og ring.og numbers.og maps.og\356 febase.og feread.og fehelp.og timer.og intvec.og attrib.og lists.og \ 357 gnumpc.og longrat.og longrat0.og misc.og ring.og numbers.og maps.og\ 358 358 hilb.og comm.og kstd1.og kstd2.og kutil.og khstd.og kstdfac.og modulop.og \ 359 359 spolys.og ideals.og subexpr.og hdegree.og hutil.og ffields.og shortfl.og \ … … 363 363 mminit.og sing_dld.og sing_dbm.og silink.og sparsmat.og\ 364 364 sing_mp.og fglm.og fglmzero.og fglmvec.og fglmgauss.og fglmhom.og\ 365 algmap.og clapconv.og clapmem.og clapsing.og \ 366 cntrlc.og sdb.og\ 365 algmap.og clapconv.og clapmem.og clapsing.og cntrlc.og sdb.og\ 367 366 mpsr_Error.og mpsr_Put.og mpsr_PutPoly.og mpsr_GetPoly.og \ 368 367 mpsr_Get.og mpsr_GetMisc.og \ … … 431 430 432 431 OBJP1= grammar.op scanner.op matpol.op binom.op gnumpfl.op mpr_complex.op \ 433 febase.op feread.op timer.op intvec.op attrib.op lists.op gnumpc.op \434 longrat.op longrat0.op misc.op ring.op numbers.op maps.op\432 febase.op feread.op fehelp.op timer.op intvec.op attrib.op lists.op \ 433 gnumpc.op longrat.op longrat0.op misc.op ring.op numbers.op maps.op\ 435 434 hilb.op comm.op kstd1.op kstd2.op kutil.op khstd.op kstdfac.op modulop.op \ 436 435 spolys.op ideals.op subexpr.op hdegree.op hutil.op ffields.op shortfl.op \ -
Singular/febase.h
re82b505 r706c95 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: febase.h,v 1.3 0 1999-07-20 12:29:48Singular Exp $ */6 /* $Id: febase.h,v 1.31 1999-07-28 17:51:05 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: basic i/o … … 214 214 #endif 215 215 #endif 216 #endif 217 #endif 216 #endif /* ifndef __MWERKS__ */ 218 217 219 218 /* everything in between calls to these procedures is printed into a string … … 222 221 void SPrintStart(); 223 222 char* SPrintEnd(); 223 #endif /* ifndef FEBASE_H */ -
Singular/grammar.y
re82b505 r706c95 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: grammar.y,v 1.6 6 1999-07-28 08:38:58Singular Exp $ */4 /* $Id: grammar.y,v 1.67 1999-07-28 17:51:06 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: SINGULAR shell grammatik … … 32 32 #include "intvec.h" 33 33 #include "febase.h" 34 #include "fehelp.h" 34 35 #include "matpol.h" 35 36 #include "ring.h" -
Singular/ipshell.h
re82b505 r706c95 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: ipshell.h,v 1.1 8 1999-07-09 14:58:28Singular Exp $ */6 /* $Id: ipshell.h,v 1.19 1999-07-28 17:51:07 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 168 168 /* ================================================================== */ 169 169 char * versionString(); 170 /* ================================================================== */ 171 void singular_example(char *str); 170 172 #endif 171 173 -
Singular/misc.cc
re82b505 r706c95 29 29 #define SI_DONT_HAVE_GLOBAL_VARS 30 30 31 #ifdef HAVE_LIBPARSER32 # include "libparse.h"33 #endif /* HAVE_LIBPARSER */31 //#ifdef HAVE_LIBPARSER 32 //# include "libparse.h" 33 //#endif /* HAVE_LIBPARSER */ 34 34 35 35 #ifdef HAVE_FACTORY … … 209 209 #endif 210 210 211 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/212 #define HELP_OK 0213 214 #ifdef buildin_help215 216 #define FIN_INDEX '\037'217 #define not !218 #define HELP_NOT_OPEN 1219 #define HELP_NOT_FOUND 2220 #ifndef macintosh221 #define Index_File SINGULAR_INFODIR "/singular.hlp"222 #define Help_File SINGULAR_INFODIR "/singular.hlp"223 #else224 #define Index_File SINGULAR_INFODIR "singular.hlp"225 #define Help_File SINGULAR_INFODIR "singular.hlp"226 #endif227 #define BUF_LEN 128228 #define IDX_LEN 64229 #define MAX_LINES 21230 231 static int compare(char *s1,char *s2)232 {233 for(;*s1==*s2;s1++,s2++)234 if(*s2=='\0') return(0);235 return(*s2);236 }237 238 #ifdef macintosh239 static char tolow(char p)240 #else241 static inline char tolow(char p)242 #endif243 {244 if (('A'<=p)&&(p<='Z')) return p | 040;245 return p;246 }247 248 /*************************************************/249 static int show(unsigned long offset,FILE *help, char *close)250 { char buffer[BUF_LEN+1];251 int lines = 0;252 253 if( help== NULL)254 if( (help = feFopen(Help_File, "r")) == NULL)255 return HELP_NOT_OPEN;256 257 fseek(help, (long)(offset+1), (int)0);258 while( !feof(help)259 && *fgets(buffer, BUF_LEN, help) != EOF260 && buffer[0] != FIN_INDEX)261 {262 printf("%s", buffer);263 if(lines++> MAX_LINES)264 {265 #ifdef macintosh266 printf("\n Press <RETURN> to continue or x and <RETURN> to exit help.\n");267 #else268 printf("\n Press <RETURN> to continue or x to exit help.\n");269 #endif270 fflush(stdout);271 *close = (char)getchar();272 if(*close=='x')273 {274 getchar();275 break;276 }277 lines=0;278 }279 }280 if(*close!='x')281 {282 #ifdef macintosh283 printf("\nEnd of part. Press <RETURN> to continue or x and <RETURN> to exit help.\n");284 #else285 printf("\nEnd of part. Press <RETURN> to continue or x to exit help.\n");286 #endif287 fflush(stdout);288 *close = (char)getchar();289 if(*close=='x')290 getchar();291 }292 return HELP_OK;293 }294 295 /*************************************************/296 int singular_manual(char *str)297 { FILE *index=NULL,*help=NULL;298 unsigned long offset;299 char *p,close;300 int done = 0;301 char buffer[BUF_LEN+1],302 Index[IDX_LEN+1],303 String[IDX_LEN+1];304 305 if( (index = feFopen(Index_File, "r",NULL,TRUE)) == NULL)306 {307 return HELP_NOT_OPEN;308 }309 310 for(p=str; *p; p++) *p = tolow(*p);/* */311 do312 {313 p--;314 }315 while ((p != str) && (*p<=' '));316 p++;317 *p='\0';318 (void)sprintf(String, " %s ", str);319 320 while(!feof(index)321 && fgets(buffer, BUF_LEN, index) != (char *)0322 && buffer[0] != FIN_INDEX);323 324 while(!feof(index))325 {326 (void)fgets(buffer, BUF_LEN, index); /* */327 (void)sscanf(buffer, "Node:%[^\177]\177%ld\n", Index, &offset);328 for(p=Index; *p; p++) *p = tolow(*p);/* */329 (void)strcat(Index, " ");330 if( strstr(Index, String)!=NULL)331 {332 done++; (void)show(offset, help, &close);333 }334 Index[0]='\0';335 if(close=='x')336 break;337 }338 (void)fclose(index);339 (void)fclose(help);340 if(not done)341 {342 Warn("`%s` not found",String);343 return HELP_NOT_FOUND;344 }345 return HELP_OK;346 }347 #endif // buildin_help348 /*************************************************/349 350 void singular_help(char *str)351 {352 char *s=str;353 while (*s==' ') s++;354 char *ss=s;355 while (*ss!='\0') ss++;356 while (*ss<=' ')357 {358 *ss='\0';359 ss--;360 }361 #ifdef HAVE_NAMESPACES362 idhdl h, ns;363 iiname2hdl(s, &ns, &h);364 #else /* HAVE_NAMESPACES */365 /* --------- is it a proc ? --------------------------------*/366 idhdl h=idroot->get(s,myynest);367 #endif /* HAVE_NAMESPACES */368 if ((h!=NULL) && (IDTYP(h)==PROC_CMD)369 && (strcmp(IDPROC(h)->libname, "standard.lib")!=0))370 {371 char *lib=iiGetLibName(IDPROC(h));372 if((lib!=NULL)&&(*lib!='\0'))373 {374 Print("// proc %s from lib %s\n",s,lib);375 s=iiGetLibProcBuffer(IDPROC(h), 0);376 PrintS(s);377 FreeL((ADDRESS)s);378 }379 }380 else381 {382 /* --------- is it a library ? --------------------------------*/383 char libnamebuf[128];384 FILE *fp=NULL;385 if ((str[1]!='\0')386 && ((fp=feFopen(str,"rb", libnamebuf))!=NULL))387 {388 #ifdef HAVE_LIBPARSER389 extern FILE *yylpin;390 lib_style_types lib_style; // = OLD_LIBSTYLE;391 392 yylpin = fp;393 # ifdef HAVE_NAMESPACES394 yylplex(str, libnamebuf, &lib_style, IDROOT, FALSE, GET_INFO);395 # else /* HAVE_NAMESPACES */396 yylplex(str, libnamebuf, &lib_style, GET_INFO);397 # endif /* HAVE_NAMESPACES */398 reinit_yylp();399 if(lib_style == OLD_LIBSTYLE)400 {401 char buf[256];402 fseek(fp, 0, SEEK_SET);403 #else /* HAVE_LIBPARSER */404 { char buf[256];405 #endif /* HAVE_LIBPARSER */406 Warn( "library %s has an old format. Please fix it for the next time",407 str);408 BOOLEAN found=FALSE;409 while (fgets( buf, sizeof(buf), fp))410 {411 if (strncmp(buf,"//",2)==0)412 {413 if (found) return;414 }415 else if ((strncmp(buf,"proc ",5)==0)||(strncmp(buf,"LIB ",4)==0))416 {417 if (!found) Warn("no help part in library found");418 return;419 }420 else421 {422 found=TRUE;423 PrintS(buf);424 }425 }426 }427 #ifdef HAVE_LIBPARSER428 else429 {430 fclose( yylpin );431 PrintS(text_buffer);432 FreeL(text_buffer);433 text_buffer=NULL;434 }435 #endif /* HAVE_LIBPARSER */436 }437 /* --------- everything else is for the manual ----------------*/438 else439 {440 #ifdef HAVE_TCL441 if(!tclmode)442 #endif443 #ifdef buildin_help444 singular_manual(str);445 #else446 system(feGetInfoCall(str));447 #ifndef MSDOS448 //sprintf(tmp,"clear");449 //system(tmp);450 #endif451 #endif452 }453 }454 }455 456 211 void singular_example(char *str) 457 212 { -
Singular/structs.h
re82b505 r706c95 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: structs.h,v 1.2 1 1999-07-28 08:39:00Singular Exp $ */6 /* $Id: structs.h,v 1.22 1999-07-28 17:51:07 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 200 200 #ifdef __cplusplus 201 201 int inits(void); 202 void singular_help(char *str);203 void singular_example(char *str);204 #ifdef buildin_help205 int singular_manual(char *str);206 #endif207 202 #ifdef buildin_rand 208 203 extern int siSeed;
Note: See TracChangeset
for help on using the changeset viewer.