Changeset 22579cf in git
- Timestamp:
- Mar 15, 2011, 7:17:44 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 273fed0aea0c3cb00dc08f02c5d5340a2a781f23
- Parents:
- 91b031a4e88cb480f4ba993bf5904694c62d9b34
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
r91b031 r22579cf 2983 2983 } 2984 2984 } 2985 2986 // test the La Scala case' output 2987 assume( (iiOp == LRES_CMD) == (r->syRing != NULL) ); 2988 assume( (iiOp == LRES_CMD) == (r->resPairs != NULL) ); 2989 assume( (r->minres != NULL) || (r->fullres != NULL) ); 2990 2985 2991 return FALSE; 2986 2992 } … … 4190 4196 { 4191 4197 intvec *weights=(intvec*)atGet(v,"isHomog",INTVEC_CMD); 4192 res->data=(char *)syMinimize((syStrategy)v->Data()); 4198 4199 syStrategy tmp=(syStrategy)v->Data(); 4200 tmp = syMinimize(tmp); // enrich itself! 4201 4202 res->data=(char *)tmp; 4203 4193 4204 if (weights!=NULL) 4194 4205 atSet(res, omStrDup("isHomog"),ivCopy(weights),INTVEC_CMD); 4206 4195 4207 return FALSE; 4196 4208 } -
Singular/ipconv.cc
r91b031 r22579cf 236 236 237 237 syStrategy tmp=(syStrategy)in->CopyD(); 238 238 239 out->data=(void *)syConvRes(tmp,TRUE,add_row_shift); 239 240 } -
Singular/ipshell.cc
r91b031 r22579cf 2110 2110 } 2111 2111 R->order[j]=rOrderName(omStrDup((char*)vv->m[0].Data())); // assume STRING 2112 2112 2113 if (j==0) R->block0[0]=1; 2113 2114 else … … 2511 2512 { 2512 2513 syStrategy syzstr=(syStrategy)u->Data(); 2514 2513 2515 BOOLEAN minim=(int)(long)w->Data(); 2514 2516 int row_shift=0; … … 2522 2524 (*weights) -= add_row_shift; 2523 2525 } 2526 2524 2527 res->data=(void *)syBettiOfComputation(syzstr,minim,&row_shift,weights); 2525 2528 //row_shift += add_row_shift; 2526 2529 //Print("row_shift=%d, add_row_shift=%d\n",row_shift,add_row_shift); 2527 2530 atSet(res,omStrDup("rowShift"),(void*)add_row_shift,INT_CMD); 2531 2528 2532 return FALSE; 2529 2533 } … … 2542 2546 lists syConvRes(syStrategy syzstr,BOOLEAN toDel,int add_row_shift) 2543 2547 { 2544 if ((syzstr->fullres==NULL) && (syzstr->minres==NULL)) 2548 resolvente fullres = syzstr->fullres; 2549 resolvente minres = syzstr->minres; 2550 2551 const int length = syzstr->length; 2552 2553 if ((fullres==NULL) && (minres==NULL)) 2545 2554 { 2546 2555 if (syzstr->hilb_coeffs==NULL) 2547 2556 { 2548 syzstr->fullres = syReorder(syzstr->res,syzstr->length,syzstr);2557 fullres = syReorder(syzstr->res, length, syzstr); 2549 2558 } 2550 2559 else 2551 2560 { 2552 syzstr->minres = syReorder(syzstr->orderedRes,syzstr->length,syzstr); 2553 syKillEmptyEntres(syzstr->minres,syzstr->length); 2554 } 2555 } 2561 minres = syReorder(syzstr->orderedRes, length, syzstr); 2562 syKillEmptyEntres(minres, length); 2563 } 2564 } 2565 2556 2566 resolvente tr; 2557 2567 int typ0=IDEAL_CMD; 2558 if (syzstr->minres!=NULL) 2559 tr = syzstr->minres; 2568 2569 if (minres!=NULL) 2570 tr = minres; 2560 2571 else 2561 tr = syzstr->fullres; 2562 resolvente trueres=NULL; 2563 intvec ** w=NULL; 2564 if (syzstr->length>0) 2565 { 2566 trueres=(resolvente)omAlloc0((syzstr->length)*sizeof(ideal)); 2567 for (int i=(syzstr->length)-1;i>=0;i--) 2572 tr = fullres; 2573 2574 resolvente trueres=NULL; intvec ** w=NULL; 2575 2576 if (length>0) 2577 { 2578 trueres = (resolvente)omAlloc0((length)*sizeof(ideal)); 2579 for (int i=(length)-1;i>=0;i--) 2568 2580 { 2569 2581 if (tr[i]!=NULL) … … 2576 2588 if (syzstr->weights!=NULL) 2577 2589 { 2578 w = (intvec**)omAlloc0( (syzstr->length)*sizeof(intvec*));2579 for (int i= (syzstr->length)-1;i>=0;i--)2590 w = (intvec**)omAlloc0(length*sizeof(intvec*)); 2591 for (int i=length-1;i>=0;i--) 2580 2592 { 2581 2593 if (syzstr->weights[i]!=NULL) w[i] = ivCopy(syzstr->weights[i]); … … 2583 2595 } 2584 2596 } 2585 lists li = liMakeResolv(trueres,syzstr->length,syzstr->list_length,typ0, 2586 w,add_row_shift); 2587 if (w != NULL) omFreeSize(w, (syzstr->length)*sizeof(intvec*)); 2588 if (toDel) syKillComputation(syzstr); 2597 2598 lists li = liMakeResolv(trueres, length, syzstr->list_length,typ0, 2599 w, add_row_shift); 2600 2601 if (w != NULL) omFreeSize(w, length*sizeof(intvec*)); 2602 2603 if (toDel) 2604 syKillComputation(syzstr); 2605 else 2606 { 2607 if( fullres != NULL && syzstr->fullres == NULL ) 2608 syzstr->fullres = fullres; 2609 2610 if( minres != NULL && syzstr->minres == NULL ) 2611 syzstr->minres = minres; 2612 } 2613 2589 2614 return li; 2615 2616 2590 2617 } 2591 2618 -
Singular/subexpr.cc
r91b031 r22579cf 144 144 break; 145 145 case RESOLUTION_CMD: 146 syPrint((syStrategy)d); 146 { 147 syStrategy tmp=(syStrategy)d; 148 syPrint(tmp); 147 149 break; 150 } 148 151 case STRING_CMD: 149 152 PrintNSpaces(spaces); -
kernel/kstd2.cc
r91b031 r22579cf 816 816 } 817 817 } 818 818 819 /*2 819 820 * reduction procedure for the normal form -
kernel/ring.cc
r91b031 r22579cf 3340 3340 r->pFDeg = pWTotaldegree; // may be improved: p_Totaldegree for lp/dp/ls/.. blocks 3341 3341 } 3342 3342 3343 if (rOrd_is_Totaldegree_Ordering(r) || rOrd_is_WeightedDegree_Ordering(r)) 3343 3344 r->pFDeg = pDeg; -
kernel/syz1.cc
r91b031 r22579cf 1790 1790 return ivCopy(syzstr->betti); 1791 1791 } 1792 if ((syzstr->fullres==NULL) && (syzstr->minres==NULL)) 1792 1793 resolvente fullres = syzstr->fullres; 1794 resolvente minres = syzstr->minres; 1795 const int length = syzstr->length; 1796 1797 if ((fullres==NULL) && (minres==NULL)) 1793 1798 { 1794 1799 if (syzstr->hilb_coeffs==NULL) 1795 1800 { 1796 syzstr->fullres = syReorder(syzstr->res,syzstr->length,syzstr);1801 fullres = syReorder(syzstr->res, length, syzstr); 1797 1802 } 1798 1803 else 1799 1804 { 1800 syzstr->minres = syReorder(syzstr->orderedRes,syzstr->length,syzstr);1801 syKillEmptyEntres( syzstr->minres,syzstr->length);1805 minres = syReorder(syzstr->orderedRes, length, syzstr); 1806 syKillEmptyEntres(minres, length); 1802 1807 } 1803 } 1808 } 1809 1804 1810 intvec *result=NULL; 1805 if (syzstr->fullres!=NULL) 1806 result = syBetti(syzstr->fullres,syzstr->length,&dummy,weights,minim,row_shift); 1811 1812 if (fullres!=NULL) 1813 result = syBetti(fullres,length,&dummy,weights,minim,row_shift); 1807 1814 else 1808 result = syBetti(syzstr->minres,syzstr->length,&dummy,weights,minim,row_shift); 1815 result = syBetti(minres,length,&dummy,weights,minim,row_shift); 1816 1817 1818 return result; /// Don't change the syzstr??? 1819 1820 // TODO: cleanup thses! 1821 if( fullres != NULL && syzstr->fullres == NULL ) 1822 syzstr->fullres = fullres; 1823 if( minres != NULL && syzstr->minres == NULL ) 1824 syzstr->minres = minres; 1825 1809 1826 if ((result!=NULL) 1810 1827 && ((minim) || (syzstr->resPairs!=NULL)) 1811 1828 && std_weights) 1812 1829 { 1813 syzstr->betti = ivCopy(result); 1814 } 1830 syzstr->betti = ivCopy(result); // cache the result... 1831 } 1832 1815 1833 return result; 1816 1834 } … … 1926 1944 void syPrint(syStrategy syzstr) 1927 1945 { 1928 if ((syzstr->resPairs==NULL) && (syzstr->fullres==NULL) 1929 && (syzstr->minres==NULL)) 1946 if ( (syzstr->resPairs==NULL) && 1947 (syzstr->fullres==NULL) && 1948 (syzstr->minres==NULL) && 1949 (syzstr->resolution == NULL) ) 1930 1950 { 1931 1951 PrintS("No resolution defined\n"); 1932 1952 return; 1933 1953 } 1934 int l=0; 1935 if (syzstr->resolution==NULL) 1936 { 1937 int j; 1954 1955 intvec* resolution = syzstr->resolution; 1956 1957 if (resolution==NULL) 1958 { 1938 1959 if (syzstr->resPairs!=NULL) 1939 1960 { 1940 syzstr->resolution = new intvec(syzstr->length+1);1941 SRes rP =syzstr->resPairs;1942 assume(idRankFreeModule(syzstr->res[1], 1943 (syzstr->syRing != NULL ? syzstr->syRing : currRing))==syzstr->res[1]->rank);1944 (*syzstr->resolution)[0] = syzstr->res[1]->rank;1945 while (( l<syzstr->length) && (rP[l]!=NULL))1946 { 1947 j=0;1948 while ((j<(*syzstr->Tl)[ l]) &&1949 ((rP[ l][j].lcm!=NULL) || (rP[l][j].syz!=NULL)))1950 { 1951 if (rP[ l][j].isNotMinimal==NULL)1952 ((* syzstr->resolution)[l+1])++;1961 resolution = new intvec(syzstr->length+1); 1962 SRes rP = syzstr->resPairs; 1963 // assume(idRankFreeModule(syzstr->res[1], (syzstr->syRing != NULL ? syzstr->syRing : currRing))==syzstr->res[1]->rank); 1964 (*resolution)[0] = syzstr->res[1]->rank; 1965 int k=0; 1966 while ((k<syzstr->length) && (rP[k]!=NULL)) 1967 { 1968 int j = 0; 1969 while ((j<(*syzstr->Tl)[k]) && 1970 ((rP[k][j].lcm!=NULL) || (rP[k][j].syz!=NULL))) 1971 { 1972 if (rP[k][j].isNotMinimal==NULL) 1973 ((*resolution)[k+1])++; 1953 1974 j++; 1954 1975 } 1955 l++;1976 k++; 1956 1977 } 1957 1978 } 1958 1979 else 1959 1980 { 1981 resolution = new intvec(syzstr->length+2); 1960 1982 resolvente rr; 1961 syzstr->resolution = new intvec(syzstr->length+2);1962 1983 if (syzstr->minres!=NULL) 1963 1984 rr = syzstr->minres; 1964 1985 else 1965 1986 rr = syzstr->fullres; 1966 (* syzstr->resolution)[0]1987 (*resolution)[0] 1967 1988 = si_max(1,(int)idRankFreeModule(rr[0], 1968 1989 (syzstr->syRing != NULL ? syzstr->syRing : currRing))); 1969 while ((l<syzstr->length) && (rr[l]!=NULL)) 1970 { 1971 j = IDELEMS(rr[l]); 1972 while ((j>0) && (rr[l]->m[j-1]==NULL)) j--; 1973 ((*syzstr->resolution)[l+1]) = j; 1974 l++; 1990 int k=0; 1991 while ((k<syzstr->length) && (rr[k]!=NULL)) 1992 { 1993 (*resolution)[k+1] = idSize(rr[k]); 1994 k++; 1975 1995 } 1976 1996 } … … 1979 1999 int sl=strlen(sn); 1980 2000 syPrintEmptySpaces1(sl); 1981 l= 0;2001 int k = 0; 1982 2002 loop 1983 2003 { 1984 if (( l>=syzstr->resolution->length()) || ((*syzstr->resolution)[l]==0))2004 if ((k>=resolution->length()) || ((*resolution)[k]==0)) 1985 2005 break; 1986 Print("%d",(* syzstr->resolution)[l]);2006 Print("%d",(*resolution)[k]); 1987 2007 syPrintEmptySpaces1(sl+5); 1988 l++;2008 k++; 1989 2009 } 1990 2010 PrintLn(); 1991 l= 0;2011 k = 0; 1992 2012 loop 1993 2013 { 1994 if (( l>=syzstr->resolution->length()) || ((*syzstr->resolution)[l]==0))2014 if ((k>=resolution->length()) || ((*resolution)[k]==0)) 1995 2015 break; 1996 2016 PrintS(sn); 1997 if ((( l+1)>=syzstr->resolution->length()) || ((*syzstr->resolution)[(l+1)]==0))2017 if (((k+1)>=resolution->length()) || ((*resolution)[(k+1)]==0)) 1998 2018 break; 1999 2019 PrintS(" <-- "); 2000 syPrintEmptySpaces((* syzstr->resolution)[l]);2001 l++;2020 syPrintEmptySpaces((*resolution)[k]); 2021 k++; 2002 2022 } 2003 2023 PrintLn(); 2004 2024 PrintLn(); 2005 l= 0;2025 k = 0; 2006 2026 loop 2007 2027 { 2008 if (( l>=syzstr->resolution->length()) || ((*syzstr->resolution)[l]==0))2028 if ((k>=resolution->length()) || ((*resolution)[k]==0)) 2009 2029 break; 2010 Print("%d", l);2011 syPrintEmptySpaces1(sl+5+syLengthInt((* syzstr->resolution)[l])-2012 syLengthInt( l));2013 l++;2030 Print("%d",k); 2031 syPrintEmptySpaces1(sl+5+syLengthInt((*resolution)[k])- 2032 syLengthInt(k)); 2033 k++; 2014 2034 } 2015 2035 PrintLn(); … … 2019 2039 PrintLn(); 2020 2040 } 2041 2042 if (syzstr->resolution == NULL) syzstr->resolution = resolution; 2021 2043 } 2022 2044 … … 2516 2538 rChangeCurrRing(origR); 2517 2539 pLmDelete(&redpol); 2540 2518 2541 if (TEST_OPT_PROT) PrintLn(); 2542 2543 if (syzstr->minres==NULL) 2544 if (syzstr->resPairs!=NULL) 2545 if (syzstr->hilb_coeffs==NULL) 2546 syzstr->minres = syReadOutMinimalRes(syzstr); 2547 2519 2548 return syzstr; 2520 2549 }
Note: See TracChangeset
for help on using the changeset viewer.