Changeset b45f583 in git for kernel/gfan.cc
- Timestamp:
- Nov 18, 2009, 4:32:14 PM (14 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 631b6c81789b80cf085b6b9269a246ec2c0728a1
- Parents:
- d1b6cc519b995304348ae07c8a484766256489bb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
rd1b6cc rb45f583 646 646 } //for 647 647 648 #if false648 #if true 649 649 /*Let's make the preprocessing here. This could already be done in the above for-loop, 650 650 * but for a start it is more convenient here. … … 660 660 for(int ii=0;ii<ddineq->rowsize;ii++) 661 661 { 662 double tmp; 662 //read row ii into gamma 663 double tmp; 663 664 for(int jj=1;jj<=this->numVars;jj++) 664 665 { … … 677 678 LObject *P = new sLObject(); 678 679 memset(P,0,sizeof(LObject)); 679 // P->p1=L->m[0]; 680 // P->p2=L->m[1]; 681 // ksCreateSpoly(P); 682 // pWrite(P->p); 683 // cout << "gamma="; 684 // gamma->show(1,0); 685 // cout << endl; 686 // cout << "inv="; 687 // for(int qq=0;qq<IDELEMS(initialForm);qq++) 688 // { 689 // pWrite0(initialForm->m[qq]); 690 // cout << ","; 691 // } 692 // cout << endl; 680 693 681 for(int jj=0;jj<=IDELEMS(initialForm)-2;jj++) 694 682 { 695 683 bool isMaybeFacet=FALSE; 696 684 P->p1=initialForm->m[jj]; //build spolys of initialForm in_v 697 // cout << "P->p1="; 698 // pWrite0(P->p1); 699 // cout << endl; 685 700 686 for(int kk=jj+1;kk<=IDELEMS(initialForm)-1;kk++) 701 687 { 702 688 P->p2=initialForm->m[kk]; 703 ksCreateSpoly(P); 704 /*cout << "P->p2="; 705 pWrite0(P->p2); 706 cout << endl; 707 cout << "spoly(p1,p2)="; 708 pWrite0(P->p); 709 cout << endl; */ 689 ksCreateSpoly(P); 710 690 if(P->p!=NULL) //spoly non zero=? 711 691 { … … 727 707 { 728 708 isMaybeFacet=TRUE; 729 break; 709 break;//for 730 710 } 731 711 } 732 712 if(isMaybeFacet==TRUE) 733 { 734 // dd_MatrixRowRemove(&ddineq,ii); 735 // set_addelem(redRows,ii); 736 // dd_set_si(ddineq->matrix[ii][0],1); 737 // falseGammaCounter++; 738 // cout << "Removing gamma!" << endl; 713 { 739 714 break;//while(p!=NULL) 740 715 } … … 750 725 void *_tmp = realloc(redRowsArray,(num_alloc*sizeof(int))); 751 726 if(!_tmp) 752 WerrorS(" Couldn't realloc memory\n");727 WerrorS("Woah dude! Couldn't realloc memory\n"); 753 728 redRowsArray = (int*)_tmp; 754 729 redRowsArray[num_elts]=ii; 755 730 num_elts++; 756 break;//for(int kk, since we have found one that is not in L 731 //break;//for(int kk, since we have found one that is not in L 732 goto _start; //mea culpa, mea culpa, mea maxima culpa 757 733 } 758 }//if(P->p!=NULL) 759 } 760 }//for 734 }//if(P->p!=NULL) 735 }//for k 736 }//for jj 737 _start:; 761 738 delete P; 762 739 //idDelete(L); … … 2684 2661 /** \brief Gather the output 2685 2662 * List of lists 2663 *\param *gc Pointer to gcone, preferably gcRoot ;-) 2686 2664 *\param n the number of cones 2665 * 2687 2666 */ 2688 2667 lists lprepareResult(gcone *gc, int n) … … 2694 2673 2695 2674 lists res=(lists)omAllocBin(slists_bin); 2696 res->Init(n); 2675 res->Init(n); //initialize to store n cones 2697 2676 for(int ii=0;ii<n;ii++) 2698 2677 { 2699 2678 res->m[ii].rtyp=LIST_CMD; 2700 2679 lists l=(lists)omAllocBin(slists_bin); 2701 l->Init( 4);2680 l->Init(5); 2702 2681 l->m[0].rtyp=INT_CMD; 2703 l->m[1].rtyp=INTVEC_CMD;2704 l->m[2].rtyp=IDEAL_CMD;2705 l->m[3].rtyp=RING_CMD;2706 // l->m[4].rtyp=LIST_CMD;2707 2682 l->m[0].data=(void*)gcAct->getUCN(); 2683 l->m[1].rtyp=IDEAL_CMD; 2684 l->m[1].data=(void*)idrCopyR_NoSort(gcAct->gcBasis,gcAct->getBaseRing()); 2685 2686 l->m[2].rtyp=INTVEC_CMD; 2708 2687 intvec iv=(gcAct->f2M(gcAct,gcAct->facetPtr)); 2709 l->m[1].data=(void*)ivCopy(&iv); 2710 l->m[2].data=(void*)idrCopyR_NoSort(gcAct->gcBasis,gcAct->getBaseRing()); 2711 l->m[3].data=(void*)(gcAct->getBaseRing()); 2712 // l->m[4].data=(void*)0; 2688 l->m[2].data=(void*)ivCopy(&iv); 2689 2690 l->m[3].rtyp=LIST_CMD; 2691 lists lCodim2List = (lists)omAllocBin(slists_bin); 2692 lCodim2List->Init(gcAct->numFacets); 2693 2694 fAct = gcAct->facetPtr;//fAct->codim2Ptr; 2695 int jj=0; 2696 while(fAct!=NULL && jj<gcAct->numFacets) 2697 { 2698 lCodim2List->m[jj].rtyp=INTVEC_CMD; 2699 intvec ivC2=(gcAct->f2M(gcAct,fAct,2)); 2700 lCodim2List->m[jj].data=(void*)ivCopy(&ivC2); 2701 jj++; 2702 fAct = fAct->next; 2703 } 2704 l->m[3].data=(void*)lCodim2List; 2705 2706 2707 l->m[4].rtyp=RING_CMD; 2708 l->m[4].data=(void*)(gcAct->getBaseRing()); 2709 2713 2710 res->m[ii].data=(void*)l; 2714 2711 gcAct = gcAct->next; … … 2718 2715 } 2719 2716 /** \brief Write facets of a cone into a matrix 2720 * Takes a pointer to a facet as 2nd arg in order to determine whether 2721 * it operates in codim 1 or 2 2717 * Takes a pointer to a facet as 2nd arg 2718 * f should always point to gc->facetPtr 2719 * param n is used to determine whether it operates in codim 1 or 2 2720 * 2722 2721 */ 2723 intvec gcone::f2M(gcone *gc, facet *f )2722 intvec gcone::f2M(gcone *gc, facet *f, int n) 2724 2723 { 2725 2724 facet *fAct; 2726 int codim=1; 2727 if(f==gc->facetPtr) 2725 intvec *res; 2726 intvec *fNormal = new intvec(gc->numVars); 2727 // int codim=n; 2728 // int bound; 2729 // if(f==gc->facetPtr) 2730 if(n==1) 2731 { 2732 intvec *m1Res=new intvec(gc->numFacets,gc->numVars,0); 2733 res = m1Res; 2728 2734 fAct = gc->facetPtr; 2735 // bound = gc->numFacets*(this->numVars); 2736 } 2729 2737 else 2730 2738 { 2731 fAct = gc->facetPtr->codim2Ptr;2732 codim=2;2733 }2734 /** mrRes is a matrix containing the facet normals AS ROWS*/ 2735 intvec *mRes=new intvec(this->numFacets,gc->numVars,0);//nrows==numFacets, ncols==numVars 2736 intvec *fNormal = new intvec(this->numVars);2739 fAct = f->codim2Ptr; 2740 intvec *m2Res = new intvec(f->numCodim2Facets,gc->numVars,0); 2741 res = m2Res; 2742 // bound = fAct->numCodim2Facets*(this->numVars); 2743 2744 } 2737 2745 int ii=0; 2738 // for(int ii=0;ii<gc->numFacets*(this->numVars);ii++) 2739 while(fAct!=NULL && ii<gc->numFacets*(this->numVars)) 2740 { 2741 fNormal=fAct->getFacetNormal(); 2742 for(int jj=0;jj<this->numVars ;jj++ ) 2743 { 2744 (*mRes)[ii]=(*fNormal)[jj]; 2746 while(fAct!=NULL )//&& ii < bound ) 2747 { 2748 fNormal = fAct->getFacetNormal(); 2749 for(int jj=0;jj<this->numVars;jj++) 2750 { 2751 (*res)[ii]=(*fNormal)[jj]; 2745 2752 ii++; 2746 2753 } 2747 2754 fAct = fAct->next; 2748 2755 } 2749 return *mRes; 2756 2757 delete fNormal; 2758 return *res; 2750 2759 } 2751 2760
Note: See TracChangeset
for help on using the changeset viewer.