Changeset 4508ce5 in git
- Timestamp:
- Dec 15, 2000, 7:49:36 PM (22 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
- Children:
- a5f564c88c2600acb20b8afdd6dd84d9d3f715df
- Parents:
- d3bf0986c4b1a7bac5ffc43b873646317a0d91de
- Location:
- Singular
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/algmap.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: algmap.cc,v 1.2 1 2000-12-08 14:47:44Singular Exp $ */4 /* $Id: algmap.cc,v 1.22 2000-12-15 18:49:27 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - the mapping of polynomials from rings with … … 309 309 p0 = preimage; 310 310 poly pr=NULL; 311 nMap=maNumberOne;312 311 while (p0!=NULL) 313 312 { 314 313 poly pr=pNext(p0); 315 314 p0->next=NULL; 316 monpart = maEval((map)G, p0, R );315 monpart = maEval((map)G, p0, R, maNumberOne); 317 316 result = maLongalgMap(result, R, p0, s, t, &nom, monpart, F); 318 317 pTest(result); -
Singular/ffields.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ffields.cc,v 1.2 8 2000-12-05 11:15:08 obachmanExp $ */4 /* $Id: ffields.cc,v 1.29 2000-12-15 18:49:27 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: finite fields with a none-prime number of elements (via tables) … … 699 699 * set map function nMap ... -> GF(p,n) 700 700 */ 701 BOOLEAN nfSetMap(ring r) 702 { 703 if (rField_is_GF(r,nfCharQ)) 704 { 705 nMap=ndCopy; /* GF(p,n) -> GF(p,n) */ 706 return TRUE; 707 } 708 if (rField_is_Zp(r,nfCharP)) 709 { 710 nMap=nfMapP; /* Z/p -> GF(p,n) */ 711 return TRUE; 712 } 713 return FALSE; /* default */ 714 } 701 nMapFunc nfSetMap(ring src, ring dst) 702 { 703 if (rField_is_GF(src,nfCharQ)) 704 { 705 return ndCopy; /* GF(p,n) -> GF(p,n) */ 706 } 707 if (rField_is_Zp(src,nfCharP)) 708 { 709 return nfMapP; /* Z/p -> GF(p,n) */ 710 } 711 return NULL; /* default */ 712 } -
Singular/ffields.h
rd3bf098 r4508ce5 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: ffields.h,v 1. 8 1999-11-15 17:19:59 obachmanExp $ */6 /* $Id: ffields.h,v 1.9 2000-12-15 18:49:27 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: finite fields with a none-prime number of elements (via tables) … … 35 35 void nfSetChar (int c, char ** param); 36 36 37 BOOLEAN nfSetMap (ring r);37 nMapFunc nfSetMap (ring src, ring dst); 38 38 char * nfName (number n); 39 39 extern int nfMinPoly[]; -
Singular/fglm.cc
rd3bf098 r4508ce5 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglm.cc,v 1.2 3 2000-12-06 11:03:09Singular Exp $2 // $Id: fglm.cc,v 1.24 2000-12-15 18:49:28 Singular Exp $ 3 3 4 4 /**************************************** … … 172 172 // check if sring->qideal is contained in dring->qideal: 173 173 rSetHdl( dringHdl ); 174 //nSetMap( rInternalChar(sring), sring->parameter, npar, sring->minpoly ); 175 nSetMap( sring ); 174 nMapFunc nMap=nSetMap( sring ); 176 175 ideal sqind = idInit( IDELEMS( sring->qideal ), 1 ); 177 176 for ( k= IDELEMS( sring->qideal )-1; k >= 0; k-- ) 178 (sqind->m)[k]= pPermPoly( (sring->qideal->m)[k], vperm, sring);177 (sqind->m)[k]= pPermPoly( (sring->qideal->m)[k], vperm, sring, nMap); 179 178 ideal sqindred = kNF( dring->qideal, NULL, sqind ); 180 179 if ( ! idIs0( sqindred ) ) { … … 190 189 maFindPerm( dring->names, nvar, NULL, 0, sring->names, nvar, NULL, 0, 191 190 dsvperm, NULL, sring->ch); 192 //nSetMap(rInternalChar(dring), dring->parameter, npar, dring->minpoly); 193 nSetMap(dring); 191 nMap=nSetMap(dring); 194 192 ideal dqins = idInit( IDELEMS( dring->qideal ), 1 ); 195 193 for ( k= IDELEMS( dring->qideal )-1; k >= 0; k-- ) 196 (dqins->m)[k]= pPermPoly( (dring->qideal->m)[k], dsvperm, sring);194 (dqins->m)[k]=pPermPoly( (dring->qideal->m)[k], dsvperm, sring, nMap); 197 195 ideal dqinsred = kNF( sring->qideal, NULL, dqins ); 198 196 if ( ! idIs0( dqinsred ) ) { -
Singular/fglmzero.cc
rd3bf098 r4508ce5 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglmzero.cc,v 1.3 1 2000-12-06 11:03:09Singular Exp $2 // $Id: fglmzero.cc,v 1.32 2000-12-15 18:49:28 Singular Exp $ 3 3 4 4 /**************************************** … … 144 144 maFindPerm( source->names, source->N, NULL, 0, currRing->names, 145 145 currRing->N, NULL, 0, perm, NULL , currRing->ch); 146 //nSetMap( rInternalChar(source), source->parameter, source->P, 147 // source->minpoly ); 148 nSetMap( source); 146 nMapFunc nMap=nSetMap( source); 149 147 150 148 matHeader ** temp = (matHeader **)omAlloc( _nfunc*sizeof( matHeader * )); -
Singular/gnumpc.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: gnumpc.cc,v 1.1 5 2000-12-13 17:49:37Singular Exp $ */4 /* $Id: gnumpc.cc,v 1.16 2000-12-15 18:49:28 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computations with GMP complex floating-point numbers … … 34 34 } 35 35 36 BOOLEAN ngcSetMap(ring r) 37 { 38 if (rField_is_long_C(r)) 39 { 40 nMap=ngcCopy; 41 return TRUE; 42 } 43 if(rField_is_Q(r)) 44 { 45 nMap = ngcMapQ; 46 return TRUE; 47 } 48 return FALSE; 36 nMapFunc ngcSetMap(ring src,ring dst) 37 { 38 if (rField_is_long_C(src)) 39 { 40 return ngcCopy; 41 } 42 if(rField_is_Q(src)) 43 { 44 return ngcMapQ; 45 } 46 return NULL; 49 47 } 50 48 -
Singular/gnumpc.h
rd3bf098 r4508ce5 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: gnumpc.h,v 1. 6 2000-12-13 17:49:37Singular Exp $ */6 /* $Id: gnumpc.h,v 1.7 2000-12-15 18:49:29 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: computations with GMP floating-point numbers … … 42 42 #endif 43 43 44 BOOLEAN ngcSetMap(ring r);44 nMapFunc ngcSetMap(ring src, ring dst); 45 45 46 46 #endif -
Singular/gnumpfl.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: gnumpfl.cc,v 1.1 6 2000-09-18 09:18:59 obachmanExp $ */4 /* $Id: gnumpfl.cc,v 1.17 2000-12-15 18:49:29 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computations with GMP floating-point numbers … … 43 43 } 44 44 45 BOOLEAN ngfSetMap(ring r) 46 { 47 if (rField_is_Q(r)) 48 { 49 nMap = ngfMapQ; 50 return TRUE; 51 } 52 else if (rField_is_Zp(r)) 53 { 54 nMap = ngfMapP; 55 return TRUE; 56 } 57 else if (rField_is_long_R(r)) 58 { 59 nMap = ngfCopy; 60 return TRUE; 61 } 62 return FALSE; 45 nMapFunc ngfSetMap(ring src, ring dst) 46 { 47 if (rField_is_Q(src)) 48 { 49 return ngfMapQ; 50 } 51 else if (rField_is_Zp(src)) 52 { 53 return ngfMapP; 54 } 55 else if (rField_is_long_R(src)) 56 { 57 return ngfCopy; 58 } 59 return NULL; 63 60 } 64 61 -
Singular/gnumpfl.h
rd3bf098 r4508ce5 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: gnumpfl.h,v 1. 6 2000-06-30 11:23:00 pohlExp $ */6 /* $Id: gnumpfl.h,v 1.7 2000-12-15 18:49:29 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: computations with GMP floating-point numbers … … 38 38 #endif 39 39 40 BOOLEAN ngfSetMap(ring r);40 nMapFunc ngfSetMap(ring src, ring dst); 41 41 42 42 void setGMPFloatDigits( size_t digits ); -
Singular/iparith.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iparith.cc,v 1.24 0 2000-12-13 17:49:37Singular Exp $ */4 /* $Id: iparith.cc,v 1.241 2000-12-15 18:49:29 Singular Exp $ */ 5 5 6 6 /* … … 1620 1620 idhdl w; 1621 1621 int op=iiOp; 1622 nMapFunc nMap; 1622 1623 1623 1624 if ((w=r->idroot->get(v->Name(),myynest))!=NULL) … … 1628 1629 BOOLEAN bo; 1629 1630 //if (!nSetMap(rInternalChar(r),r->parameter,rPar(r),r->minpoly)) 1630 if ( !nSetMap(r))1631 if ((nMap=nSetMap(r))==NULL) 1631 1632 { 1632 1633 if (rEqual(r,currRing)) … … 1693 1694 tmpW.data=IDDATA(w); 1694 1695 if ((bo=maApplyFetch(op,NULL,res,&tmpW, r, 1695 perm,par_perm,par_perm_size )))1696 perm,par_perm,par_perm_size,nMap))) 1696 1697 { 1697 1698 Werror("cannot map %s of type %s(%d)",v->name, Tok2Cmdname(w->typ),w->typ); -
Singular/ipshell.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipshell.cc,v 1.5 8 2000-12-06 11:03:18Singular Exp $ */4 /* $Id: ipshell.cc,v 1.59 2000-12-15 18:49:31 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 591 591 leftv v; 592 592 int i; 593 nMapFunc nMap; 593 594 594 595 #ifdef HAVE_NAMESPACES … … 601 602 if ((r!=NULL) && ((r->typ == RING_CMD) || (r->typ== QRING_CMD))) 602 603 { 603 //if ( !nSetMap(rInternalChar(IDRING(r)),604 //if ((nMap=nSetMap(rInternalChar(IDRING(r)), 604 605 // IDRING(r)->parameter, 605 606 // rPar(IDRING(r)), 606 // IDRING(r)->minpoly)) 607 if ( !nSetMap(IDRING(r)))607 // IDRING(r)->minpoly))) 608 if ((nMap=nSetMap(IDRING(r)))==NULL) 608 609 { 609 610 if (rEqual(IDRING(r),currRing)) … … 638 639 tmpW.rtyp=IDTYP(w); 639 640 tmpW.data=IDDATA(w); 640 if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,IDRING(r),NULL,NULL,0 ))641 if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,IDRING(r),NULL,NULL,0,nMap)) 641 642 { 642 643 Werror("cannot map %s(%d)",Tok2Cmdname(w->typ),w->typ); -
Singular/longalg.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longalg.cc,v 1.5 1 2000-12-08 16:20:33Singular Exp $ */4 /* $Id: longalg.cc,v 1.52 2000-12-15 18:49:31 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: algebraic numbers … … 2412 2412 } 2413 2413 2414 BOOLEAN naSetMap(ring r) 2415 { 2416 if (rField_is_Q_a()) /* -> Q(a) */ 2417 { 2418 if (rField_is_Q(r)) 2419 { 2420 nMap = naMap00; /*Q -> Q(a)*/ 2421 return TRUE; 2422 } 2423 if (rField_is_Zp(r)) 2424 { 2425 naPrimeM = rChar(r); 2426 nMap = naMapP0; /* Z/p -> Q(a)*/ 2427 return TRUE; 2428 } 2429 if (rField_is_Q_a(r)) 2414 nMapFunc naSetMap(ring src, ring dst) 2415 { 2416 if (rField_is_Q_a(dst)) /* -> Q(a) */ 2417 { 2418 if (rField_is_Q(src)) 2419 { 2420 return naMap00; /*Q -> Q(a)*/ 2421 } 2422 if (rField_is_Zp(src)) 2423 { 2424 naPrimeM = rChar(src); 2425 return naMapP0; /* Z/p -> Q(a)*/ 2426 } 2427 if (rField_is_Q_a(src)) 2430 2428 { 2431 2429 int i; 2432 2430 naParsToCopy=0; 2433 for(i=0;i<rPar( r);i++)2434 { 2435 if ((i>=rPar( currRing))2436 ||(strcmp( r->parameter[i],currRing->parameter[i])!=0))2437 return FALSE;2431 for(i=0;i<rPar(src);i++) 2432 { 2433 if ((i>=rPar(dst)) 2434 ||(strcmp(src->parameter[i],dst->parameter[i])!=0)) 2435 return NULL; 2438 2436 naParsToCopy++; 2439 2437 } 2440 2438 nacMap=nacCopy; 2441 nMap=naMapQaQb; 2442 return TRUE; /* Q(a) -> Q(a) */ 2439 return naMapQaQb; /* Q(a) -> Q(a) */ 2443 2440 } 2444 2441 } 2445 2442 /*-----------------------------------------------------*/ 2446 if (rField_is_Zp_a()) /* -> Z/p(a) */ 2447 { 2448 if (rField_is_Q(r)) 2449 { 2450 nMap = naMap0P; /*Q -> Z/p(a)*/ 2451 return TRUE; 2452 } 2453 if (rField_is_Zp(r)) 2454 { 2455 int c=rChar(r); 2443 if (rField_is_Zp_a(dst)) /* -> Z/p(a) */ 2444 { 2445 if (rField_is_Q(src)) 2446 { 2447 return naMap0P; /*Q -> Z/p(a)*/ 2448 } 2449 if (rField_is_Zp(src)) 2450 { 2451 int c=rChar(src); 2456 2452 if (c==npPrimeM) 2457 2453 { 2458 nMap =naMapPP; /* Z/p -> Z/p(a)*/2454 return naMapPP; /* Z/p -> Z/p(a)*/ 2459 2455 } 2460 2456 else 2461 2457 { 2462 2458 naPrimeM = c; 2463 nMap = naMapPP1; /* Z/p' -> Z/p(a)*/ 2464 } 2465 return TRUE; 2466 } 2467 if (rField_is_Zp_a(r)) 2468 { 2469 if (rChar(r)==rChar()) 2459 return naMapPP1; /* Z/p' -> Z/p(a)*/ 2460 } 2461 } 2462 if (rField_is_Zp_a(src)) 2463 { 2464 if (rChar(src)==rChar(dst)) 2470 2465 { 2471 2466 nacMap=nacCopy; … … 2473 2468 else 2474 2469 { 2475 npMapPrime=rChar( r);2470 npMapPrime=rChar(src); 2476 2471 nacMap = npMapP; 2477 2472 } 2478 2473 int i; 2479 2474 naParsToCopy=0; 2480 for(i=0;i<rPar( r);i++)2481 { 2482 if ((i>=rPar( currRing))2483 ||(strcmp( r->parameter[i],currRing->parameter[i])!=0))2484 return FALSE;2475 for(i=0;i<rPar(src);i++) 2476 { 2477 if ((i>=rPar(dst)) 2478 ||(strcmp(src->parameter[i],dst->parameter[i])!=0)) 2479 return NULL; 2485 2480 naParsToCopy++; 2486 2481 } 2487 nMap=naMapQaQb; 2488 return TRUE; /* Z/p(a),Z/p'(a) -> Z/p(b)*/ 2489 } 2490 } 2491 return FALSE; /* default */ 2482 return naMapQaQb; /* Z/p(a),Z/p'(a) -> Z/p(b)*/ 2483 } 2484 } 2485 return NULL; /* default */ 2492 2486 } 2493 2487 -
Singular/longalg.h
rd3bf098 r4508ce5 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: longalg.h,v 1.2 3 2000-12-08 16:20:33Singular Exp $ */6 /* $Id: longalg.h,v 1.24 2000-12-15 18:49:32 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: algebraic numbers … … 77 77 void naWrite(number &p); 78 78 char * naName(number n); 79 BOOLEAN naSetMap(ring r);79 nMapFunc naSetMap(ring src, ring dst); 80 80 #ifdef LDEBUG 81 81 BOOLEAN naDBTest(number a, char *f,int l); -
Singular/longrat.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longrat.cc,v 1.3 3 2000-09-25 10:44:48 obachmanExp $ */4 /* $Id: longrat.cc,v 1.34 2000-12-15 18:49:32 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computation with long rational numbers (Hubert Grassmann) … … 124 124 static number nlMapR(number from); 125 125 126 BOOLEAN nlSetMap(ring r) 127 { 128 if (rField_is_Q(r)) 129 { 130 nMap = nlCopy; /*Q -> Q*/ 131 return TRUE; 132 } 133 if (rField_is_Zp(r)) 134 { 135 nlPrimeM=rChar(r); 136 nMap = nlMapP; /* Z/p -> Q */ 137 return TRUE; 138 } 139 if (rField_is_R(r)) 140 { 141 nMap = nlMapR; /* short R -> Q */ 142 return TRUE; 126 nMapFunc nlSetMap(ring src, ring dst) 127 { 128 if (rField_is_Q(src)) 129 { 130 return nlCopy; 131 } 132 if (rField_is_Zp(src)) 133 { 134 nlPrimeM=rChar(src); 135 return nlMapP; 136 } 137 if (rField_is_R(src)) 138 { 139 return nlMapR; 143 140 } 144 141 // if (rField_is_long_R(r)) … … 147 144 // return TRUE; 148 145 // } 149 return FALSE;146 return NULL; 150 147 } 151 148 -
Singular/longrat.h
rd3bf098 r4508ce5 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: longrat.h,v 1.1 8 2000-09-20 13:25:41 obachmanExp $ */6 /* $Id: longrat.h,v 1.19 2000-12-15 18:49:33 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: computation with long rational numbers … … 100 100 #endif 101 101 102 BOOLEAN nlSetMap(ring r);102 nMapFunc nlSetMap(ring src, ring dst); 103 103 104 104 #ifndef OM_ALLOC_H -
Singular/maps.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: maps.cc,v 1.3 1 2000-12-08 16:21:31Singular Exp $ */4 /* $Id: maps.cc,v 1.32 2000-12-15 18:49:33 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - the mapping of polynomials to other rings … … 87 87 } 88 88 89 poly maEvalMonom(map theMap, poly p,ring preimage_r,matrix s)89 static poly maEvalMonom(map theMap, poly p,ring preimage_r,matrix s, nMapFunc nMap) 90 90 { 91 91 poly q=pOne(); … … 116 116 } 117 117 118 poly maEval(map theMap, poly p,ring preimage_r, matrix s)118 poly maEval(map theMap, poly p,ring preimage_r,nMapFunc nMap,matrix s) 119 119 { 120 120 poly result = NULL; … … 141 141 for (i=0; i<l; i++) 142 142 { 143 monoms[i]=maEvalMonom(theMap,p,preimage_r,s );143 monoms[i]=maEvalMonom(theMap,p,preimage_r,s, nMap); 144 144 pIter(p); 145 145 } 146 146 } 147 result=maEvalMonom(theMap,p,preimage_r,s );147 result=maEvalMonom(theMap,p,preimage_r,s, nMap); 148 148 if (l>0) 149 149 { … … 396 396 /* the simplest case:*/ 397 397 if(r==currRing) return pCopy(p); 398 //nSetMap(rInternalChar(r),r->parameter,rPar(r),r->minpoly); 399 nSetMap(r); 398 nMapFunc nMap=nSetMap(r); 400 399 int *perm=(int *)omAlloc0((r->N+1)*sizeof(int)); 401 400 //int *par_perm=(int *)omAlloc0(rPar(r)*sizeof(int)); … … 403 402 currRing->names,currRing->N,currRing->parameter, currRing->P, 404 403 perm,NULL, currRing->ch); 405 poly res=pPermPoly(p,perm,r /*,par_perm,rPar(r)*/);404 poly res=pPermPoly(p,perm,r, nMap /*,par_perm,rPar(r)*/); 406 405 omFreeSize((ADDRESS)perm,(r->N+1)*sizeof(int)); 407 406 //omFreeSize((ADDRESS)par_perm,rPar(r)*sizeof(int)); … … 489 488 */ 490 489 BOOLEAN maApplyFetch(int what,map theMap,leftv res, leftv w, ring preimage_r, 491 int *perm, int *par_perm, int P )490 int *perm, int *par_perm, int P, nMapFunc nMap) 492 491 { 493 492 int i; … … 530 529 else 531 530 if ((what==IMAP_CMD) || ((what==FETCH_CMD) /* && (nMap!=nCopy)*/)) 532 res->data=(void *)pPermPoly((poly)data,perm,preimage_r, par_perm,P);531 res->data=(void *)pPermPoly((poly)data,perm,preimage_r,nMap,par_perm,P); 533 532 else /*if (what==MAP_CMD)*/ 534 533 { 535 534 matrix s=mpNew(N,maMaxDeg_P((poly)data, preimage_r)); 536 res->data=(void *)maEval(theMap,(poly)data,preimage_r, s);535 res->data=(void *)maEval(theMap,(poly)data,preimage_r,nMap,s); 537 536 idDelete((ideal *)&s); 538 537 } … … 570 569 for (i=R*C-1;i>=0;i--) 571 570 { 572 m->m[i]=pPermPoly(((ideal)data)->m[i],perm,preimage_r, par_perm,P);571 m->m[i]=pPermPoly(((ideal)data)->m[i],perm,preimage_r,nMap,par_perm,P); 573 572 pTest(m->m[i]); 574 573 } … … 579 578 for (i=R*C-1;i>=0;i--) 580 579 { 581 m->m[i]=maEval(theMap,((ideal)data)->m[i],preimage_r, s);580 m->m[i]=maEval(theMap,((ideal)data)->m[i],preimage_r,nMap,s); 582 581 pTest(m->m[i]); 583 582 } … … 617 616 { 618 617 if (maApplyFetch(what,theMap,&ml->m[i],&l->m[i], 619 preimage_r,perm,par_perm,P ))618 preimage_r,perm,par_perm,P,nMap)) 620 619 { 621 620 ml->Clean(); -
Singular/maps.h
rd3bf098 r4508ce5 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: maps.h,v 1. 8 1999-11-15 17:20:21 obachmanExp $ */6 /* $Id: maps.h,v 1.9 2000-12-15 18:49:33 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT - the mapping of polynomials to other rings … … 10 10 #include "structs.h" 11 11 12 poly maEval(map theMap, poly p, ring preimage_r, matrix s=NULL);12 poly maEval(map theMap, poly p, ring preimage_r, nMapFunc nMap,matrix s=NULL); 13 13 map maCopy(map theMap); 14 14 … … 19 19 BOOLEAN maApplyFetch(int what,map theMap,leftv res, leftv w, 20 20 ring preimage_r, int *perm, 21 int *par_perm,int P );21 int *par_perm,int P, nMapFunc nMap); 22 22 void maFindPerm(char **preim_names, int preim_n, char **preim_par, int preim_p, 23 23 char **names, int n, char **par, int nop, -
Singular/modulop.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: modulop.cc,v 1.2 2 2000-12-06 11:03:20Singular Exp $ */4 /* $Id: modulop.cc,v 1.23 2000-12-15 18:49:34 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: numbers modulo p (<=32003) … … 318 318 } 319 319 320 BOOLEAN npSetMap(ring r) 321 { 322 if (rField_is_Q(r)) 323 { 324 nMap = npMap0; /*Q -> Z/p*/ 325 return TRUE; 326 } 327 if ( rField_is_Zp(r) ) 328 { 329 if (rChar(r) == npPrimeM) 330 { 331 nMap = ndCopy; /* Z/p -> Z/p*/ 332 return TRUE; 320 nMapFunc npSetMap(ring src, ring dst) 321 { 322 if (rField_is_Q(src)) 323 { 324 return npMap0; 325 } 326 if ( rField_is_Zp(src) ) 327 { 328 if (rChar(src) == rChar(dst)) 329 { 330 return ndCopy; 333 331 } 334 332 else 335 333 { 336 npMapPrime=rChar(r); 337 nMap = npMapP; /* Z/p' -> Z/p */ 338 return TRUE; 339 } 340 } 341 return FALSE; /* default */ 342 } 334 npMapPrime=rChar(src); 335 return npMapP; 336 } 337 } 338 return NULL; /* default */ 339 } -
Singular/modulop.h
rd3bf098 r4508ce5 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: modulop.h,v 1.1 2 2000-11-25 20:30:18 obachmanExp $ */6 /* $Id: modulop.h,v 1.13 2000-12-15 18:49:34 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: numbers modulo p (<=32003) … … 42 42 //int npGetChar(); 43 43 44 BOOLEAN npSetMap(ring r);44 nMapFunc npSetMap(ring src, ring dst); 45 45 number npMapP(number from); 46 46 /*-------specials for spolys, do NOT use otherwise--------------------------*/ -
Singular/mpsr_GetMisc.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpsr_GetMisc.cc,v 1.2 4 2000-12-12 08:44:48 obachmanExp $ */4 /* $Id: mpsr_GetMisc.cc,v 1.25 2000-12-15 18:49:34 Singular Exp $ */ 5 5 6 6 /*************************************************************** … … 267 267 number nn = (number) l->data; 268 268 mpsr_SetCurrRing(to_ring, TRUE); 269 //nSetMap(rInternalChar(from_ring), from_ring->parameter, 270 // rPar(from_ring), from_ring->minpoly); 271 nSetMap(from_ring); 269 nMapFunc nMap=nSetMap(from_ring); 272 270 l->data = (void *) nMap(nn); 273 271 mpsr_SetCurrRing(from_ring, FALSE); -
Singular/numbers.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: numbers.cc,v 1.3 2 2000-12-13 17:49:39Singular Exp $ */4 /* $Id: numbers.cc,v 1.33 2000-12-15 18:49:34 Singular Exp $ */ 5 5 6 6 /* … … 51 51 number (*nGetDenom)(number &n); 52 52 numberfunc nGcd,nLcm; 53 BOOLEAN (*nSetMap)(ring r);54 number (*nMap)(number from);55 53 char * (*nName)(number n); 56 54 #ifdef LDEBUG … … 180 178 nGcd = r->cf->nGcd; 181 179 nLcm = r->cf->nLcm; 182 nSetMap = r->cf->nSetMap;183 180 nName= r->cf->nName; 184 181 nSize = r->cf->nSize; -
Singular/numbers.h
rd3bf098 r4508ce5 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: numbers.h,v 1.2 2 2000-12-13 17:49:39Singular Exp $ */6 /* $Id: numbers.h,v 1.23 2000-12-15 18:49:35 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: interface to coefficient aritmetics … … 67 67 #endif 68 68 69 extern BOOLEAN (*nSetMap)(ring r); 70 extern number (*nMap)(number from); 69 #define nSetMap(R) (currRing->cf->nSetMap(R,currRing)) 71 70 extern char * (*nName)(number n); 72 71 -
Singular/polys.h
rd3bf098 r4508ce5 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys.h,v 1. 49 2000-12-07 12:22:42Singular Exp $ */6 /* $Id: polys.h,v 1.50 2000-12-15 18:49:35 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT - all basic methods to manipulate polynomials of the … … 346 346 poly pOrdPolyMerge(poly p); 347 347 348 poly pPermPoly (poly p, int * perm, ring OldRing, 348 poly pPermPoly (poly p, int * perm, ring OldRing, nMapFunc nMap, 349 349 int *par_perm=NULL, int OldPar=0); 350 350 -
Singular/polys1.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys1.cc,v 1.5 7 2000-12-08 16:20:03Singular Exp $ */4 /* $Id: polys1.cc,v 1.58 2000-12-15 18:49:35 Singular Exp $ */ 5 5 6 6 /* … … 809 809 *returns a re-ordered copy of a polynomial, with permutation of the variables 810 810 */ 811 poly pPermPoly (poly p, int * perm, ring oldRing, 811 poly pPermPoly (poly p, int * perm, ring oldRing, nMapFunc nMap, 812 812 int *par_perm, int OldPar) 813 813 { -
Singular/shortfl.cc
rd3bf098 r4508ce5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: shortfl.cc,v 1.1 4 1999-11-15 17:20:47 obachmanExp $ */4 /* $Id: shortfl.cc,v 1.15 2000-12-15 18:49:36 Singular Exp $ */ 5 5 6 6 /* … … 422 422 } 423 423 424 BOOLEAN nrSetMap(ring r) 425 { 426 if (rField_is_R(r)) 427 { 428 nMap=ndCopy; 429 return TRUE; 430 } 431 if (rField_is_Q(r)) 432 { 433 nMap = nrMap0; /*Q -> R*/ 434 return TRUE; 435 } 436 if(rField_is_Zp(r)) 437 { 438 nMap = nrMapP; /* Z/p' -> R */ 439 return TRUE; 440 } 441 return FALSE; 442 } 424 nMapFunc nrSetMap(ring src, ring dst) 425 { 426 if (rField_is_R(src)) 427 { 428 return ndCopy; 429 } 430 if (rField_is_Q(src)) 431 { 432 return nrMap0; 433 } 434 if(rField_is_Zp(src)) 435 { 436 return nrMapP; 437 } 438 return NULL; 439 } -
Singular/shortfl.h
rd3bf098 r4508ce5 7 7 * ABSTRACT 8 8 */ 9 /* $Id: shortfl.h,v 1. 7 1999-11-15 17:20:47 obachmanExp $ */9 /* $Id: shortfl.h,v 1.8 2000-12-15 18:49:36 Singular Exp $ */ 10 10 #include "structs.h" 11 11 … … 32 32 #endif 33 33 34 BOOLEAN nrSetMap(ring r);34 nMapFunc nrSetMap(ring src, ring dst); 35 35 36 36 float nrFloat(number n); -
Singular/structs.h
rd3bf098 r4508ce5 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: structs.h,v 1.4 8 2000-12-14 16:38:55 obachmanExp $ */6 /* $Id: structs.h,v 1.49 2000-12-15 18:49:36 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 187 187 188 188 typedef number (*numberfunc)(number a,number b); 189 typedef number (*nMapFunc)(number a); 189 190 struct n_Procs_s 190 191 { … … 227 228 number (*nGetDenom)(number &n); 228 229 numberfunc nGcd, nLcm; 229 BOOLEAN (*nSetMap)(ring r);230 nMapFunc (*nSetMap)(ring src, ring dst); 230 231 #ifdef LDEBUG 231 232 BOOLEAN (*nDBTest)(number a, char *f, int l);
Note: See TracChangeset
for help on using the changeset viewer.