[med-svn] [libvcflib] 01/02: Try whether there is a chance to avoid packaging https://github.com/ekg/multichoose
Andreas Tille
tille at debian.org
Thu Jun 23 08:44:32 UTC 2016
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository libvcflib.
commit 64ebeab61e2ecffb07a453c3728f22d1322bd301
Author: Andreas Tille <tille at debian.org>
Date: Thu Jun 23 10:42:21 2016 +0200
Try whether there is a chance to avoid packaging https://github.com/ekg/multichoose
---
debian/patches/multichoose.h.patch | 87 ++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 88 insertions(+)
diff --git a/debian/patches/multichoose.h.patch b/debian/patches/multichoose.h.patch
new file mode 100644
index 0000000..b4487f8
--- /dev/null
+++ b/debian/patches/multichoose.h.patch
@@ -0,0 +1,87 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Thu, 23 Jun 2016 09:10:54 +0200
+Origin: https://github.com/ekg/multichoose/blob/master/multichoose.h
+Description: Provide a needed header file
+
+--- /dev/null
++++ b/src/multichoose.h
+@@ -0,0 +1,79 @@
++#ifndef __MULTICHOOSE_H
++#define __MULTICHOOSE_H
++
++/*
++
++multichoose.h -- n multichoose k for generic vectors
++
++author: Erik Garrison <erik.garrison at bc.edu>
++last revised: 2010-04-16
++
++Copyright (c) 2010 by Erik Garrison
++
++Permission is hereby granted, free of charge, to any person
++obtaining a copy of this software and associated documentation
++files (the "Software"), to deal in the Software without
++restriction, including without limitation the rights to use,
++copy, modify, merge, publish, distribute, sublicense, and/or sell
++copies of the Software, and to permit persons to whom the
++Software is furnished to do so, subject to the following
++conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
++OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
++WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++OTHER DEALINGS IN THE SOFTWARE.
++
++*/
++
++
++// provides multiset combinations out of the std::vector of objects
++template <class T>
++std::vector< std::vector<T> > multichoose(int k, std::vector<T>& objects) {
++
++ std::vector< std::vector<T> > choices;
++
++ int j,j_1,q,r;
++
++ r = objects.size() - 1;
++
++ // combination indexes
++ std::vector<T*> a, b;
++
++ for (int i=0;i<k;i++) {
++ a.push_back(&objects[0]); b.push_back(&objects[r]);
++ }
++
++ j=k;
++ while(1){
++ std::vector<T> multiset;
++ for(int i=0;i<k;i++)
++ multiset.push_back(*a[i]);
++ choices.push_back(multiset);
++ j=k;
++ do { j--; } while(a[j]==b[j]);
++ if (j<0) break;
++ j_1=j;
++ while(j_1<=k-1){
++ a[j_1]=a[j_1]+1;
++ q=j_1;
++ while(q<k-1) {
++ a[q+1]=a[q];
++ q++;
++ }
++ q++;
++ j_1=q;
++ }
++ }
++
++ return choices;
++}
++
++#endif
diff --git a/debian/patches/series b/debian/patches/series
index 06233fc..db0e782 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
use_debian_packaged_tabixpp.patch
ignore_smith_watermann.patch
+multichoose.h.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/libvcflib.git
More information about the debian-med-commit
mailing list