| 624 | } |
| 625 | |
| 626 | syStrategy syResolution(ideal arg, int maxlength,intvec * w, BOOLEAN minim) |
| 627 | { |
| 628 | |
| 629 | #ifdef HAVE_PLURAL |
| 630 | const ideal idSaveCurrRingQuotient = currRing->qideal; |
| 631 | if( rIsSCA(currRing) ) |
| 632 | { |
| 633 | if( ncExtensions(TESTSYZSCAMASK) ) |
| 634 | { |
| 635 | currRing->qideal = SCAQuotient(currRing); |
| 636 | } |
| 637 | const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing); |
| 638 | const unsigned int m_iLastAltVar = scaLastAltVar(currRing); |
| 639 | arg = id_KillSquares(arg, m_iFirstAltVar, m_iLastAltVar, currRing, false); // kill suares in input! |
| 640 | } |
| 641 | #endif |
| 642 | |
| 643 | syStrategy result=(syStrategy)omAlloc0(sizeof(ssyStrategy)); |
| 644 | |
| 645 | if ((w!=NULL) && (!idTestHomModule(arg,currRing->qideal,w))) // is this right in SCA case??? |
| 646 | { |
| 647 | WarnS("wrong weights given(2):");w->show();PrintLn(); |
| 648 | idHomModule(arg,currRing->qideal,&w); |
| 649 | w->show();PrintLn(); |
| 650 | w=NULL; |
| 651 | } |
| 652 | if (w!=NULL) |
| 653 | { |
| 654 | result->weights = (intvec**)omAlloc0Bin(char_ptr_bin); |
| 655 | (result->weights)[0] = ivCopy(w); |
| 656 | result->length = 1; |
| 657 | } |
| 658 | resolvente fr = syResolvente(arg,maxlength,&(result->length),&(result->weights),minim); |
| 659 | resolvente fr1; |
| 660 | if (minim) |
| 661 | { |
| 662 | result->minres = (resolvente)omAlloc0((result->length+1)*sizeof(ideal)); |
| 663 | fr1 = result->minres; |
| 664 | } |
| 665 | else |
| 666 | { |
| 667 | result->fullres = (resolvente)omAlloc0((result->length+1)*sizeof(ideal)); |
| 668 | fr1 = result->fullres; |
| 669 | } |
| 670 | for (int i=result->length-1;i>=0;i--) |
| 671 | { |
| 672 | if (fr[i]!=NULL) |
| 673 | fr1[i] = fr[i]; |
| 674 | fr[i] = NULL; |
| 675 | } |
| 676 | omFreeSize((ADDRESS)fr,(result->length)*sizeof(ideal)); |
| 677 | |
| 678 | #ifdef HAVE_PLURAL |
| 679 | if( rIsSCA(currRing) ) |
| 680 | { |
| 681 | if( ncExtensions(TESTSYZSCAMASK) ) |
| 682 | { |
| 683 | currRing->qideal = idSaveCurrRingQuotient; |