Changeset f56364 in git


Ignore:
Timestamp:
May 14, 2004, 6:26:06 PM (20 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
eb3df5f6cd0d2f41b1e3e8e230de51ececf2fbc4
Parents:
76147f6348840c94403be9dcadc71bbd7fa68271
Message:
*levandov: noncomm preimage fixed, buckets fixed


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

Legend:

Unmodified
Added
Removed
  • kernel/gring.cc

    r76147f6 rf56364  
    77 *  Author:  levandov (Viktor Levandovsky)
    88 *  Created: 8/00 - 11/00
    9  *  Version: $Id: gring.cc,v 1.9 2004-05-12 11:24:36 levandov Exp $
     9 *  Version: $Id: gring.cc,v 1.10 2004-05-14 16:26:05 levandov Exp $
    1010 *******************************************************************/
    1111#include "mod2.h"
     
    13021302      if (pres!=NULL)
    13031303      {
    1304         coef=nMult(pGetCoeff(p),pGetCoeff(Q));
    1305         pres=p_Mult_nn(pres,coef,currRing);
     1304        coef = nMult(pGetCoeff(p),pGetCoeff(Q));
     1305        pres = p_Mult_nn(pres,coef,currRing);
    13061306        if (UseBuckets) sBucket_Add_p(bu_out,pres,pLength(pres));
    13071307        else res=p_Add_q(res,pres,currRing);
     
    14271427  freeT(PREFIX, rN);
    14281428  freeT(SUFFIX, rN);
     1429  pTest(res);
    14291430  return(res);
    14301431}
  • kernel/maps.cc

    r76147f6 rf56364  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: maps.cc,v 1.2 2004-05-12 11:24:37 levandov Exp $ */
     4/* $Id: maps.cc,v 1.3 2004-05-14 16:26:05 levandov Exp $ */
    55/*
    66* ABSTRACT - the mapping of polynomials to other rings
     
    193193*returns the preimage of id under theMap,
    194194*if id is empty or zero the kernel is computed
     195* (assumes) that both ring have the same coeff.field
    195196*/
    196197ideal maGetPreimage(ring theImageRing, map theMap, ideal id)
     
    248249
    249250#ifdef HAVE_PLURAL
    250   if (sourcering->nc!= NULL)
     251  if (rIsPluralRing(theImageRing))
    251252  {
    252253    rUnComplete(&tmpR);
    253     omFreeSize(orders, sizeof(int)*(ordersize));
    254     omFreeSize(block0, sizeof(int)*(ordersize));
    255     omFreeSize(block1, sizeof(int)*(ordersize));
    256     omFreeSize(wv, sizeof(int*)*(ordersize));
    257     omFreeSize(names, (currRing->N)*sizeof(char*));
    258     if (sourcering->nc->type!=nc_comm)
     254    omFreeSize(orders, sizeof(int)*(ordersize));orders=NULL;
     255    omFreeSize(block0, sizeof(int)*(ordersize));block0=NULL;
     256    omFreeSize(block1, sizeof(int)*(ordersize));block1=NULL;
     257    omFreeSize(wv, sizeof(int*)*(ordersize)); wv=NULL;
     258    omFreeSize(names, (currRing->N)*sizeof(char*)); names=NULL;
     259    memset(&tmpR,0,sizeof(tmpR));
     260    if ((rIsPluralRing(sourcering)) && (sourcering->nc->type!=nc_comm))
    259261    {
    260262      Werror("Sorry, not yet implemented for noncomm. rings");
    261263      return NULL;
    262264    }   
    263     if ( rSum(theImageRing, sourcering, &tmpR ) !=1 )
     265    ring tmpR_ptr;
     266    if ( rSum(theImageRing, sourcering, tmpR_ptr ) !=1 )
    264267    {
    265268      /* something is wrong with the rings... */
     
    267270      return NULL;
    268271    }
     272    memcpy(&tmpR,tmpR_ptr,sizeof(tmpR));
     273    // Action!
     274  }
     275  if (nSetMap(theImageRing) != nCopy)
     276  {
     277    Werror("Coefficient fields must be equal");
     278    return NULL;
    269279  }
    270280#endif
     
    337347  idSkipZeroes(temp1);
    338348  rUnComplete(&tmpR);
    339   omFreeSize(orders, sizeof(int)*(ordersize));
    340   omFreeSize(block0, sizeof(int)*(ordersize));
    341   omFreeSize(block1, sizeof(int)*(ordersize));
    342   omFreeSize(wv, sizeof(int*)*(ordersize));
    343   omFreeSize(names, (currRing->N)*sizeof(char*));
     349  if (orders!=NULL)
     350  {
     351    omFreeSize(orders, sizeof(int)*(ordersize));
     352    omFreeSize(block0, sizeof(int)*(ordersize));
     353    omFreeSize(block1, sizeof(int)*(ordersize));
     354    omFreeSize(wv, sizeof(int*)*(ordersize));
     355    omFreeSize(names, (currRing->N)*sizeof(char*));
     356  }
    344357  return temp1;
    345358}
  • kernel/sbuckets.cc

    r76147f6 rf56364  
    88 *  Author:  obachman (Olaf Bachmann)
    99 *  Created: 9/00
    10  *  Version: $Id: sbuckets.cc,v 1.1.1.1 2003-10-06 12:16:02 Singular Exp $
     10 *  Version: $Id: sbuckets.cc,v 1.2 2004-05-14 16:26:06 levandov Exp $
    1111 *******************************************************************/
    1212#include "mod2.h"
     
    145145    bucket->buckets[i].p = NULL;
    146146    bucket->buckets[i].length = 0;
     147    if (p==NULL)
     148    {
     149      if (i > bucket->max_bucket) bucket->max_bucket = i;
     150      return;
     151    }
    147152    i = LOG2(length);
    148153  }
Note: See TracChangeset for help on using the changeset viewer.