Changeset 9abcc6 in git for Singular/dyn_modules/gfanlib/bbfan.cc
- Timestamp:
- Mar 12, 2014, 9:08:50 AM (10 years ago)
- Branches:
- (u'spielwiese', 'df6a8e29030ff93c6ad53051028727af7d339fa0')
- Children:
- 7aa26b206f76709abff0bab4adaac2dfc4ddb4ef
- Parents:
- c890142d6921b9d30b396af149a3df2fbc57981a
- git-author:
- Yue Ren <ren@mathematik.uni-kl.de>2014-03-12 10:08:50+02:00
- git-committer:
- Yue Ren <ren@mathematik.uni-kl.de>2015-02-06 13:47:03+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/gfanlib/bbfan.cc
rc89014 r9abcc6 40 40 std::string s = zf->toString(2+4+8+128); 41 41 return omStrDup(s.c_str()); 42 // ======= 43 // std::stringstream s; 44 // std::string raysAndCones = zf->toStringJustRaysAndMaximalCones(); 45 // s << raysAndCones; 46 // if (zf->getDimension() >= 0) // <=> zf is not empty 47 // { 48 // assert(zf->numberOfConesOfDimension(zf->getDimension()-zf->getLinealityDimension(),0,0)); 49 // gfan::ZCone zc = zf->getCone(zf->getDimension()-zf->getLinealityDimension(),0,0,0); 50 // gfan::ZMatrix genLinSpace = zc.generatorsOfLinealitySpace(); 51 // char* gens = toString(genLinSpace); 52 // s << std::endl << "GENERATORS_LINEALITY_SPACE:" << std::endl; 53 // s << gens; 54 // } 55 // std::string sstring = s.str(); 56 // return omStrDup(sstring.c_str()); 57 // >>>>>>> status updated 11.03. 42 58 } 43 59 } … … 858 874 859 875 860 BOOLEAN tropicalVariety(leftv res, leftv args)861 {862 leftv u=args;863 if ((u != NULL) && (u->Typ() == POLY_CMD))864 {865 int n = rVar(currRing);866 gfan::ZFan* zf = new gfan::ZFan(n);867 int* expv1 = (int*)omAlloc((n+1)*sizeof(int));868 int* expv2 = (int*)omAlloc((n+1)*sizeof(int));869 int* expvr = (int*)omAlloc((n+1)*sizeof(int));870 gfan::ZVector expw1 = gfan::ZVector(n);871 gfan::ZVector expw2 = gfan::ZVector(n);872 gfan::ZVector expwr = gfan::ZVector(n);873 gfan::ZMatrix eq, ineq;874 for (poly s1=(poly)u->Data(); s1!=NULL; pIter(s1))875 {876 pGetExpV(s1,expv1);877 expw1 = intStar2ZVector(n,expv1);878 for (poly s2=pNext(s1); s2!=NULL; pIter(s2))879 {880 pGetExpV(s2,expv2);881 expw2 = intStar2ZVector(n,expv2);882 eq = gfan::ZMatrix(0,n);883 eq.appendRow(expw1-expw2);884 ineq = gfan::ZMatrix(0,n);885 for (poly r=(poly)u->Data(); r!=NULL; pIter(r))886 {887 pGetExpV(r,expvr);888 expwr = intStar2ZVector(n,expvr);889 if ((r!=s1) && (r!=s2))890 {891 ineq.appendRow(expw1-expwr);892 }893 }894 gfan::ZCone zc = gfan::ZCone(ineq,eq);895 zf->insert(zc);896 }897 }898 omFreeSize(expv1,(n+1)*sizeof(int));899 omFreeSize(expv2,(n+1)*sizeof(int));900 omFreeSize(expvr,(n+1)*sizeof(int));901 res->rtyp = fanID;902 res->data = (void*) zf;903 return FALSE;904 }905 WerrorS("tropicalVariety: unexpected parameters");906 return TRUE;907 }876 // BOOLEAN tropicalVariety(leftv res, leftv args) 877 // { 878 // leftv u=args; 879 // if ((u != NULL) && (u->Typ() == POLY_CMD)) 880 // { 881 // int n = rVar(currRing); 882 // gfan::ZFan* zf = new gfan::ZFan(n); 883 // int* expv1 = (int*)omAlloc((n+1)*sizeof(int)); 884 // int* expv2 = (int*)omAlloc((n+1)*sizeof(int)); 885 // int* expvr = (int*)omAlloc((n+1)*sizeof(int)); 886 // gfan::ZVector expw1 = gfan::ZVector(n); 887 // gfan::ZVector expw2 = gfan::ZVector(n); 888 // gfan::ZVector expwr = gfan::ZVector(n); 889 // gfan::ZMatrix eq, ineq; 890 // for (poly s1=(poly)u->Data(); s1!=NULL; pIter(s1)) 891 // { 892 // pGetExpV(s1,expv1); 893 // expw1 = intStar2ZVector(n,expv1); 894 // for (poly s2=pNext(s1); s2!=NULL; pIter(s2)) 895 // { 896 // pGetExpV(s2,expv2); 897 // expw2 = intStar2ZVector(n,expv2); 898 // eq = gfan::ZMatrix(0,n); 899 // eq.appendRow(expw1-expw2); 900 // ineq = gfan::ZMatrix(0,n); 901 // for (poly r=(poly)u->Data(); r!=NULL; pIter(r)) 902 // { 903 // pGetExpV(r,expvr); 904 // expwr = intStar2ZVector(n,expvr); 905 // if ((r!=s1) && (r!=s2)) 906 // { 907 // ineq.appendRow(expw1-expwr); 908 // } 909 // } 910 // gfan::ZCone zc = gfan::ZCone(ineq,eq); 911 // zf->insert(zc); 912 // } 913 // } 914 // omFreeSize(expv1,(n+1)*sizeof(int)); 915 // omFreeSize(expv2,(n+1)*sizeof(int)); 916 // omFreeSize(expvr,(n+1)*sizeof(int)); 917 // res->rtyp = fanID; 918 // res->data = (void*) zf; 919 // return FALSE; 920 // } 921 // WerrorS("tropicalVariety: unexpected parameters"); 922 // return TRUE; 923 // } 908 924 909 925 gfan::ZFan commonRefinement(gfan::ZFan zf, gfan::ZFan zg) … … 1038 1054 p->iiAddCproc("","fVector",FALSE,fVector); 1039 1055 p->iiAddCproc("","containsInCollection",FALSE,containsInCollection); 1040 p->iiAddCproc("","tropicalVariety",FALSE,tropicalVariety);1056 // p->iiAddCproc("","tropicalVariety",FALSE,tropicalVariety); 1041 1057 p->iiAddCproc("","commonRefinement",FALSE,commonRefinement); 1042 1058 // iiAddCproc("","grFan",FALSE,grFan);
Note: See TracChangeset
for help on using the changeset viewer.