Changeset 32d8cb in git for dyn_modules/callgfanlib/bbfan.cc
- Timestamp:
- Oct 25, 2013, 8:34:39 PM (10 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- 9cf75aab8ce4766fcf49c2135012db6957300a95
- Parents:
- 6a6ae29f7bcf2272aa28c90bb17f8e9a0337de6e62de8de7d677c1aa9a6da3c0e58b04a58a9a884b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dyn_modules/callgfanlib/bbfan.cc
r6a6ae2 r32d8cb 25 25 int fanID; 26 26 27 void* bbfan_Init(blackbox *b)27 void* bbfan_Init(blackbox* /*b*/) 28 28 { 29 29 return (void*) new gfan::ZFan(0); 30 30 } 31 31 32 void bbfan_destroy(blackbox *b, void *d)32 void bbfan_destroy(blackbox* /*b*/, void *d) 33 33 { 34 34 if (d!=NULL) … … 39 39 } 40 40 41 char* bbfan_String(blackbox *b, void *d)41 char* bbfan_String(blackbox* /*b*/, void *d) 42 42 { 43 43 if (d==NULL) return omStrDup("invalid object"); … … 50 50 } 51 51 52 void* bbfan_Copy(blackbox* b, void *d)52 void* bbfan_Copy(blackbox* /*b*/, void *d) 53 53 { 54 54 gfan::ZFan* zf = (gfan::ZFan*)d; … … 502 502 leftv w=v->next; int n = 1; 503 503 if ((w != NULL) && (w->Typ() == INT_CMD)) 504 intn = (int)(long) w;504 n = (int)(long) w; 505 505 506 506 if (n != 0) … … 864 864 } 865 865 866 lists listOfFacets(const gfan::ZCone &zc)867 {868 gfan::ZMatrix inequalities = zc.getFacets();869 gfan::ZMatrix equations = zc.getImpliedEquations();870 lists L = (lists)omAllocBin(slists_bin);871 int r = inequalities.getHeight();872 int c = inequalities.getWidth();873 L->Init(r);874 875 /* next we iterate over each of the r facets, build the respective cone and add it to the list */876 /* this is the i=0 case */877 gfan::ZMatrix newInequalities = inequalities.submatrix(1,0,r,c);878 gfan::ZMatrix newEquations = equations;879 newEquations.appendRow(inequalities[0]);880 L->m[0].rtyp = coneID; L->m[0].data=(void*) new gfan::ZCone(newInequalities,newEquations);881 882 /* these are the cases i=1,...,r-2 */883 for (int i=1; i<r-1; i++)884 {885 newInequalities = inequalities.submatrix(0,0,i-1,c);886 newInequalities.append(inequalities.submatrix(i+1,0,r,c));887 newEquations = equations;888 newEquations.appendRow(inequalities[i]);889 L->m[i].rtyp = coneID; L->m[i].data=(void*) new gfan::ZCone(newInequalities,newEquations);890 }891 892 /* this is the i=r-1 case */893 newInequalities = inequalities.submatrix(0,0,r-1,c);894 newEquations = equations;895 newEquations.appendRow(inequalities[r]);896 L->m[r-1].rtyp = coneID; L->m[r-1].data=(void*) new gfan::ZCone(newInequalities,newEquations);897 898 return L;899 }900 901 BOOLEAN listOfFacets(leftv res, leftv args)902 {903 leftv u=args;904 if ((u != NULL) && (u->Typ() == coneID))905 {906 gfan::ZCone* zc = (gfan::ZCone*) u->Data();907 lists L = listOfFacets(*zc);908 res->rtyp = LIST_CMD;909 res->data = (void*) L;910 return FALSE;911 }912 WerrorS("listOfFacets: unexpected parameters");913 return TRUE;914 }915 866 916 867 BOOLEAN tropicalVariety(leftv res, leftv args)
Note: See TracChangeset
for help on using the changeset viewer.