Changeset b45eec in git for Singular/fglm.cc


Ignore:
Timestamp:
Apr 19, 2020, 9:57:14 PM (4 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ffcf715a570941627bf020648e93955f1596f2ef
Parents:
d49a473d44aa25c5ecc3126360ab3179ddb8af7e636fa5455e699fa8c0a820dd60e00a059f96f8ef
Message:
Merge branch 'stable' into lp_Z
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/fglm.cc

    rd49a47 rb45eec  
    105105}
    106106
    107 // Checks if the two rings sringHdl and dringHdl are compatible enough to
     107// Checks if the two rings sring and dring are compatible enough to
    108108// be used for the fglm. This means:
    109109//  1) Same Characteristic, 2) globalOrderings in both rings,
     
    115115// vperm must be a vector of length pVariables+1, initialized by 0.
    116116// If both rings are compatible, it stores the permutation of the
    117 // variables if mapped from sringHdl to dringHdl.
     117// variables if mapped from sring to dring.
    118118// if the rings are compatible, it returns FglmOk.
    119 // Should be called with currRing= IDRING( sringHdl );
     119// Should be called with currRing==sring
    120120FglmState
    121 fglmConsistency( idhdl sringHdl, idhdl dringHdl, int * vperm )
     121fglmConsistency( ring sring, ring dring, int * vperm )
    122122{
    123123    int k;
    124124    FglmState state= FglmOk;
    125     ring dring = IDRING( dringHdl );
    126     ring sring = IDRING( sringHdl );
    127125
    128126    if ( rChar(sring) != rChar(dring) )
     
    179177        if ( dring->qideal == NULL )
    180178        {
    181             Werror( "%s is a qring, current ring not", sringHdl->id );
     179            WerrorS( "source ring is a qring, destination ring not" );
    182180            return FglmIncompatibleRings;
    183181        }
    184182        // both rings are qrings, now check if both quotients define the same ideal.
    185183        // check if sring->qideal is contained in dring->qideal:
    186         rSetHdl( dringHdl );
    187         nMapFunc nMap=n_SetMap(currRing->cf, sring->cf );
     184        rChangeCurrRing( dring );
     185        nMapFunc nMap=n_SetMap(dring->cf, sring->cf );
    188186        ideal sqind = idInit( IDELEMS( sring->qideal ), 1 );
    189187        for ( k= IDELEMS( sring->qideal )-1; k >= 0; k-- )
    190188          (sqind->m)[k]= p_PermPoly( (sring->qideal->m)[k], vperm, sring,
    191                           currRing, nMap);
     189                          dring, nMap);
    192190        ideal sqindred = kNF( dring->qideal, NULL, sqind );
    193191        if ( ! idIs0( sqindred ) )
     
    198196        idDelete( & sqind );
    199197        idDelete( & sqindred );
    200         rSetHdl( sringHdl );
     198        rChangeCurrRing( sring );
    201199        if ( state != FglmOk ) return state;
    202200        // check if dring->qideal is contained in sring->qideal:
     
    224222        if ( dring->qideal != NULL )
    225223        {
    226             Werror( "current ring is a qring, %s not", sringHdl->id );
     224            WerrorS( "source ring is a qring, destination ring not" );
    227225            return FglmIncompatibleRings;
    228226        }
     
    281279    FglmState state = FglmOk;
    282280
    283     idhdl destRingHdl = currRingHdl;
     281    ring destRing = currRing;
    284282    // ring destRing = currRing;
    285283    ideal destIdeal = NULL;
    286     idhdl sourceRingHdl = (idhdl)first->data;
    287     rSetHdl( sourceRingHdl );
     284    ring sourceRing = (ring)first->Data();
     285    rChangeCurrRing( sourceRing );
    288286    // ring sourceRing = currRing;
    289287
    290     int * vperm = (int *)omAlloc0( (currRing->N+1)*sizeof( int ) );
    291     state= fglmConsistency( sourceRingHdl, destRingHdl, vperm );
    292     omFreeSize( (ADDRESS)vperm, (currRing->N+1)*sizeof(int) );
     288    int * vperm = (int *)omAlloc0( (sourceRing->N+1)*sizeof( int ) );
     289    state= fglmConsistency( sourceRing, destRing, vperm );
     290    omFreeSize( (ADDRESS)vperm, (sourceRing->N+1)*sizeof(int) );
    293291
    294292    if ( state == FglmOk )
    295293    {
    296         idhdl ih = currRing->idroot->get( second->Name(), myynest );
     294        idhdl ih = sourceRing->idroot->get( second->Name(), myynest );
    297295        if ( (ih != NULL) && (IDTYP(ih)==IDEAL_CMD) )
    298296        {
    299297            ideal sourceIdeal;
    300             if ( currRing->qideal != NULL )
     298            if ( sourceRing->qideal != NULL )
    301299                sourceIdeal= fglmUpdatesource( IDIDEAL( ih ) );
    302300            else
     
    307305                // Now the settings are compatible with FGLM
    308306                assumeStdFlag( (leftv)ih );
    309                 if ( fglmzero( IDRING(sourceRingHdl), sourceIdeal, IDRING(destRingHdl), destIdeal, FALSE, (currRing->qideal != NULL) ) == FALSE )
     307                if ( fglmzero( sourceRing, sourceIdeal, destRing, destIdeal, FALSE, (currRing->qideal != NULL) ) == FALSE )
    310308                    state= FglmNotReduced;
    311309            }
    312310        } else state= FglmNoIdeal;
    313311    }
    314     if ( currRingHdl != destRingHdl )
    315         rSetHdl( destRingHdl );
     312    if ( currRing != destRing )
     313        rChangeCurrRing( destRing );
    316314    switch (state)
    317315    {
     
    325323            break;
    326324        case FglmIncompatibleRings:
    327             Werror( "ring %s and current ring are incompatible", first->Name() );
     325            WerrorS( "source ring and current ring are incompatible" );
    328326            destIdeal= NULL;
    329327            break;
    330328        case FglmNoIdeal:
    331             Werror( "Can't find ideal %s in ring %s", second->Name(), first->Name() );
     329            Werror( "Can't find ideal %s in source ring", second->Name() );
    332330            destIdeal= NULL;
    333331            break;
Note: See TracChangeset for help on using the changeset viewer.