Changeset 9fe6c3 in git
- Timestamp:
- Oct 24, 2018, 2:36:24 PM (5 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 99d02931f1b01b2ae7d88ca405c300918c8c6919
- Parents:
- e552b7ba49ec3df67c55e5cc36c00cc4783cbda0
- Files:
-
- 1 added
- 1 deleted
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/gitfan.lib
re552b7 r9fe6c3 84 84 LIB "gfanlib.so"; 85 85 LIB "gitfan.so"; 86 //LIB "subsets.so"; 86 87 newstruct("permutation","intvec image"); 87 88 system("install","permutation","*",composePermutations,2); -
Singular/dyn_modules/Makefile.am
re552b7 r9fe6c3 1 1 ACLOCAL_AMFLAGS = -I ../m4 2 2 3 SUBDIRS=staticdemo bigintm s yzextra pyobject customstd gfanlib python gitfan polymake singmathic Order interval cohomo3 SUBDIRS=staticdemo bigintm subsets syzextra pyobject customstd gfanlib python gitfan polymake singmathic Order interval cohomo -
Singular/dyn_modules/gitfan/gitfan.cc
re552b7 r9fe6c3 563 563 } 564 564 565 BOOLEAN subsets(leftv res, leftv args)566 {567 leftv u = args;568 if ((u!=NULL) && (u->Typ()==INT_CMD))569 {570 leftv v = u->next;571 if ((v!=NULL) && (v->Typ()==INT_CMD) && (v->next==NULL))572 {573 int n = (int)(long) u->Data();574 int k = (int)(long) v->Data();575 std::vector<int> array(n);576 for (int i=0; i<n; i++)577 array[i]=i+1;578 std::vector<int> ltemp;579 std::vector<std::vector<int> > lt;580 subset(array,n,k,0,ltemp,lt);581 582 lists Lt = (lists) omAllocBin(slists_bin);583 Lt->Init(lt.size());584 for (int i=0; i<lt.size(); i++)585 {586 std::vector<int> lti = lt[i];587 lists Lti = (lists) omAllocBin(slists_bin);588 Lti->Init(k);589 for(int j=0; j<lti.size(); j++)590 {591 Lti->m[j].rtyp = INT_CMD;592 Lti->m[j].data = (void*)(long)lti[j];593 }594 Lt->m[i].rtyp = LIST_CMD;595 Lt->m[i].data = (void*) Lti;596 }597 598 res->rtyp = LIST_CMD;599 res->data = (void*) Lt;600 return FALSE;601 }602 }603 WerrorS("subsets: unexpected parameter");604 return TRUE;605 }606 607 608 565 extern "C" int SI_MOD_INIT(gitfan) (SModulFunctions* p) 609 566 { … … 616 573 p->iiAddCproc("gitfan.lib","composeIntvecs",FALSE,composeIntvecs); 617 574 p->iiAddCproc("gitfan.lib","findPlaceToInsert",FALSE,findPlaceToInsert); 618 p->iiAddCproc("gitfan.lib","subsets",FALSE,subsets);619 575 return (MAX_TOK); 620 576 } -
Singular/dyn_modules/subsets/subsets.cc
re552b7 r9fe6c3 43 43 lists Lt = (lists) omAllocBin(slists_bin); 44 44 Lt->Init(lt.size()); 45 for ( inti=0; i<lt.size(); i++)45 for (unsigned i=0; i<lt.size(); i++) 46 46 { 47 47 std::vector<int> lti = lt[i]; 48 48 lists Lti = (lists) omAllocBin(slists_bin); 49 49 Lti->Init(k); 50 for( intj=0; j<lti.size(); j++)50 for(unsigned j=0; j<lti.size(); j++) 51 51 { 52 52 Lti->m[j].rtyp = INT_CMD; … … 68 68 //------------------------------------------------------------------------ 69 69 // initialisation of the module 70 extern "C" int SI_MOD_INIT( customstd)(SModulFunctions* p)70 extern "C" int SI_MOD_INIT(subsets)(SModulFunctions* p) 71 71 { 72 72 p->iiAddCproc("subsets.so","subsets",FALSE,subsets); -
configure.ac
re552b7 r9fe6c3 249 249 AC_CONFIG_FILES([Singular/dyn_modules/singmathic/Makefile]) 250 250 AC_CONFIG_FILES([Singular/dyn_modules/staticdemo/Makefile]) 251 AC_CONFIG_FILES([Singular/dyn_modules/subsets/Makefile]) 251 252 AC_CONFIG_FILES([Singular/dyn_modules/gitfan/Makefile]) 252 253 AC_CONFIG_FILES([Singular/dyn_modules/interval/Makefile]) -
m4/options.m4
re552b7 r9fe6c3 324 324 L="" 325 325 bi_staticdemo=false 326 bi_subsets=false 326 327 bi_syzextra=false 327 328 bi_pyobject=false … … 358 359 case "${a}" in 359 360 staticdemo ) bi_staticdemo=true;; 361 subsets ) bi_subsets=true;; 360 362 syzextra ) bi_syzextra=true ;; 361 363 pyobject ) bi_pyobject=true ;; … … 395 397 396 398 AM_CONDITIONAL([SI_BUILTIN_STATICDEMO], [test x$bi_staticdemo = xtrue]) 399 AM_CONDITIONAL([SI_BUILTIN_SUBSETS], [test x$bi_subsets = xtrue]) 397 400 AM_CONDITIONAL([SI_BUILTIN_SYZEXTRA], [test x$bi_syzextra = xtrue]) 398 401 AM_CONDITIONAL([SI_BUILTIN_PYOBJECT], [test x$bi_pyobject = xtrue])
Note: See TracChangeset
for help on using the changeset viewer.