math/multichoose: Generate multiset combinations (n multichoose k)

Approved by:    jrm (mentor)
Differential Revision:  https://reviews.freebsd.org/D15104
This commit is contained in:
Jason W. Bacon 2018-04-16 18:31:42 +00:00
parent 1dfb1d6004
commit 29f4e93c87
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=467502
6 changed files with 85 additions and 0 deletions

View File

@ -342,6 +342,7 @@
SUBDIR += msieve
SUBDIR += mtl
SUBDIR += mtrxmath
SUBDIR += multichoose
SUBDIR += mumps
SUBDIR += mumps-edf
SUBDIR += mumps-mpich

22
math/multichoose/Makefile Normal file
View File

@ -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>

View File

@ -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

View File

@ -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}

View File

@ -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

View File

@ -0,0 +1,7 @@
bin/cmultichoose
bin/multichoose
bin/multichoose.py
bin/multipermute
bin/multipermute.py
include/multichoose/multichoose.h
include/multichoose/multipermute.h