Changeset 286859 in git
- Timestamp:
- Feb 21, 2020, 11:46:33 AM (4 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- f9735ce815bfa3b7bc4f740e85c7fd8790d6b548
- Parents:
- c6b4e50c4010664ea60dd5d8284301d8087dcc0a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/fglm.cc
rc6b4e50 r286859 105 105 } 106 106 107 // Checks if the two rings sring Hdl and dringHdlare compatible enough to107 // Checks if the two rings sring and dring are compatible enough to 108 108 // be used for the fglm. This means: 109 109 // 1) Same Characteristic, 2) globalOrderings in both rings, … … 115 115 // vperm must be a vector of length pVariables+1, initialized by 0. 116 116 // If both rings are compatible, it stores the permutation of the 117 // variables if mapped from sring Hdl to dringHdl.117 // variables if mapped from sring to dring. 118 118 // if the rings are compatible, it returns FglmOk. 119 // Should be called with currRing= IDRING( sringHdl );119 // Should be called with currRing==sring 120 120 FglmState 121 fglmConsistency( idhdl sringHdl, idhdl dringHdl, int * vperm )121 fglmConsistency( ring sring, ring dring, int * vperm ) 122 122 { 123 123 int k; 124 124 FglmState state= FglmOk; 125 ring dring = IDRING( dringHdl );126 ring sring = IDRING( sringHdl );127 125 128 126 if ( rChar(sring) != rChar(dring) ) … … 179 177 if ( dring->qideal == NULL ) 180 178 { 181 Werror ( "%s is a qring, current ring not", sringHdl->id);179 WerrorS( "source ring is a qring, destination ring not" ); 182 180 return FglmIncompatibleRings; 183 181 } 184 182 // both rings are qrings, now check if both quotients define the same ideal. 185 183 // check if sring->qideal is contained in dring->qideal: 186 r SetHdl( dringHdl);187 nMapFunc nMap=n_SetMap( currRing->cf, sring->cf );184 rChangeCurrRing( dring ); 185 nMapFunc nMap=n_SetMap(dring->cf, sring->cf ); 188 186 ideal sqind = idInit( IDELEMS( sring->qideal ), 1 ); 189 187 for ( k= IDELEMS( sring->qideal )-1; k >= 0; k-- ) 190 188 (sqind->m)[k]= p_PermPoly( (sring->qideal->m)[k], vperm, sring, 191 currRing, nMap);189 dring, nMap); 192 190 ideal sqindred = kNF( dring->qideal, NULL, sqind ); 193 191 if ( ! idIs0( sqindred ) ) … … 198 196 idDelete( & sqind ); 199 197 idDelete( & sqindred ); 200 r SetHdl( sringHdl);198 rChangeCurrRing( sring ); 201 199 if ( state != FglmOk ) return state; 202 200 // check if dring->qideal is contained in sring->qideal: … … 224 222 if ( dring->qideal != NULL ) 225 223 { 226 Werror ( "current ring is a qring, %s not", sringHdl->id);224 WerrorS( "source ring is a qring, destination ring not" ); 227 225 return FglmIncompatibleRings; 228 226 } … … 281 279 FglmState state = FglmOk; 282 280 283 idhdl destRingHdl = currRingHdl;281 ring destRing = currRing; 284 282 // ring destRing = currRing; 285 283 ideal destIdeal = NULL; 286 idhdl sourceRingHdl = (idhdl)first->data;287 r SetHdl( sourceRingHdl);284 ring sourceRing = (ring)first->Data(); 285 rChangeCurrRing( sourceRing ); 288 286 // ring sourceRing = currRing; 289 287 290 int * vperm = (int *)omAlloc0( ( currRing->N+1)*sizeof( int ) );291 state= fglmConsistency( sourceRing Hdl, 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) ); 293 291 294 292 if ( state == FglmOk ) 295 293 { 296 idhdl ih = currRing->idroot->get( second->Name(), myynest );294 idhdl ih = sourceRing->idroot->get( second->Name(), myynest ); 297 295 if ( (ih != NULL) && (IDTYP(ih)==IDEAL_CMD) ) 298 296 { 299 297 ideal sourceIdeal; 300 if ( currRing->qideal != NULL )298 if ( sourceRing->qideal != NULL ) 301 299 sourceIdeal= fglmUpdatesource( IDIDEAL( ih ) ); 302 300 else … … 307 305 // Now the settings are compatible with FGLM 308 306 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 ) 310 308 state= FglmNotReduced; 311 309 } 312 310 } else state= FglmNoIdeal; 313 311 } 314 if ( currRing Hdl != destRingHdl)315 r SetHdl( destRingHdl);312 if ( currRing != destRing ) 313 rChangeCurrRing( destRing ); 316 314 switch (state) 317 315 { … … 325 323 break; 326 324 case FglmIncompatibleRings: 327 Werror ( "ring %s and current ring are incompatible", first->Name());325 WerrorS( "source ring and current ring are incompatible" ); 328 326 destIdeal= NULL; 329 327 break; 330 328 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() ); 332 330 destIdeal= NULL; 333 331 break;
Note: See TracChangeset
for help on using the changeset viewer.