Changeset 49fddf in git
- Timestamp:
- Jan 30, 2018, 1:48:38 PM (6 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 2e6614882c97f6c6ba1dd422f74c5898994711d2
- Parents:
- 32d0c9c8588c212e4f888fe57d709659d06fbe45
- Location:
- Singular/dyn_modules/syzextra
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/syzextra/mod_main.cc
r32d0c9c r49fddf 256 256 WarnS("Tail needs a single poly/vector/ideal/module argument..."); 257 257 return TRUE; 258 }259 260 261 262 static BOOLEAN _ComputeLeadingSyzygyTerms(leftv res, leftv h)263 {264 const SchreyerSyzygyComputationFlags attributes(currRingHdl);265 266 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;267 const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;268 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;269 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;270 271 const ring r = attributes.m_rBaseRing;272 NoReturn(res);273 274 if( h == NULL )275 {276 WarnS("ComputeLeadingSyzygyTerms needs an argument...");277 return TRUE;278 }279 280 assume( h != NULL );281 282 if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)283 {284 const ideal id = (const ideal)h->Data();285 286 assume(id != NULL);287 288 assume( !OPT__LEAD2SYZ );289 290 h = h->Next(); assume (h == NULL);291 292 const ideal newid = ComputeLeadingSyzygyTerms(id, attributes);293 294 res->data = newid; res->rtyp = MODUL_CMD;295 return FALSE;296 }297 298 WarnS("ComputeLeadingSyzygyTerms needs a single ideal/module argument...");299 return TRUE;300 }301 302 /// sorting wrt <c,ds> & reversing...303 /// change the input inplace!!!304 // TODO: use a ring with >_{c, ds}!???305 static BOOLEAN _Sort_c_ds(leftv res, leftv h)306 {307 const SchreyerSyzygyComputationFlags attributes(currRingHdl);308 309 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;310 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;311 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;312 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;313 314 NoReturn(res);315 316 const ring r = attributes.m_rBaseRing;317 NoReturn(res);318 319 if( h == NULL )320 {321 WarnS("Sort_c_ds needs an argument...");322 return TRUE;323 }324 325 assume( h != NULL );326 327 if( (h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)328 && (h->rtyp == IDHDL) // must be a variable!329 && (h->e == NULL) // not a list element330 )331 {332 const ideal id = (const ideal)h->Data();333 334 assume(id != NULL);335 336 assume (h->Next() == NULL);337 338 id_Test(id, r);339 340 Sort_c_ds(id, r); // NOT A COPY! inplace sorting!!!341 342 // res->data = id;343 // res->rtyp = h->Typ();344 345 // NOTE: nothing is to be returned!!!346 return FALSE;347 }348 349 WarnS("ComputeLeadingSyzygyTerms needs a single ideal/module argument (must be a variable!)...");350 return TRUE;351 }352 353 354 static BOOLEAN _Compute2LeadingSyzygyTerms(leftv res, leftv h)355 {356 const SchreyerSyzygyComputationFlags attributes(currRingHdl);357 358 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;359 const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;360 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;361 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;362 363 const ring r = attributes.m_rBaseRing;364 NoReturn(res);365 366 if( h == NULL )367 {368 WarnS("Compute2LeadingSyzygyTerms needs an argument...");369 return TRUE;370 }371 372 assume( h != NULL );373 374 assume( OPT__LEAD2SYZ ); // ???375 376 if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)377 {378 const ideal id = (const ideal)h->Data();379 380 assume(id != NULL);381 382 h = h->Next(); assume (h == NULL);383 384 res->data = Compute2LeadingSyzygyTerms(id, attributes);385 res->rtyp = MODUL_CMD;386 387 return FALSE;388 }389 390 WarnS("Compute2LeadingSyzygyTerms needs a single ideal/module argument...");391 return TRUE;392 }393 394 395 396 /// proc SSFindReducer(def product, def syzterm, def L, def T, list #)397 static BOOLEAN _FindReducer(leftv res, leftv h)398 {399 const SchreyerSyzygyComputationFlags attributes(currRingHdl);400 401 // const BOOLEAN OPT__SYZCHECK = attributes.OPT__SYZCHECK;402 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;403 // const BOOLEAN OPT__HYBRIDNF = attributes.OPT__HYBRIDNF;404 const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;405 406 const char* usage = "`FindReducer(<poly/vector>, <vector/0>, <ideal/module>[,<module>])` expected";407 const ring r = attributes.m_rBaseRing;408 409 NoReturn(res);410 411 412 if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL))413 {414 WerrorS(usage);415 return TRUE;416 }417 418 const poly product = (poly) h->Data(); assume (product != NULL);419 420 421 h = h->Next();422 if ((h==NULL) || !((h->Typ()==VECTOR_CMD) || (h->Data() == NULL)) )423 {424 WerrorS(usage);425 return TRUE;426 }427 428 poly syzterm = NULL;429 430 if(h->Typ()==VECTOR_CMD)431 syzterm = (poly) h->Data();432 433 434 435 h = h->Next();436 if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))437 {438 WerrorS(usage);439 return TRUE;440 }441 442 const ideal L = (ideal) h->Data(); h = h->Next();443 444 assume( IDELEMS(L) > 0 );445 446 ideal LS = NULL;447 448 if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL))449 {450 LS = (ideal)h->Data();451 h = h->Next();452 }453 454 #ifndef SING_NDEBUG455 if( LIKELY( OPT__TAILREDSYZ) )456 assume (LS != NULL);457 #endif458 459 assume( h == NULL );460 461 res->rtyp = VECTOR_CMD;462 res->data = FindReducer(product, syzterm, L, LS, attributes);463 464 return FALSE;465 466 258 } 467 259 … … 1172 964 ADD("Tail", FALSE, Tail); 1173 965 1174 ADD("ComputeLeadingSyzygyTerms", FALSE, _ComputeLeadingSyzygyTerms);1175 ADD("Compute2LeadingSyzygyTerms", FALSE, _Compute2LeadingSyzygyTerms);1176 1177 ADD("Sort_c_ds", FALSE, _Sort_c_ds);1178 ADD("FindReducer", FALSE, _FindReducer);1179 1180 1181 966 ADD("ReduceTerm", FALSE, _ReduceTerm); 1182 967 ADD("TraverseTail", FALSE, _TraverseTail);
Note: See TracChangeset
for help on using the changeset viewer.