Changeset be0d84 in git


Ignore:
Timestamp:
Mar 8, 1999, 6:30:53 PM (25 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
17e692576cbeb0b918e77a2b33f3d8bac726d8fe
Parents:
55683a9a29c191728a4980caaffdc14fdfbe2a9d
Message:
* hannes: access to coeff-description via functions (1. approach)


git-svn-id: file:///usr/local/Singular/svn/trunk@2890 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • Singular/ChangeLog

    r55683a rbe0d84  
     1Mon 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
    17Wed Dec 16 16:02:07 1998  Jens Schmidt  <schmidt@mathematik.uni-kl.de>
    28
    3         * clapsing.cc: debugging output modified
     9        * clapsing.cc: debugging output modified
    410
    511Thu Oct 22 14:21:17 MEST 1998 <krueger@mathematik.uni-kl.de>
    6         * tesths.cc,subexpr.h,subexpr.cc,ipshell.h,ipshell.cc,iplib.cc
    7         * ipid.h,ipid.cc,ipassign.cc,iparith.cc
    8           - Added assignment <package>=<package> via ref-counter
    9             rewriten killhdl for packages
    10           - Added libname,language to packages
    11           - exportto(Up,...) 'Up' defined in syMake
    12           - listvar() shows toplevel-packages too.
    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
    1420Mon Oct 19 16:01:18 MESZ 1998 hannes
    1521* hannes: limitations on length of arguments removed (was 200 chars)
     
    3339Tue Jun 30 18:30:02 1998  Jens Schmidt  <schmidt@mathematik.uni-kl.de>
    3440
    35         * claptmp.cc (tmax, tmin(Var, Var)): instantiations added
     41        * claptmp.cc (tmax, tmin(Var, Var)): instantiations added
    3642
    3743Fri Jun 19 10:01:59 MET DST 1998 hannes
  • Singular/fglm.cc

    r55683a rbe0d84  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglm.cc,v 1.14 1998-07-29 13:55:47 Singular Exp $
     2// $Id: fglm.cc,v 1.15 1999-03-08 17:30:32 Singular Exp $
    33
    44/****************************************
     
    116116    ring sring = IDRING( sringHdl );
    117117
    118     if ( sring->ch != dring->ch ) {
     118    if ( rChar(sring) != rChar(dring) ) {
    119119        WerrorS( "rings must have same characteristic" );
    120120        state= FglmIncompatibleRings;
     
    164164        // check if sring->qideal is contained in dring->qideal:
    165165        rSetHdl( dringHdl, TRUE );
    166         nSetMap( sring->ch, sring->parameter, npar, sring->minpoly );
     166        nSetMap( rInternalChar(sring), sring->parameter, npar, sring->minpoly );
    167167        ideal sqind = idInit( IDELEMS( sring->qideal ), 1 );
    168168        for ( k= IDELEMS( sring->qideal )-1; k >= 0; k-- )
     
    180180        int * dsvperm = (int *)Alloc0( (nvar+1)*sizeof( int ) );
    181181        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 );
    183183        ideal dqins = idInit( IDELEMS( dring->qideal ), 1 );
    184184        for ( k= IDELEMS( dring->qideal )-1; k >= 0; k-- )
  • Singular/fglmzero.cc

    r55683a rbe0d84  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglmzero.cc,v 1.19 1999-02-26 15:32:04 Singular Exp $
     2// $Id: fglmzero.cc,v 1.20 1999-03-08 17:30:33 Singular Exp $
    33
    44/****************************************
     
    140140    int * perm = (int *)Alloc0( (_nfunc+1)*sizeof( int ) );
    141141    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 );
    143144
    144145    matHeader ** temp = (matHeader **)Alloc( _nfunc*sizeof( matHeader * ));
  • Singular/iparith.cc

    r55683a rbe0d84  
    14761476
    14771477  if ((iiOp!=IMAP_CMD)
    1478   && ((currRing->ch != r->ch)
     1478  && ((rInternalChar(currRing) != rInternalChar(r))
    14791479    || ((currRing->N != r->N)&& (iiOp==FETCH_CMD)))
    14801480  )
     
    14881488    if (iiOp==IMAP_CMD)
    14891489    {
    1490       if (!nSetMap(r->ch,r->parameter,r->P,r->minpoly))
     1490      if (!nSetMap(rInternalChar(r),r->parameter,r->P,r->minpoly))
    14911491      {
    14921492        if (iiOp!=IMAP_CMD)
    14931493          goto err_fetch;
    14941494        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))
    14961498        {
    1497           if ((currRing->ch!=0)
    1498           && (currRing->ch!=1))
     1499          if ((!rField_is_Q_a(currRing))
     1500          && (!rField_is_Q(currRing)))
    14991501            goto err_fetch;
    15001502        }
    1501         else if(r->ch<(-1))
     1503        else if (rField_is_Zp_a(r))
    15021504        {
    1503           if ((currRing->ch==(-currRing->ch))
    1504           && (currRing->ch!=currRing->ch))
     1505          if ((!rField_is_Zp_a(currRing))
     1506          && (!rField_is_Zp(currRing)))
    15051507            goto err_fetch;
    15061508        }
    15071509        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);
    15101512        test=save_test;
    15111513      }
     
    25802582  {
    25812583    ring q=(ring)v->Data();
    2582     if ((q->ch==currRing->ch)
     2584    if ((rInternalChar(q)==rInternalChar(currRing))
    25832585    && (q->N==currRing->N)) /* && varnames equ. */
    25842586    {
  • Singular/ipassign.cc

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipassign.cc,v 1.44 1999-02-26 14:29:01 Singular Exp $ */
     4/* $Id: ipassign.cc,v 1.45 1999-03-08 17:30:36 Singular Exp $ */
    55
    66/*
     
    118118  if ((currRing->parameter!=NULL)
    119119  && ((currRing->P>1)
    120     || (currRing->ch>1/* GF(q) <=> parameter!=NULL && ch=q>1*/)))
     120    || (rField_is_GF())))
    121121  {
    122122    WerrorS("no minpoly allowed");
  • Singular/ipshell.cc

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipshell.cc,v 1.33 1998-12-15 13:35:05 Singular Exp $ */
     4/* $Id: ipshell.cc,v 1.34 1999-03-08 17:30:37 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    569569  if ((r!=NULL) && ((r->typ == RING_CMD) || (r->typ== QRING_CMD)))
    570570  {
    571     if (!nSetMap(IDRING(r)->ch,
     571    if (!nSetMap(rInternalChar(IDRING(r)),
    572572                 IDRING(r)->parameter,
    573573                 IDRING(r)->P,
     
    575575    {
    576576      Werror("map from characteristic %d to %d not implemented",
    577         IDRING(r)->ch,currRing->ch);
     577        rChar(IDRING(r)),rChar());
    578578      return NULL;
    579579    }
  • Singular/kstd1.cc

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd1.cc,v 1.30 1998-12-15 10:06:46 pohl Exp $ */
     4/* $Id: kstd1.cc,v 1.31 1999-03-08 17:30:38 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    18671867  if (TEST_OPT_SB_1)
    18681868    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;
    18711873  strat->LazyDegree = 1;
    18721874  strat->ak = idRankFreeModule(F);
     
    20802082  if(!TEST_OPT_RETURN_SB)
    20812083     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;
    20842088  strat->LazyDegree = 1;
    20852089  strat->minim=(reduced % 2)+1;
  • Singular/kstd2.cc

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.22 1998-10-15 11:45:56 obachman Exp $ */
     4/* $Id: kstd2.cc,v 1.23 1999-03-08 17:30:39 Singular Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    16801680  kStrategy strat=(kStrategy)Alloc0(sizeof(skStrategy));
    16811681
    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;
    16841686  strat->LazyDegree = 1;
    16851687  strat->ak = idRankFreeModule(F);
  • Singular/kstdfac.cc

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstdfac.cc,v 1.20 1998-11-02 09:05:39 Singular Exp $ */
     4/* $Id: kstdfac.cc,v 1.21 1999-03-08 17:30:39 Singular Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: factorizing alg. of Buchberger
     
    753753  sleftv v; memset(&v,0,sizeof(v));
    754754
    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;
    757759  strat->LazyDegree = 1;
    758760  strat->ak = idRankFreeModule(F);
  • Singular/longalg.cc

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: longalg.cc,v 1.28 1999-01-22 17:40:51 Singular Exp $ */
     4/* $Id: longalg.cc,v 1.29 1999-03-08 17:30:40 Singular Exp $ */
    55/*
    66* ABSTRACT:   algebraic numbers
     
    1919#include "ideals.h"
    2020#include "ipid.h"
     21#include "ring.h"
    2122#ifdef HAVE_FACTORY
    2223#include "clapsing.h"
     
    23582359BOOLEAN naSetMap(int c, char ** par, int nop, number minpol)
    23592360{
    2360   if (currRing->ch==1) /* -> Q(a) */
     2361  if (rField_is_Q_a()) /* -> Q(a) */
    23612362  {
    23622363    if (c == 0)
     
    23992400  }
    24002401  /*-----------------------------------------------------*/
    2401   if (currRing->ch<0) /* -> Z/p(a) */
     2402  if (rField_is_Zp_a()) /* -> Z/p(a) */
    24022403  {
    24032404    if (c == 0)
     
    24292430    if (c<0)
    24302431    {
    2431       if (c==currRing->ch)
     2432      if (c==rChar())
    24322433      {
    24332434        nacMap=nacCopy;
  • Singular/maps.cc

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: maps.cc,v 1.11 1998-09-24 09:59:49 Singular Exp $ */
     4/* $Id: maps.cc,v 1.12 1999-03-08 17:30:41 Singular Exp $ */
    55/*
    66* ABSTRACT - the mapping of polynomials to other rings
     
    351351  /* the simplest case:*/
    352352  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);
    354354  int *perm=(int *)Alloc0((r->N+1)*sizeof(int));
    355355  //int *par_perm=(int *)Alloc0(rPar(r)*sizeof(int));
  • Singular/matpol.cc

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: matpol.cc,v 1.20 1998-09-30 14:12:48 Singular Exp $ */
     4/* $Id: matpol.cc,v 1.21 1999-03-08 17:30:42 Singular Exp $ */
    55
    66/*
     
    2323#include "subexpr.h"
    2424#include "intvec.h"
     25#include "ring.h"
    2526#include "matpol.h"
    2627
     
    467468    return NULL;
    468469  }
    469   k=currRing->ch;
    470   if (k<0) k=-k;
    471   else if (k==1) k=0;
     470  k=rChar();
    472471  if (((k > 0) && (k <= n))
    473472#ifdef SRING
  • Singular/misc.cc

    r55683a rbe0d84  
    2626#include "timer.h"
    2727#include "intvec.h"
     28#include "ring.h"
    2829#define SI_DONT_HAVE_GLOBAL_VARS
    2930
     
    576577        verbose=(*w)[1];
    577578
    578         if (TEST_OPT_INTSTRATEGY && (currRing!=NULL) && (currRing->ch>=2))
     579        if (TEST_OPT_INTSTRATEGY && (currRing!=NULL)
     580        && rField_has_simple_inverse())
    579581        {
    580582          test &=~Sy_bit(OPT_INTSTRATEGY);
     
    599601        else
    600602          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())
    602605        {
    603606          test &=~Sy_bit(OPT_INTSTRATEGY);
  • Singular/mpsr.h

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr.h,v 1.12 1998-11-09 15:43:02 obachman Exp $ */
     4/* $Id: mpsr.h,v 1.13 1999-03-08 17:30:43 Singular Exp $ */
    55/***************************************************************
    66 *
     
    2929#include"polys.h"
    3030#include"numbers.h"
     31#include"ring.h"
    3132
    3233/***************************************************************
     
    99100  {
    100101#ifdef PDEBUG
    101     nSetChar(rg->ch, TRUE, rg->parameter,rg->P);
     102    nSetChar(rInternalChar(rg), TRUE, rg->parameter,rg->P);
    102103#else
    103     nSetChar(rg->ch, complete, rg->parameter,rg->P);
     104    nSetChar(rInternalChar(rg), complete, rg->parameter,rg->P);
    104105#endif
    105106    pChangeRing(rg->N, rg->OrdSgn, rg->order, rg->block0, rg->block1,
  • Singular/mpsr_Error.cc

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_Error.cc,v 1.5 1997-06-30 17:04:45 obachman Exp $ */
     4/* $Id: mpsr_Error.cc,v 1.6 1999-03-08 17:30:44 Singular Exp $ */
    55
    66/***************************************************************
     
    1818
    1919#include "febase.h"
    20 #include"mpsr.h"
     20#include "mpsr.h"
    2121
    2222char *mpsr_errlist[] =
  • Singular/mpsr_Get.cc

    r55683a rbe0d84  
    33****************************************/
    44
    5 /* $Id: mpsr_Get.cc,v 1.22 1998-12-18 11:11:40 obachman Exp $ */
     5/* $Id: mpsr_Get.cc,v 1.23 1999-03-08 17:30:45 Singular Exp $ */
    66/***************************************************************
    77 *
     
    2424#include "tok.h"
    2525#include "longrat.h"
    26 #include "ring.h"
    2726#include "intvec.h"
    2827#include "ideals.h"
  • Singular/mpsr_GetMisc.cc

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_GetMisc.cc,v 1.11 1998-11-23 11:05:34 obachman Exp $ */
     4/* $Id: mpsr_GetMisc.cc,v 1.12 1999-03-08 17:30:46 Singular Exp $ */
    55
    66/***************************************************************
     
    1818#ifdef HAVE_MPSR
    1919
    20 #include"mpsr_Get.h"
    21 #include "ring.h"
     20#include "mpsr_Get.h"
    2221#include "longalg.h"
    2322#include "tok.h"
     
    3938{
    4039  // check for currRing
    41   if (currRing != NULL && currRing->ch == ch)
     40  if (currRing != NULL && rInternalChar(currRing) == ch)
     41  // orig: currRing->ch==ch ???
    4242  {
    4343    int i, n = currRing->N;
     
    6060ring mpsr_rDefault(short ch)
    6161{
    62   if (currRing != NULL && currRing->ch == ch)
     62  if (currRing != NULL && rInternalChar(currRing) == ch)
     63  // orig: currRing->ch==ch ???
    6364  {
    6465    (currRing->ref)++;
     
    109110  if (r1 == NULL || r2 == NULL) return 0;
    110111
    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)
    112115      || (r1->P != r2->P))
    113116    return 0;
     
    186189    return 0;
    187190
    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;
    189193
    190194  for (i=0, j=0; j<r1->N && i<r2->N; i++)
     
    337341          number nn = (number) l->data;
    338342          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);
    340344          l->data = (void *) nMap(nn);
    341345          mpsr_SetCurrRing(from_ring, FALSE);
  • Singular/mpsr_GetPoly.cc

    r55683a rbe0d84  
    33****************************************/
    44
    5 /* $Id: mpsr_GetPoly.cc,v 1.20 1998-11-09 15:43:04 obachman Exp $ */
     5/* $Id: mpsr_GetPoly.cc,v 1.21 1999-03-08 17:30:47 Singular Exp $ */
    66
    77/***************************************************************
     
    2323#include "mmemory.h"
    2424#include "tok.h"
    25 #include "ring.h"
    2625#include "ipid.h"
    2726#include "longalg.h"
     
    106105  mpsr_InitTempArray(gNvars + 1);
    107106
    108   if ((r->ch) == 0)
     107  if (rField_is_Q(r))
    109108    // rational numbers
    110109    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))
    116113      GetCoeff = GetGaloisNumber;
    117   }
    118   else if ((r->ch) == -1)
     114  else if (rField_is_R(r))
    119115    GetCoeff = GetFloatNumber;
    120116  else
     
    124120    mpsr_InitTempArray(gNalgvars);
    125121    GetCoeff = GetAlgNumber;
    126     if ((r->ch) < 0)
     122    if (rField_is_Zp_a(r))
    127123      // first, Z/p(a)
    128124      GetAlgNumberNumber = GetModuloNumber;
     
    711707    failr(mpsr_GetRingAnnots(node, subring, mv2, IsUnOrdered));
    712708    // 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 ???
    714711           subring->order[0] == ringorder_lp &&
    715712           subring->order[2] == 0 &&
     
    718715
    719716    // Now do the coercion
    720     r->ch = (subring->ch == 0 ? 1 : - (subring->ch));
     717    r->ch = (rField_is_Q(subring) ? 1 : - rChar(subring));
    721718    r->parameter = (char **) Alloc((subring->N)*sizeof(char*));
    722719    r->P = subring->N;
  • Singular/mpsr_Put.cc

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_Put.cc,v 1.15 1998-12-18 11:11:41 obachman Exp $ */
     4/* $Id: mpsr_Put.cc,v 1.16 1999-03-08 17:30:47 Singular Exp $ */
    55
    66/***************************************************************
     
    2626#include "polys.h"
    2727#include "sing_mp.h"
    28 #include "ring.h"
    2928
    3029/***************************************************************
  • Singular/mpsr_PutPoly.cc

    r55683a rbe0d84  
    33****************************************/
    44
    5 /* $Id: mpsr_PutPoly.cc,v 1.13 1998-11-13 12:21:00 obachman Exp $ */
     5/* $Id: mpsr_PutPoly.cc,v 1.14 1999-03-08 17:30:48 Singular Exp $ */
    66
    77/***************************************************************
     
    2424#include "longalg.h"
    2525#include "mmemory.h"
    26 #include "ring.h"
    2726#include "polys.h"
    2827#include "ipid.h"
     
    9190  mpsr_InitTempArray(gNvars+1);
    9291
    93   if ((r->ch) == 0)
     92  if (rField_is_Q(r))
    9493    // rational numbers
    9594    PutCoeff= PutRationalNumber;
    96   else if ((r->ch) > 1)
     95  else if (rField_is_Zp(r))
    9796    // Form our point of view, ModuloP numbers and numbers from
    9897    // GF(p,n) are the same, here. They only differ in the annots
    9998    PutCoeff = PutModuloNumber;
    100   else if ((r->ch) == -1)
     99  else if (rField_is_R(r))
    101100    PutCoeff = PutFloatNumber;
    102101  else
     
    106105    mpsr_InitTempArray(gNalgvars);
    107106    PutCoeff = PutAlgNumber;
    108     if ((r->ch) < 0)
     107    if (rField_is_Zp_a(r))
    109108      // first, Z/p(a)
    110109      PutAlgAlgNumber = PutModuloNumber;
     
    346345  // Hmm .. this is not according to a "proper" Singular ring,
    347346  // 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)))
    349349    failr(PutMinPolyAnnot(link,r));
    350350 
     
    371371
    372372  // First element is the coefficient
    373   if ((r->ch) == 0)
     373  if (rField_is_Q(r))
    374374  {
    375375    // rational numbers
     
    384384                                    0));
    385385  }
    386   else if ((r->ch) > 1)
     386  else if (rField_is_Zp(r))
    387387  {
    388388    // modulo p numbers
     
    398398                                    MP_AnnotValuated));
    399399    // with Modulo
    400     mp_failr(MP_PutUint32Packet(link, r->ch, 1));
     400    mp_failr(MP_PutUint32Packet(link, rChar(r), 1));
    401401    if (r->parameter == NULL)
    402402    {
     
    416416    }
    417417  }
    418   else if ((r->ch) == -1)
     418  else if (rField_is_R(r))
    419419  {
    420420    // floats
     
    431431
    432432    alg_r->N = rPar(r);
    433     alg_r->ch = (r->ch < 0 ? - (r->ch) : 0);
     433    alg_r->ch = rChar(r);
    434434    alg_r->order = (int *) Alloc(3*sizeof(int));
    435435    alg_r->order[2] = ringorder_no;
     
    683683  // need to set PutAlgAlgnumber and gNalgVars
    684684  CurrPutRing = r;
    685   if (r->ch > 0)
     685  if (rField_is_Zp(r)) // orig: (r->ch > 0) ???
    686686    PutAlgAlgNumber = PutModuloNumber;
    687687  else
  • Singular/mpsr_Tok.cc

    r55683a rbe0d84  
    33****************************************/
    44
    5 /* $Id: mpsr_Tok.cc,v 1.21 1998-12-18 11:11:42 obachman Exp $ */
     5/* $Id: mpsr_Tok.cc,v 1.22 1999-03-08 17:30:49 Singular Exp $ */
    66
    77/***************************************************************
     
    2222#include"febase.h"
    2323#include"tok.h"
    24 #include"ring.h"
    2524
    2625#include "mpsr.h"
  • Singular/ring.h

    r55683a rbe0d84  
    77* ABSTRACT - the interpreter related ring operations
    88*/
    9 /* $Id: ring.h,v 1.20 1999-02-10 16:00:05 Singular Exp $ */
     9/* $Id: ring.h,v 1.21 1999-03-08 17:30:50 Singular Exp $ */
    1010
    1111/* includes */
     
    4848int    rBlocks(ring r);
    4949
     50#define  rInternalChar(r) ((r)->ch)
     51inline BOOLEAN rField_is_Zp(ring r=currRing)
     52{ return (r->ch>1) && (r->parameter==NULL); }
     53inline BOOLEAN rField_is_Q(ring r=currRing)
     54{ return (r->ch==0) && (r->parameter==NULL); }
     55inline BOOLEAN rField_is_R(ring r=currRing)
     56{ return (r->ch==-1); }
     57inline BOOLEAN rField_is_GF(ring r=currRing)
     58{ return (r->ch>1) && (r->parameter!=NULL); }
     59inline BOOLEAN rField_is_Zp_a(ring r=currRing)
     60{ return (r->ch<-1); }
     61inline BOOLEAN rField_is_Q_a(ring r=currRing)
     62{ return (r->ch==1); }
     63inline BOOLEAN rField_has_simple_inverse(ring r=currRing)
     64{ return (r->ch>1); } /* Z/p and GF(p,n) */
    5065
    5166enum
  • Singular/spSpolyLoop.cc

    r55683a rbe0d84  
    144144
    145145  // set characterisic
    146   if (r->ch > 1) ch = chMODP;
     146  if (rField_is_Zp(r)) ch = chMODP;
    147147 
    148148  // set Ordering Type
  • Singular/spolys.cc

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: spolys.cc,v 1.17 1998-11-16 08:41:22 Singular Exp $ */
     4/* $Id: spolys.cc,v 1.18 1999-03-08 17:30:51 Singular Exp $ */
    55
    66/*
     
    794794void spSet(ring r)
    795795{
    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) */
    797798#ifdef SRING
    798799  && (pSRING==0)
     
    810811    return;
    811812  }
    812   if ((r->ch>1) && (r->parameter!=NULL) /* finite fields */
     813  if (rField_is_GF(r) /* finite fields GF(p,n) */
    813814#ifdef SRING
    814815  && (pSRING==0)
     
    826827    return;
    827828  }
    828   if ((r->ch>1) && (r->parameter==NULL) /* Fp */
     829  if (rField_is_Zp(r) /* Fp */
    829830#ifdef SRING
    830831  && (pSRING==0)
  • Singular/subexpr.cc

    r55683a rbe0d84  
    608608    else if (rtyp==LIB_CMD)
    609609      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()))
    611611      x=(void *)nCopy(currRing->minpoly);
    612612    data=NULL;
     
    688688          data=(char *)n;
    689689        }
    690         else if((rtyp==VMINPOLY)&&(currRing->ch>2)&&(currRing->P==1))
     690        else if((rtyp==VMINPOLY)&&(rField_is_GF()))
    691691        {
    692692          nfShowMipo();
     
    867867      case TRACE:      return (void *)traceit;
    868868      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()))
    870870                       /* Q(a), Fp(a), but not GF(q) */
    871871                         return (void *)currRing->minpoly;
  • Singular/syz.cc

    r55683a rbe0d84  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: syz.cc,v 1.14 1998-11-21 13:55:41 siebert Exp $ */
     4/* $Id: syz.cc,v 1.15 1999-03-08 17:30:53 Singular Exp $ */
    55
    66/*
     
    164164      if (TEST_OPT_PROT) PrintS("f");
    165165      actWith = syz->m[i];
    166       if (currRing->ch<2) pCleardenom(actWith);
     166      if (!rField_has_simple_inverse()) pCleardenom(actWith);
    167167//Print("actWith: ");pWrite(actWith);
    168168      syz->m[i] = NULL;
     
    227227
    228228  syz->m[elnum] = NULL;
    229   if (currRing->ch<2) pCleardenom(actWith);
     229  if (!rField_has_simple_inverse()) pCleardenom(actWith);
    230230/*--makes Gauss alg. for the column ModComp--*/
    231231  unit1 = pTakeOutComp1(&(actWith), ModComp);
Note: See TracChangeset for help on using the changeset viewer.