Changeset a5189b in git


Ignore:
Timestamp:
Dec 5, 2000, 12:15:10 PM (24 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '648d28f488f6ff08f5607ff229b9ad9e4a5b93c2')
Children:
9f9b9a1a665602bf82b5e271e8cc596d26f25203
Parents:
537f9371dff741b30e45db9d08cd35ed20d5f36f
Message:
* fixes for mpsr stuff


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

Legend:

Unmodified
Added
Removed
  • Singular/ffields.cc

    r537f93 ra5189b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ffields.cc,v 1.27 2000-10-19 15:00:11 obachman Exp $ */
     4/* $Id: ffields.cc,v 1.28 2000-12-05 11:15:08 obachman Exp $ */
    55/*
    66* ABSTRACT: finite fields with a none-prime number of elements (via tables)
     
    180180number nfInit (int i)
    181181{
     182  // Hmm .. this is just to prevent initialization
     183  // from nfInitChar to go into an infinite loop
     184  if (i==0) return (number)nfCharQ;
    182185  while (i <  0)    i += nfCharP;
    183186  while (i >= nfCharP) i -= nfCharP;
  • Singular/mpsr_Get.cc

    r537f93 ra5189b  
    33****************************************/
    44
    5 /* $Id: mpsr_Get.cc,v 1.32 2000-08-14 12:56:42 obachman Exp $ */
     5/* $Id: mpsr_Get.cc,v 1.33 2000-12-05 11:15:08 obachman Exp $ */
    66/***************************************************************
    77 *
     
    343343    }
    344344
    345     mpsr_SetCurrRingHdl(mlv.r);
     345    mpsr_SetCurrRingHdl(&mlv);
    346346
    347347    lv = mlv.lv;
     
    917917    if (status == mpsr_Success)
    918918    {
    919 #ifdef MPSR_DEBUG
    920       //command cmd = (command) mlv.lv->data;
    921       //fprintf(stdout, "Dump got %s \n", cmd->arg1.name);
    922       //fflush(stdout);
     919#ifdef MPSR_DEBUG_DUMP
     920      command cmd = (command) mlv.lv->data;
     921      fprintf(stdout, "Dump got %s \n", cmd->arg1.name);
     922      fflush(stdout);
    923923#endif
    924       mpsr_SetCurrRingHdl(mlv.r);
     924      mpsr_SetCurrRingHdl(&mlv);
    925925      if (mlv.lv != NULL)
    926926      {
  • Singular/mpsr_Get.h

    r537f93 ra5189b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_Get.h,v 1.10 2000-08-14 12:56:42 obachman Exp $ */
     4/* $Id: mpsr_Get.h,v 1.11 2000-12-05 11:15:09 obachman Exp $ */
    55/***************************************************************
    66 *
     
    5252extern mpsr_Status_t mpsr_MergeLeftv(mpsr_leftv mlv1, mpsr_leftv mlv2);
    5353extern void mpsr_MapLeftv(leftv l, ring from_ring, ring to_ring);
    54 extern void mpsr_SetCurrRingHdl(ring r);
     54extern void mpsr_SetCurrRingHdl(mpsr_leftv mlv);
    5555extern idhdl mpsr_FindIdhdl(char *name, ring &r);
    5656
  • Singular/mpsr_GetMisc.cc

    r537f93 ra5189b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_GetMisc.cc,v 1.21 2000-10-19 15:00:17 obachman Exp $ */
     4/* $Id: mpsr_GetMisc.cc,v 1.22 2000-12-05 11:15:09 obachman Exp $ */
    55
    66/***************************************************************
     
    283283// if one is found, then this one is set to the new global ring
    284284// otherwise, a ring name is generated, and a new idhdl is created
    285 void mpsr_SetCurrRingHdl(ring r)
     285void mpsr_SetCurrRingHdl(mpsr_leftv mlv)
    286286{
    287287  idhdl h = IDROOT, rh = NULL;
     288  ring r = mlv->r;
    288289
    289290  if (r == NULL)
     
    315316    if (currRingHdl != NULL && IDRING(currRingHdl) != currRing)
    316317      mpsr_SetCurrRing(IDRING(currRingHdl), TRUE);
     318
     319    // reset debug field so that RingOfLm does not complain
     320    // this does nothing on !PDEBUG
     321    p_SetRingOfLeftv(mlv->lv, IDRING(rh));
    317322
    318323    rSetHdl(rh, TRUE);
     
    339344
    340345
    341 int gringcounter = 0;
    342 char grname[14];
     346static int gringcounter = 0;
     347static char grname[14];
    343348
    344349static char* GenerateRingName()
  • Singular/mpsr_Put.cc

    r537f93 ra5189b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_Put.cc,v 1.22 2000-08-14 12:56:43 obachman Exp $ */
     4/* $Id: mpsr_Put.cc,v 1.23 2000-12-05 11:15:09 obachman Exp $ */
    55
    66/***************************************************************
     
    570570    {
    571571      failr(mpsr_PutLeftv(link, (leftv) h, NULL));
    572 #ifdef MPSR_DEBUG
    573       //Print("Dumped Proc %s\n", IDID(h));
     572#ifdef MPSR_DEBUG_DUMP
     573      Print("Dumped Proc %s\n", IDID(h));
    574574#endif
    575575    }
     
    601601#endif
    602602
    603 #ifdef MPSR_DEBUG
    604       //Print("Dumped %s\n", IDID(h));
     603#ifdef MPSR_DEBUG_DUMP
     604      Print("Dumped %s\n", IDID(h));
    605605#endif
    606606      if (IDTYP(h) == RING_CMD || IDTYP(h) == QRING_CMD ||
     
    643643          if (mpsr_PutLeftv(link, lv, r) != mpsr_Success) break;
    644644#endif
    645 #ifdef MPSR_DEBUG
    646           //Print("Dumped %s\n", IDID(h2));
     645#ifdef MPSR_DEBUG_DUMP
     646          Print("Dumped %s\n", IDID(h2));
    647647#endif
    648648          h2 = h2->next;
  • Singular/pDebug.cc

    r537f93 ra5189b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pDebug.cc,v 1.15 2000-11-17 14:07:12 Singular Exp $
     9 *  Version: $Id: pDebug.cc,v 1.16 2000-12-05 11:15:09 obachman Exp $
    1010 *******************************************************************/
    1111
     
    356356        pDivisibleBy_ShortFalse, (unsigned long) ((double)pDivisibleBy_ShortFalse*((double)100)/(double)pDivisibleBy_FALSE));
    357357}
    358 #endif
     358
     359#if (OM_TRACK > 2) && defined(OM_TRACK_CUSTOM)
     360
     361#include "ideals.h"
     362#include "lists.h"
     363#include "ipid.h"
     364
     365
     366void p_SetRingOfPoly(poly p, ring r)
     367{
     368  while (p != NULL)
     369  {
     370    p_SetRingOfLm(p, r);
     371    pIter(p);
     372  }
     373}
     374
     375void p_SetRingOfIdeal(ideal id, ring r)
     376{
     377  if (id == NULL) return;
     378 
     379  int i, n = id->ncols*id->nrows;
     380 
     381  for (i=0; i<n; i++)
     382  {
     383    p_SetRingOfPoly(id->m[i], r);
     384  }
     385}
     386
     387void p_SetRingOfList(lists L, ring r)
     388{
     389  int i;
     390  for (i=0; i<L->nr; i++)
     391  {
     392    p_SetRingOfLeftv(&(L->m[i]), r);
     393  }
     394}
     395
     396void p_SetRingOfCommand(command cmd, ring r)
     397{
     398  if (cmd->op == PROC_CMD && cmd->argc == 2)
     399    p_SetRingOfLeftv(&(cmd->arg2), r);
     400  else if (cmd->argc > 0)
     401  {
     402    p_SetRingOfLeftv(&(cmd->arg1), r);
     403    if (cmd->argc > 1)
     404    {
     405      p_SetRingOfLeftv(&(cmd->arg2), r);
     406      if (cmd->argc > 2)
     407        p_SetRingOfLeftv(&(cmd->arg3), r);
     408    }
     409  }
     410}
     411
     412void p_SetRingOfLeftv(leftv l, ring r)
     413{
     414  while (l != NULL)
     415  {
     416    switch(l->rtyp)
     417    {
     418        case POLY_CMD:
     419        case VECTOR_CMD:
     420          p_SetRingOfPoly((poly) l->data, r); 
     421      break;
     422
     423      case IDEAL_CMD:
     424      case MODUL_CMD:
     425      case MATRIX_CMD:
     426      case MAP_CMD:
     427        p_SetRingOfIdeal((ideal) l->data, r);
     428        break;
     429
     430        case LIST_CMD:
     431          p_SetRingOfList((lists) l->data, r);
     432          break;
     433
     434        case COMMAND:
     435          p_SetRingOfCommand((command)l->data, r);
     436        default:
     437          break;
     438    }
     439    l = l->next;
     440  }
     441}
     442#endif // (OM_TRACK > 2) && defined(OM_TRACK_CUSTOM)
     443
     444#endif // PDEBUG
    359445
    360446#endif // PDEBUG_CC
  • Singular/polys-impl.h

    r537f93 ra5189b  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys-impl.h,v 1.61 2000-11-03 14:50:22 obachman Exp $ */
     6/* $Id: polys-impl.h,v 1.62 2000-12-05 11:15:10 obachman Exp $ */
    77
    88/***************************************************************
     
    159159#define pFalseReturn(cond)  do {if (! (cond)) return FALSE;} while (0)
    160160#if (OM_TRACK > 2) && defined(OM_TRACK_CUSTOM)
    161 #define p_SetRingOfPoly(p, r) omSetCustomOfAddr(p, r)
    162 #else
    163 #define p_SetRingOfPoly(p, r) ((void)0)
     161#define p_SetRingOfLm(p, r) omSetCustomOfAddr(p, r)
     162void p_SetRingOfLeftv(leftv l, ring r);
     163#else
     164#define p_SetRingOfLm(p, r) ((void)0)
     165#define p_SetRingOfLeftv(l, r) ((void)0)
    164166#endif
    165167
     
    172174#define pPolyAssumeReturn(cond)      ((void)0)
    173175#define _pPolyAssumeReturn(cond,p,r) ((void)0)
    174 #define p_SetRingOfPoly(p, r)        ((void)0)
     176#define p_SetRingOfLm(p, r)          ((void)0)
     177#define p_SetRingOfLeftv(l, r)       ((void)0)
    175178#endif // defined(PDEBUG)
    176179
     
    243246{                                               \
    244247  omTypeAllocBin(poly, p, bin);                 \
    245   p_SetRingOfPoly(p, r);                        \
     248  p_SetRingOfLm(p, r);                        \
    246249}                                               \
    247250while (0)
Note: See TracChangeset for help on using the changeset viewer.