aboutsummaryrefslogtreecommitdiff
path: root/math/multichoose
diff options
context:
space:
mode:
authorJason W. Bacon <jwb@FreeBSD.org>2018-04-16 18:31:42 +0000
committerJason W. Bacon <jwb@FreeBSD.org>2018-04-16 18:31:42 +0000
commit29f4e93c879e68a184b9ca88142a504095a68de5 (patch)
tree6609e31582dd5ec0b5b5a088591d9bfa86e6522d /math/multichoose
parent1dfb1d60047d01f32318525b7c34439d313f5f1e (diff)
downloadports-29f4e93c879e68a184b9ca88142a504095a68de5.tar.gz
ports-29f4e93c879e68a184b9ca88142a504095a68de5.zip
math/multichoose: Generate multiset combinations (n multichoose k)
Approved by: jrm (mentor) Differential Revision: https://reviews.freebsd.org/D15104
Notes
Notes: svn path=/head/; revision=467502
Diffstat (limited to 'math/multichoose')
-rw-r--r--math/multichoose/Makefile22
-rw-r--r--math/multichoose/distinfo3
-rw-r--r--math/multichoose/files/Makefile46
-rw-r--r--math/multichoose/pkg-descr6
-rw-r--r--math/multichoose/pkg-plist7
5 files changed, 84 insertions, 0 deletions
diff --git a/math/multichoose/Makefile b/math/multichoose/Makefile
new file mode 100644
index 000000000000..fc6d38072b3c
--- /dev/null
+++ b/math/multichoose/Makefile
@@ -0,0 +1,22 @@
+# $FreeBSD$
+
+PORTNAME= multichoose
+DISTVERSIONPREFIX= v
+DISTVERSION= 1.0.3-2
+DISTVERSIONSUFFIX= -g3b8d14e
+CATEGORIES= math
+
+MAINTAINER= jwb@FreeBSD.org
+COMMENT= Generate multiset combinations (n multichoose k)
+
+LICENSE= MIT
+
+USES= python shebangfix
+SHEBANG_FILES= *.py
+USE_GITHUB= yes
+GH_ACCOUNT= ekg
+
+MAKEFILE= ${FILESDIR}/Makefile
+INSTALL_TARGET= install-strip
+
+.include <bsd.port.mk>
diff --git a/math/multichoose/distinfo b/math/multichoose/distinfo
new file mode 100644
index 000000000000..8e92f72502d0
--- /dev/null
+++ b/math/multichoose/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1523601462
+SHA256 (ekg-multichoose-v1.0.3-2-g3b8d14e_GH0.tar.gz) = 31eaeb816842094468c8204f9eb96bc825f2e60bc8528d593002ebb66532548e
+SIZE (ekg-multichoose-v1.0.3-2-g3b8d14e_GH0.tar.gz) = 6555
diff --git a/math/multichoose/files/Makefile b/math/multichoose/files/Makefile
new file mode 100644
index 000000000000..4a34304a228a
--- /dev/null
+++ b/math/multichoose/files/Makefile
@@ -0,0 +1,46 @@
+
+# Use ?= to allow overriding from the env or command-line, e.g.
+#
+# make CXXFLAGS="-O3 -fPIC" install
+#
+# Package managers will override many of these variables automatically, so
+# this is aimed at making it easy to create packages (Debian packages,
+# FreeBSD ports, MacPorts, pkgsrc, etc.)
+
+CC ?= cc
+CXX ?= c++
+DESTDIR ?= stage
+PREFIX ?= /usr/local
+MKDIR ?= mkdir
+INSTALL ?= install -c
+STRIP ?= strip
+AR ?= ar
+
+BINS = multichoose cmultichoose multipermute
+
+all: ${BINS}
+
+#multichoose_recursive: multichoose_recursive.cpp
+# ${CXX} multichoose_recursive.cpp -o multichoose_recursive
+
+multichoose: multichoose.cpp multichoose.h
+ ${CXX} multichoose.cpp -o multichoose
+
+multipermute: multipermute.cpp multipermute.h
+ ${CXX} multipermute.cpp -o multipermute
+
+cmultichoose: multichoose.c
+ ${CC} multichoose.c -o cmultichoose
+
+install: all
+ ${MKDIR} -p ${DESTDIR}${PREFIX}/bin
+ ${MKDIR} -p ${DESTDIR}${PREFIX}/include/multichoose
+ ${INSTALL} ${BINS} ${DESTDIR}${PREFIX}/bin
+ ${INSTALL} *.py ${DESTDIR}${PREFIX}/bin
+ ${INSTALL} *.h ${DESTDIR}${PREFIX}/include/multichoose
+
+install-strip: install
+ ${STRIP} ${DESTDIR}${PREFIX}/bin/*e
+
+clean:
+ rm -rf ${BINS} ${DESTDIR}
diff --git a/math/multichoose/pkg-descr b/math/multichoose/pkg-descr
new file mode 100644
index 000000000000..65b06567fcba
--- /dev/null
+++ b/math/multichoose/pkg-descr
@@ -0,0 +1,6 @@
+Efficient loopless multiset combination generation algorithm which is
+(approximately) described in "Loopless algorithms for generating permutations,
+combinations, and other combinatorial configurations." G Ehrlich - Journal of
+the ACM (JACM), 1973. (Algorithm 7.)
+
+WWW: https://github.com/ekg/multichoose
diff --git a/math/multichoose/pkg-plist b/math/multichoose/pkg-plist
new file mode 100644
index 000000000000..bd8f05a7014a
--- /dev/null
+++ b/math/multichoose/pkg-plist
@@ -0,0 +1,7 @@
+bin/cmultichoose
+bin/multichoose
+bin/multichoose.py
+bin/multipermute
+bin/multipermute.py
+include/multichoose/multichoose.h
+include/multichoose/multipermute.h