Changeset e5fc4d4 in git


Ignore:
Timestamp:
Apr 22, 2005, 8:09:43 PM (18 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
d5bd816e7a2f244105274429818a7d2c90398eee
Parents:
a4240cfd934cce40503d1d44e30ef8a2d812ca97
Message:
*levandov: big update - in idElimination, the ordering check introduced, minor fixes throughout the code


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

Legend:

Unmodified
Added
Removed
  • kernel/gring.cc

    ra4240cf re5fc4d4  
    77 *  Author:  levandov (Viktor Levandovsky)
    88 *  Created: 8/00 - 11/00
    9  *  Version: $Id: gring.cc,v 1.24 2005-04-22 16:33:13 Singular Exp $
     9 *  Version: $Id: gring.cc,v 1.25 2005-04-22 18:09:42 levandov Exp $
    1010 *******************************************************************/
    1111#include "mod2.h"
     
    16171617poly nc_p_CopyGet(poly a, const ring r)
    16181618/* for use in getting the mult. matrix elements*/
    1619 {
     1619/* ring r must be a currRing! */
     1620/* for consistency, copies a poly from the comm. r->nc->basering */
     1621/* to its image in NC ring */
     1622{
     1623  if (r != currRing)
     1624  {
     1625#ifdef PDEBUF
     1626    Werror("nc_p_CopyGet call not in currRing");
     1627#endif
     1628    return(NULL);
     1629  }
    16201630  if (!rIsPluralRing(r)) return(p_Copy(a,r));
    16211631  if (r==r->nc->basering) return(p_Copy(a,r));
     
    16281638poly nc_p_CopyPut(poly a, const ring r)
    16291639/* for use in defining the mult. matrix elements*/
    1630 {
     1640/* ring r must be a currRing! */
     1641/* for consistency, puts a polynomial from the NC ring */
     1642/* to its presentation in the comm. r->nc->basering */
     1643{
     1644  if (r != currRing)
     1645  {
     1646#ifdef PDEBUF
     1647    Werror("nc_p_CopyGet call not in currRing");
     1648#endif
     1649    return(NULL);
     1650  }
    16311651  if (!rIsPluralRing(r)) return(p_Copy(a,r));
    16321652  if (r==r->nc->basering) return(p_Copy(a,r));
     
    16371657}
    16381658
    1639 int nc_CheckSubalgebra(poly PolyVar, ring r)
     1659BOOLEAN nc_CheckSubalgebra(poly PolyVar, ring r)
    16401660  /* returns TRUE if there were errors */
    16411661  /* checks whether product of vars from PolyVar defines */
    16421662  /* an admissible subalgebra of r */
    1643   /* r is indeed currRing */
     1663  /* r is indeed currRing and assumed to be noncomm. */
    16441664{
    16451665  ring save = currRing;
     
    16921712}
    16931713
    1694 int nc_CheckOrdCondition(matrix D, ring r)
     1714BOOLEAN nc_CheckOrdCondition(matrix D, ring r)
    16951715/* returns TRUE if there were errors */
    16961716/* checks whether the current ordering */
     
    17021722  ring save = currRing;
    17031723  int WeChangeRing = 0;
    1704   if (currRing != r)
     1724  if (r != currRing)
    17051725  {
    17061726    rChangeCurrRing(r);
     
    17091729  poly p,q;
    17101730  int i,j;
    1711   int report = 1;
     1731  int report = 0;
    17121732  for(i=1; i<r->N; i++)
    17131733  {
     
    17211741        p_SetExp(q,j,1,r);
    17221742        p_Setm(q,r);
    1723         if (p_LmCmp(q,p,r) != 1) /* i.e. lm(p)< lm(q)  */
     1743        if (p_LmCmp(q,p,r) != 1) /* i.e. lm(p)==xy < lm(q)==D_ij  */
    17241744        {
    17251745          Print("Bad ordering at %d,%d\n",i,j);
     
    17281748          p_Write(q,r);
    17291749#endif
    1730           report = 0;
     1750          report = 1;
    17311751        }
    17321752        p_Delete(&q,r);
     
    17381758  if ( WeChangeRing )
    17391759    rChangeCurrRing(save);
    1740   return(!report);
     1760  return(report);
    17411761}
    17421762
  • kernel/gring.h

    ra4240cf re5fc4d4  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: gring.h,v 1.10 2005-04-21 16:16:45 levandov Exp $ */
     6/* $Id: gring.h,v 1.11 2005-04-22 18:09:42 levandov Exp $ */
    77/*
    88* ABSTRACT additional defines etc for --with-plural
     
    1818/* the part, related to the interface */
    1919BOOLEAN nc_CallPlural(matrix CC, matrix DD, poly CN, poly DN, ring r);
    20 int nc_CheckOrdCondition(matrix D, ring r);
    21 int nc_CheckSubalgebra(poly PolyVar, ring r);
     20BOOLEAN nc_CheckOrdCondition(matrix D, ring r);
     21BOOLEAN nc_CheckSubalgebra(poly PolyVar, ring r);
    2222BOOLEAN nc_InitMultiplication(ring r);
    2323BOOLEAN rIsLikeOpposite(ring rBase, ring rCandidate);
  • kernel/ideals.cc

    ra4240cf re5fc4d4  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.9 2005-04-21 16:16:46 levandov Exp $ */
     4/* $Id: ideals.cc,v 1.10 2005-04-22 18:09:43 levandov Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    23742374    /* the subalgebra to be intersected with */
    23752375  {
    2376     if (currRing->nc->type!=nc_skew)
     2376    if (currRing->nc->type!=nc_skew) /* in (quasi)-commutative algebras every subalgebra is admissible */
    23772377    {
    23782378      if (nc_CheckSubalgebra(delVar,currRing))
     
    24262426
    24272427#ifdef HAVE_PLURAL
    2428   // update nc structure on tmpR
    2429   // in particular, tests the admissibility of the ordering
    2430   if (nc_rComplete(origR, &tmpR))
    2431   {
    2432     WerrorS("no elimination is possible: subalgebra is not admissible");
    2433     // goto cleanup
     2428  /* update nc structure on tmpR */
     2429  int BAD = 0;
     2430  if ( nc_rComplete(origR, &tmpR) )
     2431  {
     2432    Werror("error in nc_rComplete");
     2433    BAD = 1;
     2434  }
     2435  if (!BAD)
     2436  {
     2437    /* tests the admissibility of the new elim. ordering */
     2438    if ( nc_CheckOrdCondition( (&tmpR)->nc->D, &tmpR) )
     2439    {
     2440      Werror("no elimination is possible: ordering condition is violated");
     2441      BAD = 1;
     2442    }
     2443  }
     2444  if (BAD)
     2445  {
     2446    // cleanup
    24342447    omFree((ADDRESS)wv[0]);
    24352448    omFreeSize((ADDRESS)wv,ordersize*sizeof(int**));
     
    24382451    omFreeSize((ADDRESS)block1,ordersize*sizeof(int));
    24392452    rUnComplete(&tmpR);
    2440     if (w!=NULL)
     2453    if (w!=NULL)     
     2454    {
    24412455      delete w;
     2456    }
    24422457    return idCopy(h1);
    24432458  }
  • kernel/ring.cc

    ra4240cf re5fc4d4  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.32 2005-04-21 16:16:46 levandov Exp $ */
     4/* $Id: ring.cc,v 1.33 2005-04-22 18:09:42 levandov Exp $ */
    55
    66/*
     
    39293929  if (src->N != N)
    39303930  {
     3931    /* should not happen */
    39313932    WarnS("wrong nc_rComplete call");
    39323933    return TRUE;
    39333934  }
    3934 //   ncKill(dest); // in order to init new
    3935 //   if (nc_CallPlural(src->nc->C, src->nc->D, NULL, NULL, dest))
    3936 //   {
    3937 //     return TRUE;
    3938 //   }
    3939 //   else
    3940 //     return FALSE;
    3941   //  if (dest->nc != NULL)
    3942   //    ncKill(dest);
    3943   //  dest->nc           = (nc_struct *)omAlloc0(sizeof(nc_struct));
    3944   //  dest->nc->ref      = 1;
    3945   //  dest->nc->basering = dest;
    3946   //  dest->nc->type     =  src->nc->type;
    39473935  ring save = currRing;
    39483936  int WeChangeRing = 0;
     
    39623950    for (j= i+1; j<= N; j++)
    39633951    {
    3964       //      n = p_GetCoeff(MATELEM(C0,i,j), src);
    3965       //      p = pOne();
    3966       //      p_SetCoeff(p,n,dest);
    3967       //      MATELEM(C,i,j) = nc_p_CopyPut(p, dest);
    3968       p = prCopyR(MATELEM(C0,i,j), src, dest); // like in nc_p_CopyGet
    3969       MATELEM(C,i,j) = p; //nc_p_CopyPut(p, dest);
    3970       //      p_Delete(&p,dest);
     3952      n = n_Copy(p_GetCoeff(MATELEM(C0,i,j), src),src);
     3953      p = p_ISet(1,dest);
     3954      p_SetCoeff(p,n,dest);
     3955      MATELEM(C,i,j) = p;
    39713956      p = NULL;
    39723957      if (MATELEM(D0,i,j) != NULL)
    39733958      {
    3974         p = prCopyR(MATELEM(D0,i,j), src, dest); // like in nc_p_CopyGet
    3975         MATELEM(D,i,j) = p; //nc_p_CopyPut(p, dest);
    3976         //      p_Delete(&p,dest);
     3959        p = prCopyR(MATELEM(D0,i,j), src->nc->basering, dest);
     3960        MATELEM(D,i,j) = nc_p_CopyPut(p, dest);
     3961        p_Delete(&p, dest);
    39773962        p = NULL;
    39783963      }
    39793964    }
    39803965  }
    3981   idTest((ideal)C);
    3982   idTest((ideal)D);
     3966  /* One must test C and D _only_ in r->nc->basering!!! not in r!!! */
     3967  //  idTest((ideal)C);
     3968  //  idTest((ideal)D);
    39833969  id_Delete((ideal *)&(dest->nc->C),dest->nc->basering);
    39843970  id_Delete((ideal *)&(dest->nc->D),dest->nc->basering);
Note: See TracChangeset for help on using the changeset viewer.