Changeset be0d84 in git
- Timestamp:
- Mar 8, 1999, 6:30:53 PM (25 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 17e692576cbeb0b918e77a2b33f3d8bac726d8fe
- Parents:
- 55683a9a29c191728a4980caaffdc14fdfbe2a9d
- Location:
- Singular
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ChangeLog
r55683a rbe0d84 1 Mon Mar 8 18:27:26 MET 1999 hannes 2 * access to coeff-description via functions (1. approach) 3 (rChar, rInternalChar, rField_is_Zp, rField_is_Q, 4 rField_is_R, rField_is_GF, rField_is_Zp_a, rField_is_Q_a, 5 rField_has_simple_inverse) 6 1 7 Wed Dec 16 16:02:07 1998 Jens Schmidt <schmidt@mathematik.uni-kl.de> 2 8 3 9 * clapsing.cc: debugging output modified 4 10 5 11 Thu Oct 22 14:21:17 MEST 1998 <krueger@mathematik.uni-kl.de> 6 7 8 9 10 11 12 13 12 * tesths.cc,subexpr.h,subexpr.cc,ipshell.h,ipshell.cc,iplib.cc 13 * ipid.h,ipid.cc,ipassign.cc,iparith.cc 14 - Added assignment <package>=<package> via ref-counter 15 rewriten killhdl for packages 16 - Added libname,language to packages 17 - exportto(Up,...) 'Up' defined in syMake 18 - listvar() shows toplevel-packages too. 19 14 20 Mon Oct 19 16:01:18 MESZ 1998 hannes 15 21 * hannes: limitations on length of arguments removed (was 200 chars) … … 33 39 Tue Jun 30 18:30:02 1998 Jens Schmidt <schmidt@mathematik.uni-kl.de> 34 40 35 41 * claptmp.cc (tmax, tmin(Var, Var)): instantiations added 36 42 37 43 Fri Jun 19 10:01:59 MET DST 1998 hannes -
Singular/fglm.cc
r55683a rbe0d84 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglm.cc,v 1.1 4 1998-07-29 13:55:47Singular Exp $2 // $Id: fglm.cc,v 1.15 1999-03-08 17:30:32 Singular Exp $ 3 3 4 4 /**************************************** … … 116 116 ring sring = IDRING( sringHdl ); 117 117 118 if ( sring->ch != dring->ch) {118 if ( rChar(sring) != rChar(dring) ) { 119 119 WerrorS( "rings must have same characteristic" ); 120 120 state= FglmIncompatibleRings; … … 164 164 // check if sring->qideal is contained in dring->qideal: 165 165 rSetHdl( dringHdl, TRUE ); 166 nSetMap( sring->ch, sring->parameter, npar, sring->minpoly );166 nSetMap( rInternalChar(sring), sring->parameter, npar, sring->minpoly ); 167 167 ideal sqind = idInit( IDELEMS( sring->qideal ), 1 ); 168 168 for ( k= IDELEMS( sring->qideal )-1; k >= 0; k-- ) … … 180 180 int * dsvperm = (int *)Alloc0( (nvar+1)*sizeof( int ) ); 181 181 maFindPerm( dring->names, nvar, NULL, 0, sring->names, nvar, NULL, 0, dsvperm, NULL ); 182 nSetMap( dring->ch, dring->parameter, npar, dring->minpoly );182 nSetMap( rInternalChar(dring), dring->parameter, npar, dring->minpoly ); 183 183 ideal dqins = idInit( IDELEMS( dring->qideal ), 1 ); 184 184 for ( k= IDELEMS( dring->qideal )-1; k >= 0; k-- ) -
Singular/fglmzero.cc
r55683a rbe0d84 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglmzero.cc,v 1. 19 1999-02-26 15:32:04Singular Exp $2 // $Id: fglmzero.cc,v 1.20 1999-03-08 17:30:33 Singular Exp $ 3 3 4 4 /**************************************** … … 140 140 int * perm = (int *)Alloc0( (_nfunc+1)*sizeof( int ) ); 141 141 maFindPerm( source->names, source->N, NULL, 0, currRing->names, currRing->N, NULL, 0, perm, NULL ); 142 nSetMap( source->ch, source->parameter, source->P, source->minpoly ); 142 nSetMap( rInternalChar(source), source->parameter, 143 source->P, source->minpoly ); 143 144 144 145 matHeader ** temp = (matHeader **)Alloc( _nfunc*sizeof( matHeader * )); -
Singular/iparith.cc
r55683a rbe0d84 1476 1476 1477 1477 if ((iiOp!=IMAP_CMD) 1478 && (( currRing->ch != r->ch)1478 && ((rInternalChar(currRing) != rInternalChar(r)) 1479 1479 || ((currRing->N != r->N)&& (iiOp==FETCH_CMD))) 1480 1480 ) … … 1488 1488 if (iiOp==IMAP_CMD) 1489 1489 { 1490 if (!nSetMap(r ->ch,r->parameter,r->P,r->minpoly))1490 if (!nSetMap(rInternalChar(r),r->parameter,r->P,r->minpoly)) 1491 1491 { 1492 1492 if (iiOp!=IMAP_CMD) 1493 1493 goto err_fetch; 1494 1494 par_perm_size=rPar(r); 1495 if (r->ch==1) 1495 if (rChar(r)!=rChar(currRing)) 1496 goto err_fetch; 1497 if (rField_is_Q_a(r)) 1496 1498 { 1497 if (( currRing->ch!=0)1498 && ( currRing->ch!=1))1499 if ((!rField_is_Q_a(currRing)) 1500 && (!rField_is_Q(currRing))) 1499 1501 goto err_fetch; 1500 1502 } 1501 else if (r->ch<(-1))1503 else if (rField_is_Zp_a(r)) 1502 1504 { 1503 if (( currRing->ch==(-currRing->ch))1504 && ( currRing->ch!=currRing->ch))1505 if ((!rField_is_Zp_a(currRing)) 1506 && (!rField_is_Zp(currRing))) 1505 1507 goto err_fetch; 1506 1508 } 1507 1509 BITSET save_test=test; 1508 naSetChar(r ->ch,TRUE,r->parameter,r->P);1509 nSetChar( currRing->ch,TRUE,currRing->parameter,currRing->P);1510 naSetChar(rInternalChar(r),TRUE,r->parameter,r->P); 1511 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,currRing->P); 1510 1512 test=save_test; 1511 1513 } … … 2580 2582 { 2581 2583 ring q=(ring)v->Data(); 2582 if (( q->ch==currRing->ch)2584 if ((rInternalChar(q)==rInternalChar(currRing)) 2583 2585 && (q->N==currRing->N)) /* && varnames equ. */ 2584 2586 { -
Singular/ipassign.cc
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipassign.cc,v 1.4 4 1999-02-26 14:29:01Singular Exp $ */4 /* $Id: ipassign.cc,v 1.45 1999-03-08 17:30:36 Singular Exp $ */ 5 5 6 6 /* … … 118 118 if ((currRing->parameter!=NULL) 119 119 && ((currRing->P>1) 120 || ( currRing->ch>1/* GF(q) <=> parameter!=NULL && ch=q>1*/)))120 || (rField_is_GF()))) 121 121 { 122 122 WerrorS("no minpoly allowed"); -
Singular/ipshell.cc
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipshell.cc,v 1.3 3 1998-12-15 13:35:05Singular Exp $ */4 /* $Id: ipshell.cc,v 1.34 1999-03-08 17:30:37 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 569 569 if ((r!=NULL) && ((r->typ == RING_CMD) || (r->typ== QRING_CMD))) 570 570 { 571 if (!nSetMap( IDRING(r)->ch,571 if (!nSetMap(rInternalChar(IDRING(r)), 572 572 IDRING(r)->parameter, 573 573 IDRING(r)->P, … … 575 575 { 576 576 Werror("map from characteristic %d to %d not implemented", 577 IDRING(r)->ch,currRing->ch);577 rChar(IDRING(r)),rChar()); 578 578 return NULL; 579 579 } -
Singular/kstd1.cc
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd1.cc,v 1.3 0 1998-12-15 10:06:46 pohlExp $ */4 /* $Id: kstd1.cc,v 1.31 1999-03-08 17:30:38 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 1867 1867 if (TEST_OPT_SB_1) 1868 1868 strat->newIdeal = newIdeal; 1869 if (currRing->ch==0) strat->LazyPass=2; 1870 else strat->LazyPass=20; 1869 if (rField_has_simple_inverse() || rField_is_R()) 1870 strat->LazyPass=20; 1871 else 1872 strat->LazyPass=2; 1871 1873 strat->LazyDegree = 1; 1872 1874 strat->ak = idRankFreeModule(F); … … 2080 2082 if(!TEST_OPT_RETURN_SB) 2081 2083 strat->syzComp = syzComp; 2082 if (currRing->ch==0) strat->LazyPass=2; 2083 else strat->LazyPass=20; 2084 if (rField_has_simple_inverse() || rField_is_R()) 2085 strat->LazyPass=20; 2086 else 2087 strat->LazyPass=2; 2084 2088 strat->LazyDegree = 1; 2085 2089 strat->minim=(reduced % 2)+1; -
Singular/kstd2.cc
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.2 2 1998-10-15 11:45:56 obachmanExp $ */4 /* $Id: kstd2.cc,v 1.23 1999-03-08 17:30:39 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 1680 1680 kStrategy strat=(kStrategy)Alloc0(sizeof(skStrategy)); 1681 1681 1682 if (currRing->ch==0) strat->LazyPass=2; 1683 else strat->LazyPass=20; 1682 if (rField_has_simple_inverse() || rField_is_R()) 1683 strat->LazyPass=20; 1684 else 1685 strat->LazyPass=2; 1684 1686 strat->LazyDegree = 1; 1685 1687 strat->ak = idRankFreeModule(F); -
Singular/kstdfac.cc
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstdfac.cc,v 1.2 0 1998-11-02 09:05:39 Singular Exp $ */4 /* $Id: kstdfac.cc,v 1.21 1999-03-08 17:30:39 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: factorizing alg. of Buchberger … … 753 753 sleftv v; memset(&v,0,sizeof(v)); 754 754 755 if (currRing->ch==0) strat->LazyPass=2; 756 else strat->LazyPass=20; 755 if (rField_has_simple_inverse() || rField_is_R()) 756 strat->LazyPass=20; 757 else 758 strat->LazyPass=2; 757 759 strat->LazyDegree = 1; 758 760 strat->ak = idRankFreeModule(F); -
Singular/longalg.cc
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longalg.cc,v 1.2 8 1999-01-22 17:40:51Singular Exp $ */4 /* $Id: longalg.cc,v 1.29 1999-03-08 17:30:40 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: algebraic numbers … … 19 19 #include "ideals.h" 20 20 #include "ipid.h" 21 #include "ring.h" 21 22 #ifdef HAVE_FACTORY 22 23 #include "clapsing.h" … … 2358 2359 BOOLEAN naSetMap(int c, char ** par, int nop, number minpol) 2359 2360 { 2360 if ( currRing->ch==1) /* -> Q(a) */2361 if (rField_is_Q_a()) /* -> Q(a) */ 2361 2362 { 2362 2363 if (c == 0) … … 2399 2400 } 2400 2401 /*-----------------------------------------------------*/ 2401 if ( currRing->ch<0) /* -> Z/p(a) */2402 if (rField_is_Zp_a()) /* -> Z/p(a) */ 2402 2403 { 2403 2404 if (c == 0) … … 2429 2430 if (c<0) 2430 2431 { 2431 if (c== currRing->ch)2432 if (c==rChar()) 2432 2433 { 2433 2434 nacMap=nacCopy; -
Singular/maps.cc
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: maps.cc,v 1.1 1 1998-09-24 09:59:49Singular Exp $ */4 /* $Id: maps.cc,v 1.12 1999-03-08 17:30:41 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - the mapping of polynomials to other rings … … 351 351 /* the simplest case:*/ 352 352 if(r==currRing) return pCopy(p); 353 nSetMap(r ->ch,r->parameter,r->P,r->minpoly);353 nSetMap(rInternalChar(r),r->parameter,r->P,r->minpoly); 354 354 int *perm=(int *)Alloc0((r->N+1)*sizeof(int)); 355 355 //int *par_perm=(int *)Alloc0(rPar(r)*sizeof(int)); -
Singular/matpol.cc
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: matpol.cc,v 1.2 0 1998-09-30 14:12:48Singular Exp $ */4 /* $Id: matpol.cc,v 1.21 1999-03-08 17:30:42 Singular Exp $ */ 5 5 6 6 /* … … 23 23 #include "subexpr.h" 24 24 #include "intvec.h" 25 #include "ring.h" 25 26 #include "matpol.h" 26 27 … … 467 468 return NULL; 468 469 } 469 k=currRing->ch; 470 if (k<0) k=-k; 471 else if (k==1) k=0; 470 k=rChar(); 472 471 if (((k > 0) && (k <= n)) 473 472 #ifdef SRING -
Singular/misc.cc
r55683a rbe0d84 26 26 #include "timer.h" 27 27 #include "intvec.h" 28 #include "ring.h" 28 29 #define SI_DONT_HAVE_GLOBAL_VARS 29 30 … … 576 577 verbose=(*w)[1]; 577 578 578 if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) && (currRing->ch>=2)) 579 if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) 580 && rField_has_simple_inverse()) 579 581 { 580 582 test &=~Sy_bit(OPT_INTSTRATEGY); … … 599 601 else 600 602 Warn("cannot set option"); 601 if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) && (currRing->ch>=2)) 603 if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) 604 && rField_has_simple_inverse()) 602 605 { 603 606 test &=~Sy_bit(OPT_INTSTRATEGY); -
Singular/mpsr.h
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpsr.h,v 1.1 2 1998-11-09 15:43:02 obachmanExp $ */4 /* $Id: mpsr.h,v 1.13 1999-03-08 17:30:43 Singular Exp $ */ 5 5 /*************************************************************** 6 6 * … … 29 29 #include"polys.h" 30 30 #include"numbers.h" 31 #include"ring.h" 31 32 32 33 /*************************************************************** … … 99 100 { 100 101 #ifdef PDEBUG 101 nSetChar(r g->ch, TRUE, rg->parameter,rg->P);102 nSetChar(rInternalChar(rg), TRUE, rg->parameter,rg->P); 102 103 #else 103 nSetChar(r g->ch, complete, rg->parameter,rg->P);104 nSetChar(rInternalChar(rg), complete, rg->parameter,rg->P); 104 105 #endif 105 106 pChangeRing(rg->N, rg->OrdSgn, rg->order, rg->block0, rg->block1, -
Singular/mpsr_Error.cc
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpsr_Error.cc,v 1. 5 1997-06-30 17:04:45 obachmanExp $ */4 /* $Id: mpsr_Error.cc,v 1.6 1999-03-08 17:30:44 Singular Exp $ */ 5 5 6 6 /*************************************************************** … … 18 18 19 19 #include "febase.h" 20 #include "mpsr.h"20 #include "mpsr.h" 21 21 22 22 char *mpsr_errlist[] = -
Singular/mpsr_Get.cc
r55683a rbe0d84 3 3 ****************************************/ 4 4 5 /* $Id: mpsr_Get.cc,v 1.2 2 1998-12-18 11:11:40 obachmanExp $ */5 /* $Id: mpsr_Get.cc,v 1.23 1999-03-08 17:30:45 Singular Exp $ */ 6 6 /*************************************************************** 7 7 * … … 24 24 #include "tok.h" 25 25 #include "longrat.h" 26 #include "ring.h"27 26 #include "intvec.h" 28 27 #include "ideals.h" -
Singular/mpsr_GetMisc.cc
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpsr_GetMisc.cc,v 1.1 1 1998-11-23 11:05:34 obachmanExp $ */4 /* $Id: mpsr_GetMisc.cc,v 1.12 1999-03-08 17:30:46 Singular Exp $ */ 5 5 6 6 /*************************************************************** … … 18 18 #ifdef HAVE_MPSR 19 19 20 #include"mpsr_Get.h" 21 #include "ring.h" 20 #include "mpsr_Get.h" 22 21 #include "longalg.h" 23 22 #include "tok.h" … … 39 38 { 40 39 // check for currRing 41 if (currRing != NULL && currRing->ch == ch) 40 if (currRing != NULL && rInternalChar(currRing) == ch) 41 // orig: currRing->ch==ch ??? 42 42 { 43 43 int i, n = currRing->N; … … 60 60 ring mpsr_rDefault(short ch) 61 61 { 62 if (currRing != NULL && currRing->ch == ch) 62 if (currRing != NULL && rInternalChar(currRing) == ch) 63 // orig: currRing->ch==ch ??? 63 64 { 64 65 (currRing->ref)++; … … 109 110 if (r1 == NULL || r2 == NULL) return 0; 110 111 111 if ((r1->ch != r2->ch) || (r1->N != r2->N) || (r1->OrdSgn != r2->OrdSgn) 112 if ((rInternalChar(r1) != rInternalChar(r2)) 113 // orig: r1->ch == r2->ch ??? 114 || (r1->N != r2->N) || (r1->OrdSgn != r2->OrdSgn) 112 115 || (r1->P != r2->P)) 113 116 return 0; … … 186 189 return 0; 187 190 188 if (r1->ch != 0 && r1->ch != r2->ch) return 0; 191 if (!rField_is_Q(r1) && rInternalChar(r1) != rInternalChar(r2)) return 0; 192 // orig: if (r1->ch != 0 && r1->ch != r2->ch) return 0; 189 193 190 194 for (i=0, j=0; j<r1->N && i<r2->N; i++) … … 337 341 number nn = (number) l->data; 338 342 mpsr_SetCurrRing(to_ring, TRUE); 339 nSetMap( from_ring->ch, from_ring->parameter, from_ring->P, from_ring->minpoly);343 nSetMap(rInternalChar(from_ring), from_ring->parameter, from_ring->P, from_ring->minpoly); 340 344 l->data = (void *) nMap(nn); 341 345 mpsr_SetCurrRing(from_ring, FALSE); -
Singular/mpsr_GetPoly.cc
r55683a rbe0d84 3 3 ****************************************/ 4 4 5 /* $Id: mpsr_GetPoly.cc,v 1.2 0 1998-11-09 15:43:04 obachmanExp $ */5 /* $Id: mpsr_GetPoly.cc,v 1.21 1999-03-08 17:30:47 Singular Exp $ */ 6 6 7 7 /*************************************************************** … … 23 23 #include "mmemory.h" 24 24 #include "tok.h" 25 #include "ring.h"26 25 #include "ipid.h" 27 26 #include "longalg.h" … … 106 105 mpsr_InitTempArray(gNvars + 1); 107 106 108 if ( (r->ch) == 0)107 if (rField_is_Q(r)) 109 108 // rational numbers 110 109 GetCoeff = GetRationalNumber; 111 else if ((r->ch) > 1) 112 { 113 if (r->parameter == NULL) 114 GetCoeff = GetModuloNumber; 115 else 110 else if (rField_is_Zp(r)) 111 GetCoeff = GetModuloNumber; 112 else if (rField_is_GF(r)) 116 113 GetCoeff = GetGaloisNumber; 117 } 118 else if ((r->ch) == -1) 114 else if (rField_is_R(r)) 119 115 GetCoeff = GetFloatNumber; 120 116 else … … 124 120 mpsr_InitTempArray(gNalgvars); 125 121 GetCoeff = GetAlgNumber; 126 if ( (r->ch) < 0)122 if (rField_is_Zp_a(r)) 127 123 // first, Z/p(a) 128 124 GetAlgNumberNumber = GetModuloNumber; … … 711 707 failr(mpsr_GetRingAnnots(node, subring, mv2, IsUnOrdered)); 712 708 // Check whether the ring can be "coerced" to an algebraic number 713 falser(subring->ch >= 0 && 709 falser( (rField_is_Zp(subring)||rField_is_Q(subring)) && 710 // orig: subring->ch >= 0 &&a ??? 714 711 subring->order[0] == ringorder_lp && 715 712 subring->order[2] == 0 && … … 718 715 719 716 // Now do the coercion 720 r->ch = ( subring->ch == 0 ? 1 : - (subring->ch));717 r->ch = (rField_is_Q(subring) ? 1 : - rChar(subring)); 721 718 r->parameter = (char **) Alloc((subring->N)*sizeof(char*)); 722 719 r->P = subring->N; -
Singular/mpsr_Put.cc
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpsr_Put.cc,v 1.1 5 1998-12-18 11:11:41 obachmanExp $ */4 /* $Id: mpsr_Put.cc,v 1.16 1999-03-08 17:30:47 Singular Exp $ */ 5 5 6 6 /*************************************************************** … … 26 26 #include "polys.h" 27 27 #include "sing_mp.h" 28 #include "ring.h"29 28 30 29 /*************************************************************** -
Singular/mpsr_PutPoly.cc
r55683a rbe0d84 3 3 ****************************************/ 4 4 5 /* $Id: mpsr_PutPoly.cc,v 1.1 3 1998-11-13 12:21:00 obachmanExp $ */5 /* $Id: mpsr_PutPoly.cc,v 1.14 1999-03-08 17:30:48 Singular Exp $ */ 6 6 7 7 /*************************************************************** … … 24 24 #include "longalg.h" 25 25 #include "mmemory.h" 26 #include "ring.h"27 26 #include "polys.h" 28 27 #include "ipid.h" … … 91 90 mpsr_InitTempArray(gNvars+1); 92 91 93 if ( (r->ch) == 0)92 if (rField_is_Q(r)) 94 93 // rational numbers 95 94 PutCoeff= PutRationalNumber; 96 else if ( (r->ch) > 1)95 else if (rField_is_Zp(r)) 97 96 // Form our point of view, ModuloP numbers and numbers from 98 97 // GF(p,n) are the same, here. They only differ in the annots 99 98 PutCoeff = PutModuloNumber; 100 else if ( (r->ch) == -1)99 else if (rField_is_R(r)) 101 100 PutCoeff = PutFloatNumber; 102 101 else … … 106 105 mpsr_InitTempArray(gNalgvars); 107 106 PutCoeff = PutAlgNumber; 108 if ( (r->ch) < 0)107 if (rField_is_Zp_a(r)) 109 108 // first, Z/p(a) 110 109 PutAlgAlgNumber = PutModuloNumber; … … 346 345 // Hmm .. this is not according to a "proper" Singular ring, 347 346 // but to be used in a recursive call of mpsr_PutRingAnnots 348 if (r->minpoly != NULL && r->parameter == NULL && r->ch > 0) 347 if (r->minpoly != NULL && r->parameter == NULL 348 && (rField_is_Q_a(r)||rField_is_GF(r))) 349 349 failr(PutMinPolyAnnot(link,r)); 350 350 … … 371 371 372 372 // First element is the coefficient 373 if ( (r->ch) == 0)373 if (rField_is_Q(r)) 374 374 { 375 375 // rational numbers … … 384 384 0)); 385 385 } 386 else if ( (r->ch) > 1)386 else if (rField_is_Zp(r)) 387 387 { 388 388 // modulo p numbers … … 398 398 MP_AnnotValuated)); 399 399 // with Modulo 400 mp_failr(MP_PutUint32Packet(link, r ->ch, 1));400 mp_failr(MP_PutUint32Packet(link, rChar(r), 1)); 401 401 if (r->parameter == NULL) 402 402 { … … 416 416 } 417 417 } 418 else if ( (r->ch) == -1)418 else if (rField_is_R(r)) 419 419 { 420 420 // floats … … 431 431 432 432 alg_r->N = rPar(r); 433 alg_r->ch = (r->ch < 0 ? - (r->ch) : 0);433 alg_r->ch = rChar(r); 434 434 alg_r->order = (int *) Alloc(3*sizeof(int)); 435 435 alg_r->order[2] = ringorder_no; … … 683 683 // need to set PutAlgAlgnumber and gNalgVars 684 684 CurrPutRing = r; 685 if (r ->ch > 0)685 if (rField_is_Zp(r)) // orig: (r->ch > 0) ??? 686 686 PutAlgAlgNumber = PutModuloNumber; 687 687 else -
Singular/mpsr_Tok.cc
r55683a rbe0d84 3 3 ****************************************/ 4 4 5 /* $Id: mpsr_Tok.cc,v 1.2 1 1998-12-18 11:11:42 obachmanExp $ */5 /* $Id: mpsr_Tok.cc,v 1.22 1999-03-08 17:30:49 Singular Exp $ */ 6 6 7 7 /*************************************************************** … … 22 22 #include"febase.h" 23 23 #include"tok.h" 24 #include"ring.h"25 24 26 25 #include "mpsr.h" -
Singular/ring.h
r55683a rbe0d84 7 7 * ABSTRACT - the interpreter related ring operations 8 8 */ 9 /* $Id: ring.h,v 1.2 0 1999-02-10 16:00:05Singular Exp $ */9 /* $Id: ring.h,v 1.21 1999-03-08 17:30:50 Singular Exp $ */ 10 10 11 11 /* includes */ … … 48 48 int rBlocks(ring r); 49 49 50 #define rInternalChar(r) ((r)->ch) 51 inline BOOLEAN rField_is_Zp(ring r=currRing) 52 { return (r->ch>1) && (r->parameter==NULL); } 53 inline BOOLEAN rField_is_Q(ring r=currRing) 54 { return (r->ch==0) && (r->parameter==NULL); } 55 inline BOOLEAN rField_is_R(ring r=currRing) 56 { return (r->ch==-1); } 57 inline BOOLEAN rField_is_GF(ring r=currRing) 58 { return (r->ch>1) && (r->parameter!=NULL); } 59 inline BOOLEAN rField_is_Zp_a(ring r=currRing) 60 { return (r->ch<-1); } 61 inline BOOLEAN rField_is_Q_a(ring r=currRing) 62 { return (r->ch==1); } 63 inline BOOLEAN rField_has_simple_inverse(ring r=currRing) 64 { return (r->ch>1); } /* Z/p and GF(p,n) */ 50 65 51 66 enum -
Singular/spSpolyLoop.cc
r55683a rbe0d84 144 144 145 145 // set characterisic 146 if (r ->ch > 1) ch = chMODP;146 if (rField_is_Zp(r)) ch = chMODP; 147 147 148 148 // set Ordering Type -
Singular/spolys.cc
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: spolys.cc,v 1.1 7 1998-11-16 08:41:22Singular Exp $ */4 /* $Id: spolys.cc,v 1.18 1999-03-08 17:30:51 Singular Exp $ */ 5 5 6 6 /* … … 794 794 void spSet(ring r) 795 795 { 796 if (((r->ch<=0)||TEST_OPT_INTSTRATEGY) /* Q, Q(a), Fp(a) */ 796 if ((!rField_has_simple_inverse(r)) 797 ||TEST_OPT_INTSTRATEGY /* Q, Q(a), Fp(a) */ 797 798 #ifdef SRING 798 799 && (pSRING==0) … … 810 811 return; 811 812 } 812 if ( (r->ch>1) && (r->parameter!=NULL) /* finite fields*/813 if (rField_is_GF(r) /* finite fields GF(p,n) */ 813 814 #ifdef SRING 814 815 && (pSRING==0) … … 826 827 return; 827 828 } 828 if ( (r->ch>1) && (r->parameter==NULL) /* Fp */829 if (rField_is_Zp(r) /* Fp */ 829 830 #ifdef SRING 830 831 && (pSRING==0) -
Singular/subexpr.cc
r55683a rbe0d84 608 608 else if (rtyp==LIB_CMD) 609 609 x=(void *)mstrdup((char *)Data()); 610 else if ((rtyp==VMINPOLY)&& (currRing->minpoly!=NULL)&&( currRing->ch<2))610 else if ((rtyp==VMINPOLY)&& (currRing->minpoly!=NULL)&&(!rField_is_GF())) 611 611 x=(void *)nCopy(currRing->minpoly); 612 612 data=NULL; … … 688 688 data=(char *)n; 689 689 } 690 else if((rtyp==VMINPOLY)&&( currRing->ch>2)&&(currRing->P==1))690 else if((rtyp==VMINPOLY)&&(rField_is_GF())) 691 691 { 692 692 nfShowMipo(); … … 867 867 case TRACE: return (void *)traceit; 868 868 case VSHORTOUT: return (void *)pShortOut; 869 case VMINPOLY: if ((currRing->minpoly!=NULL)&&( currRing->ch<2))869 case VMINPOLY: if ((currRing->minpoly!=NULL)&&(!rField_is_GF())) 870 870 /* Q(a), Fp(a), but not GF(q) */ 871 871 return (void *)currRing->minpoly; -
Singular/syz.cc
r55683a rbe0d84 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz.cc,v 1.1 4 1998-11-21 13:55:41 siebertExp $ */4 /* $Id: syz.cc,v 1.15 1999-03-08 17:30:53 Singular Exp $ */ 5 5 6 6 /* … … 164 164 if (TEST_OPT_PROT) PrintS("f"); 165 165 actWith = syz->m[i]; 166 if ( currRing->ch<2) pCleardenom(actWith);166 if (!rField_has_simple_inverse()) pCleardenom(actWith); 167 167 //Print("actWith: ");pWrite(actWith); 168 168 syz->m[i] = NULL; … … 227 227 228 228 syz->m[elnum] = NULL; 229 if ( currRing->ch<2) pCleardenom(actWith);229 if (!rField_has_simple_inverse()) pCleardenom(actWith); 230 230 /*--makes Gauss alg. for the column ModComp--*/ 231 231 unit1 = pTakeOutComp1(&(actWith), ModComp);
Note: See TracChangeset
for help on using the changeset viewer.