Changeset 4d94c97 in git


Ignore:
Timestamp:
Mar 15, 2012, 7:43:06 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '79dfb9a6d258bfeb991428bdb25b8f55e9e809b2')
Children:
da0565bb9765186b7c8bde819d2ea3522f22e26f
Parents:
90934a9f682716f4e6fe4afb6c7eb7b8f281b8bf
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-03-15 19:43:06+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-03-16 19:36:36+01:00
Message:
improved n[at]CoeffIsEqual

chg: they should test the *equality* of underlying rings,
e.g. in order to assure the coeffs of the following rings are the same:Q(P)[X],Q(P)[Y]
Location:
libpolys/polys/ext_fields
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/ext_fields/algext.cc

    r90934a r4d94c97  
    521521     registered cf and perform reference counting rather than creating
    522522     multiple copies of the same coefficient field/domain/ring */
    523   return (naRing == e->r);
     523  if (naRing == e->r)
     524    return TRUE;
    524525  /* (Note that then also the minimal ideals will necessarily be
    525526     the same, as they are attached to the ring.) */
     527
     528  // NOTE: Q(a)[x] && Q(a)[y] should better share the _same_ Q(a)...
     529  if( rEqual(naRing, e->r, TRUE) )
     530  {
     531    const ideal mi = naRing->minideal;
     532    assume( IDELEMS(mi) == 1 );
     533    ideal ii = e->i;
     534    assume( IDELEMS(ii) == 1 );
     535
     536    // TODO: the following should be extended for 2 *equal* rings...
     537    if( p_EqualPolys(mi->m[0], ii->m[0], naRing, e->r) )
     538    {
     539      id_Delete(&ii, e->r);
     540      rDelete(e->r);
     541      return TRUE;
     542    }
     543  }
     544
     545  return FALSE; 
     546 
    526547}
    527548
  • libpolys/polys/ext_fields/transext.cc

    r90934a r4d94c97  
    953953     registered cf and perform reference counting rather than creating
    954954     multiple copies of the same coefficient field/domain/ring */
    955   return (ntRing == e->r);
     955  if (ntRing == e->r)
     956    return TRUE;
     957
     958  // NOTE: Q(a)[x] && Q(a)[y] should better share the _same_ Q(a)...
     959  if( rEqual(ntRing, e->r, TRUE) )
     960  {
     961    rDelete(e->r);
     962    return TRUE;
     963  }
     964
     965  return FALSE; 
    956966}
    957967
Note: See TracChangeset for help on using the changeset viewer.