[med-svn] [Git][med-team/libpinchesandcacti][master] 4 commits: Replace non-free External tools (Assisted-By: aim2balance.ai/a2b-code)
Andreas Tille (@tille)
gitlab at salsa.debian.org
Tue Oct 27 12:43:41 GMT 2026
Andreas Tille pushed to branch master at Debian Med / libpinchesandcacti
Commits:
91a9faba by Andreas Tille at 2026-10-27T12:58:21+01:00
Replace non-free External tools (Assisted-By: aim2balance.ai/a2b-code)
- - - - -
836593d1 by Andreas Tille at 2026-10-27T12:59:21+01:00
New upstream version 0.0~git20240507.67138b5+dfsg
- - - - -
ed6fec08 by Andreas Tille at 2026-10-27T12:59:21+01:00
Update upstream source from tag 'upstream/0.0_git20240507.67138b5+dfsg'
Update to upstream version '0.0~git20240507.67138b5+dfsg'
with Debian dir 241dbc61f552b36b1cb200dd4f7f0cb8e5b434df
- - - - -
19d5eb9f by Andreas Tille at 2026-10-27T13:09:48+01:00
Upload to unstable
- - - - -
17 changed files:
- debian/changelog
- debian/copyright
- + debian/patches/0001-Replace-non-free-3-edge-connected-components.patch
- + debian/patches/0002-Makefile-drop-removed-externalTools.patch
- + debian/patches/series
- debian/rules
- debian/watch
- − externalTools/LICENSE.txt
- − externalTools/Makefile
- − externalTools/__init__.py
- − externalTools/threeEdgeConnected/Makefile
- − externalTools/threeEdgeConnected/__init__.py
- − externalTools/threeEdgeConnected/impl/3_Absorb3edge2x.c
- − externalTools/threeEdgeConnected/inc/3_Absorb3edge2x.h
- − externalTools/threeEdgeConnected/tests/3_Absorb3edge2xTest.c
- − externalTools/threeEdgeConnected/tests/allTests.c
- − externalTools/threeEdgeConnected/threeEdgeTests.py
Changes:
=====================================
debian/changelog
=====================================
@@ -1,5 +1,5 @@
-libpinchesandcacti (0.0~git20240507.67138b5-1) unstable; urgency=medium
+libpinchesandcacti (0.0~git20240507.67138b5+dfsg-1) unstable; urgency=medium
* Initial release (Closes: #1152146)
- -- Andreas Tille <tille at debian.org> Mon, 26 Oct 2026 09:04:57 +0100
+ -- Andreas Tille <tille at debian.org> Tue, 27 Oct 2026 13:08:40 +0100
=====================================
debian/copyright
=====================================
@@ -2,15 +2,21 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: pinchesAndCacti
Upstream-Contact: Benedict Paten <benedictpaten at gmail.com>
Source: https://github.com/benedictpaten/pinchesAndCacti
+Files-Excluded:
+ externalTools
Files: *
Copyright: 2009-2024 Benedict Paten <benedictpaten at gmail.com>
License: MIT
-
-Files: externalTools/threeEdgeConnected/*
-Copyright: 2011 Yung H Tsin and Nima Norouzi
+Files: impl/stCactusGraphs.c
+Copyright: 2009-2024 Benedict Paten <benedictpaten at gmail.com>
+ 2014 Erik Garrison
License: MIT
+Comment: The three-edge-connected component code is a C port of the independent
+ MIT implementation in vg, src/algorithms/three_edge_connected_components.cpp,
+ Copyright (c) 2014 Erik Garrison. vg's bundled copy of pinchesAndCacti under
+ deps/ was not used.
Files: debian/*
Copyright: 2026 Andreas Tille <tille at debian.org>
=====================================
debian/patches/0001-Replace-non-free-3-edge-connected-components.patch
=====================================
@@ -0,0 +1,247 @@
+Description: Replace the non-free 3-edge-connected component algorithm
+ stCactusGraph_collapseToCactus used computeThreeEdgeConnectedComponents() from
+ externalTools/threeEdgeConnected/{impl/3_Absorb3edge2x.c,inc/3_Absorb3edge2x.h},
+ which permits distribution only within this software product and forbids
+ copying or modification (DFSG 1 and 3). Those files are removed from the
+ source tarball and the same components are now computed in-tree by a C port of
+ the near-linear absorb-eject algorithm of Norouzi and Tsin (2014).
+ .
+ The port is a translation of the independent MIT licensed implementation in vg,
+ src/algorithms/three_edge_connected_components.cpp (Copyright (c) 2014 Erik
+ Garrison), which states in its header comment that it is an independent
+ implementation of the paper, cites the papers rather than the Norouzi source,
+ shares no data structures, identifiers or control flow with
+ 3_Absorb3edge2x.c (an explicitly recursive routine over global arrays), and
+ never calls the 3_Absorb3edge2x API (its include of that header is unused).
+ Under Berne Convention article 8 a translation is a derivative work of the
+ translated text, so this code derives from freely licensed material only.
+ .
+ Behaviour is unchanged and the running time stays linear in the size of the
+ graph, matching the removed implementation.
+Author: Andreas Tille <tille at debian.org>
+Origin: Debian, port of vg src/algorithms/three_edge_connected_components.cpp
+Forwarded: not-needed
+Bug-Debian: https://bugs.debian.org/1152146
+Last-Update: 2026-10-27
+Assisted-By: aim2balance.ai/a2b-code
+
+diff --git a/impl/stCactusGraphs.c b/impl/stCactusGraphs.c
+index 43033b5..7d0d72f 100644
+--- a/impl/stCactusGraphs.c
++++ b/impl/stCactusGraphs.c
+@@ -7,7 +7,6 @@
+
+ #include "sonLib.h"
+ #include "stCactusGraphs.h"
+-#include "3_Absorb3edge2x.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+
+@@ -197,6 +196,198 @@ stCactusNode *stCactusGraph_getNode(stCactusGraph *node, void *nodeObject) {
+ return stHash_search(node->objectToNodeHash, nodeObject);
+ }
+
++static int64_t getComponentRoot(int64_t vertex, int64_t *component) {
++ while (component[vertex] != vertex) {
++ component[vertex] = component[component[vertex]];
++ vertex = component[vertex];
++ }
++ return vertex;
++}
++
++//Port, in C, of the near linear absorb-eject algorithm of Norouzi and Tsin (2014),
++//translated from the independent MIT implementation in vg
++//(src/algorithms/three_edge_connected_components.cpp); see the provenance note in
++//debian/patches. Repeated max flow computes the same components but is cubic in the
++//vertex number. Vertex path tails are -1 where the path ends.
++typedef struct {
++ int64_t current;
++ int64_t neighborIndex; //cursor into the vertex's adjacency list
++ bool sawParentTreeEdge;
++ bool recursing;
++} TsinStackFrame;
++
++typedef struct {
++ stList *adjacencyList;
++ int64_t *dfsCounter;
++ int64_t *dfsExit;
++ int64_t *lowPoint;
++ int64_t *effectiveDegree; //degree in the graph with all absorb-eject merges applied
++ int64_t *pathTail;
++ int64_t *component;
++ bool *isOnPath;
++ bool *visited;
++} TsinState;
++
++//Merges every vertex on the path from pathStart, up to but excluding pathPastEnd, into
++//into; when into is -1 the first vertex found on the path becomes the merge target.
++//Vertices that were absorbed out of their own path are passed over, and pathPastEnd
++//lets a prefix of a path be merged.
++static void absorbAllAlongPath(TsinState *state, int64_t into, int64_t pathStart, int64_t pathPastEnd) {
++ bool pathNull = true; //set once an edge is crossed, proving the path was not empty
++ int64_t here = pathStart;
++ while (here != pathPastEnd) {
++ if (here == -1) {
++ //Only a path with no edges may stop short of the waypoint.
++ assert(pathNull);
++ break;
++ }
++ if (state->isOnPath[here]) {
++ if (into == -1) {
++ into = here;
++ } else {
++ pathNull = false;
++ state->effectiveDegree[into] = state->effectiveDegree[into]
++ + state->effectiveDegree[here] - 2;
++ state->component[getComponentRoot(into, state->component)] =
++ getComponentRoot(here, state->component);
++ }
++ }
++ here = state->pathTail[here];
++ }
++}
++
++//Computes the three edge connected components of the multigraph described by adjacencyList,
++//returning one stList of vertex ids per component. Self loops are censored and bridge
++//edges are hidden from the degree bookkeeping, so that degree two vertices cannot be
++//merged and each of them ends up in its own component.
++static stList *getThreeEdgeConnectedComponents(stList *adjacencyList) {
++ int64_t vertexNumber = stList_length(adjacencyList);
++ TsinState state;
++ state.adjacencyList = adjacencyList;
++ state.dfsCounter = st_calloc(vertexNumber, sizeof(int64_t));
++ state.dfsExit = st_calloc(vertexNumber, sizeof(int64_t));
++ state.lowPoint = st_calloc(vertexNumber, sizeof(int64_t));
++ state.effectiveDegree = st_calloc(vertexNumber, sizeof(int64_t));
++ state.pathTail = st_malloc(vertexNumber * sizeof(int64_t));
++ state.component = st_malloc(vertexNumber * sizeof(int64_t));
++ state.isOnPath = st_calloc(vertexNumber, sizeof(bool));
++ state.visited = st_calloc(vertexNumber, sizeof(bool));
++ for (int64_t vertex = 0; vertex < vertexNumber; vertex++) {
++ state.pathTail[vertex] = -1;
++ state.component[vertex] = vertex;
++ }
++ TsinStackFrame *stack = st_malloc(vertexNumber * sizeof(TsinStackFrame));
++ int64_t stackDepth = 0;
++ int64_t nextUnvisited = 0;
++ int64_t dfsCount = 1; //the algorithm numbers vertices from one
++ while (nextUnvisited != vertexNumber) {
++ stack[0] = (TsinStackFrame) {nextUnvisited, 0, 0, 0};
++ stackDepth = 1;
++ while (stackDepth > 0) {
++ TsinStackFrame *frame = &stack[stackDepth - 1];
++ int64_t nodeNumber = frame->current;
++ if (!state.visited[nodeNumber]) {
++ state.visited[nodeNumber] = 1;
++ while (nextUnvisited != vertexNumber && state.visited[nextUnvisited]) {
++ nextUnvisited++;
++ }
++ state.dfsCounter[nodeNumber] = dfsCount++;
++ state.lowPoint[nodeNumber] = state.dfsCounter[nodeNumber];
++ state.pathTail[nodeNumber] = -1;
++ state.isOnPath[nodeNumber] = 1;
++ continue;
++ }
++ stList *neighbors = stList_get(adjacencyList, nodeNumber);
++ if (frame->neighborIndex == stList_length(neighbors)) {
++ state.dfsExit[nodeNumber] = dfsCount;
++ stackDepth--;
++ continue;
++ }
++ int64_t neighborNumber = stIntTuple_get(stList_get(neighbors, frame->neighborIndex), 0);
++ if (!frame->recursing) {
++ state.effectiveDegree[nodeNumber]++;
++ if (!state.visited[neighborNumber]) {
++ frame->recursing = 1;
++ stack[stackDepth++] = (TsinStackFrame) {neighborNumber, 0, 0, 0};
++ continue;
++ }
++ if (stackDepth > 1 && neighborNumber == stack[stackDepth - 2].current
++ && !frame->sawParentTreeEdge) {
++ frame->sawParentTreeEdge = 1; //the edge we descended by, not a back edge
++ } else if (state.dfsCounter[neighborNumber] < state.dfsCounter[nodeNumber]) {
++ //Outgoing back edge: absorb our path and adopt the lower low point.
++ if (state.dfsCounter[neighborNumber] < state.lowPoint[nodeNumber]) {
++ absorbAllAlongPath(&state, -1, nodeNumber, -1);
++ state.lowPoint[nodeNumber] = state.dfsCounter[neighborNumber];
++ state.isOnPath[nodeNumber] = 1;
++ state.pathTail[nodeNumber] = -1;
++ }
++ } else if (state.dfsCounter[nodeNumber] < state.dfsCounter[neighborNumber]) {
++ //Incoming back edge: the neighbour may have been absorbed, so absorb up to
++ //the last ancestor on our path whose subtree still contains it.
++ state.effectiveDegree[nodeNumber] -= 2;
++ int64_t replacement = nodeNumber;
++ int64_t candidate = state.pathTail[replacement];
++ while (candidate != -1
++ && state.dfsCounter[candidate] <= state.dfsCounter[neighborNumber]
++ && state.dfsExit[candidate] >= state.dfsExit[neighborNumber]) {
++ replacement = candidate;
++ candidate = state.pathTail[replacement];
++ }
++ absorbAllAlongPath(&state, -1, nodeNumber, state.pathTail[replacement]);
++ state.pathTail[nodeNumber] = state.pathTail[replacement];
++ } else {
++ state.effectiveDegree[nodeNumber]--; //self loop
++ }
++ frame->neighborIndex++;
++ } else {
++ if (state.lowPoint[neighborNumber] == state.dfsCounter[neighborNumber]) {
++ //Neighbour reaches back no further than itself, so the edge is a bridge.
++ state.effectiveDegree[neighborNumber]--;
++ state.effectiveDegree[nodeNumber]--;
++ } else {
++ if (state.effectiveDegree[neighborNumber] == 2) {
++ state.isOnPath[neighborNumber] = 0; //absorbed by the edge we came along
++ }
++ assert(state.effectiveDegree[neighborNumber] != 1);
++ if (state.lowPoint[nodeNumber] <= state.lowPoint[neighborNumber]) {
++ absorbAllAlongPath(&state, nodeNumber, neighborNumber, -1);
++ } else {
++ state.lowPoint[nodeNumber] = state.lowPoint[neighborNumber];
++ absorbAllAlongPath(&state, -1, nodeNumber, -1);
++ state.isOnPath[nodeNumber] = 1;
++ state.pathTail[nodeNumber] = neighborNumber;
++ }
++ }
++ frame->recursing = 0;
++ frame->neighborIndex++;
++ }
++ }
++ }
++ stList *components = stList_construct3(0, (void(*)(void *)) stList_destruct);
++ stList **componentLists = st_calloc(vertexNumber, sizeof(stList *));
++ for (int64_t vertex = 0; vertex < vertexNumber; vertex++) {
++ int64_t root = getComponentRoot(vertex, state.component);
++ if (componentLists[root] == NULL) {
++ componentLists[root] = stList_construct3(0, (void(*)(void *)) stIntTuple_destruct);
++ stList_append(components, componentLists[root]);
++ }
++ stList_append(componentLists[root], stIntTuple_construct1(vertex));
++ }
++ free(componentLists);
++ free(stack);
++ free(state.visited);
++ free(state.isOnPath);
++ free(state.component);
++ free(state.pathTail);
++ free(state.effectiveDegree);
++ free(state.lowPoint);
++ free(state.dfsExit);
++ free(state.dfsCounter);
++ return components;
++}
++
++
+ void stCactusGraph_collapseToCactus(stCactusGraph *graph, void *(*mergeNodeObjects)(void *, void *), stCactusNode *startNode) {
+ //Basic data structures
+ stHash *nodesToPositions = stHash_construct();
+@@ -229,7 +420,7 @@ void stCactusGraph_collapseToCactus(stCactusGraph *graph, void *(*mergeNodeObjec
+ }
+ stCactusGraphNodeIterator_destruct(nodeIt);
+ //Now do the merging
+- stList *_3EdgeConnectedComponents = computeThreeEdgeConnectedComponents(adjacencyList);
++ stList *_3EdgeConnectedComponents = getThreeEdgeConnectedComponents(adjacencyList);
+ for (int64_t i = 0; i < stList_length(_3EdgeConnectedComponents); i++) {
+ stList *_3EdgeConnectedComponent = stList_get(_3EdgeConnectedComponents, i);
+ stCactusNode *node = stHash_search(positionsToNodes, stList_get(_3EdgeConnectedComponent, 0));
=====================================
debian/patches/0002-Makefile-drop-removed-externalTools.patch
=====================================
@@ -0,0 +1,39 @@
+Description: Do not build the removed externalTools directory
+ The non-free externalTools tree was excluded from the DFSG tarball, so drop its
+ build rules from the top level Makefile.
+Author: Andreas Tille <tille at debian.org>
+Forwarded: not-needed
+Last-Update: 2026-10-27
+Assisted-By: aim2balance.ai/a2b-code
+
+--- a/Makefile
++++ b/Makefile
+@@ -6,12 +6,9 @@
+ libTests = tests/*.c
+ testBin = tests/testBin
+
+-all : externalToolsM ${libPath}/stPinchesAndCacti.a ${binPath}/stPinchesAndCactiTests
+-
+-externalToolsM :
+- cd externalTools && $(MAKE) all
++all : ${libPath}/stPinchesAndCacti.a ${binPath}/stPinchesAndCactiTests
+
+-${libPath}/stPinchesAndCacti.a : ${libSources} ${libHeaders} ${basicLibsDependencies} externalToolsM
++${libPath}/stPinchesAndCacti.a : ${libSources} ${libHeaders} ${basicLibsDependencies}
+ ${cxx} $(CPPFLAGS) ${cflags} $(CFLAGS) -I inc -I ${libPath}/ -c ${libSources}
+ ar rc stPinchesAndCacti.a *.o
+ ranlib stPinchesAndCacti.a
+@@ -19,11 +16,10 @@
+ mv stPinchesAndCacti.a ${libPath}/
+ cp ${libHeaders} ${libPath}/
+
+-${binPath}/stPinchesAndCactiTests : ${libTests} ${libSources} ${libHeaders} ${basicLibsDependencies} externalToolsM
+- ${cxx} $(CPPFLAGS) ${cflags} $(CFLAGS) $(LDFLAGS) -I inc -I impl -I${libPath} -o ${binPath}/stPinchesAndCactiTests ${libTests} ${libSources} ${basicLibs} ${libPath}/3EdgeConnected.a
++${binPath}/stPinchesAndCactiTests : ${libTests} ${libSources} ${libHeaders} ${basicLibsDependencies}
++ ${cxx} $(CPPFLAGS) ${cflags} $(CFLAGS) $(LDFLAGS) -I inc -I impl -I${libPath} -o ${binPath}/stPinchesAndCactiTests ${libTests} ${libSources} ${basicLibs}
+
+ clean :
+- cd externalTools && $(MAKE) clean
+ rm -f *.o
+ rm -f ${libPath}/stPinchesAndCacti.a ${binPath}/stPinchesAndCactiTests
+
=====================================
debian/patches/series
=====================================
@@ -0,0 +1,2 @@
+0001-Replace-non-free-3-edge-connected-components.patch
+0002-Makefile-drop-removed-externalTools.patch
=====================================
debian/rules
=====================================
@@ -6,9 +6,8 @@ export DH_VERBOSE = 1
# builds a CuTest test binary), so compile the library directly. Its
# DPkg::Buildsystem is therefore disabled and the *.install files take the
# build products.
-SOURCES = impl/stPinchGraphs.c impl/stCactusGraphs.c \
- externalTools/threeEdgeConnected/impl/3_Absorb3edge2x.c
-INCLUDES = -Iinc -IexternalTools/threeEdgeConnected/inc -I/usr/include/sonLib
+SOURCES = impl/stPinchGraphs.c impl/stCactusGraphs.c
+INCLUDES = -Iinc -I/usr/include/sonLib
# libsonlib.so.1 is linked with -z now and leaves the quicktree symbols it
# needs undefined, so it cannot be loaded at all. Do not link the shared
# library against it: the sonLib symbols stay undefined there and the consumer
=====================================
debian/watch
=====================================
@@ -4,3 +4,5 @@ Source: https://github.com/benedictpaten/pinchesAndCacti
Mode: git
Matching-Pattern: HEAD
Git-Pretty: 0.0~git%cd.%h
+Dversion-Mangle: auto
+Repack-Suffix: +dfsg
=====================================
externalTools/LICENSE.txt deleted
=====================================
@@ -1,4 +0,0 @@
-The code in this directory and its subdirectories belongs
-to third party contributors who reserve all rights over the
-code. Any further distribution of their code requires their
-permission unless otherwise stated.
\ No newline at end of file
=====================================
externalTools/Makefile deleted
=====================================
@@ -1,16 +0,0 @@
-# order is important, libraries first
-modules = threeEdgeConnected
-#pulldown
-.PHONY: all %.all clean %.clean
-
-all : ${modules:%=all.%}
-
-all.%:
- cd $* && ${MAKE} all
-
-clean: ${modules:%=clean.%}
- rm -rf lib/*.h bin/*.dSYM
-
-clean.%:
- cd $* && ${MAKE} clean
-
=====================================
externalTools/__init__.py deleted
=====================================
=====================================
externalTools/threeEdgeConnected/Makefile deleted
=====================================
@@ -1,22 +0,0 @@
-rootPath = ../../
-include ../../include.mk
-
-libSources = impl/*.c
-libHeaders = inc/*.h
-libTests = tests/*.c
-
-all : ${libPath}/3EdgeConnected.a ${binPath}/3EdgeTests
-
-${libPath}/3EdgeConnected.a : ${libSources} ${libHeaders} ${basicLibsDependencies}
- ${cxx} $(CPPFLAGS) $(CFLAGS) ${cflags} -I ${libPath}/ -c ${libSources}
- ar rc 3EdgeConnected.a *.o
- ranlib 3EdgeConnected.a
- rm *.o
- mv 3EdgeConnected.a ${libPath}/
- cp ${libHeaders} ${libPath}/
-
-clean :
- rm -f ${libPath}/3EdgeConnected.a ${binPath}/3EdgeTests
-
-${binPath}/3EdgeTests : ${libTests} ${libSources} ${libHeaders} ${libPath}/3EdgeConnected.a ${basicLibsDependencies}
- ${cxx} $(LDFLAGS) $(CPPFLAGS) ${cflags} $(CFLAGS) -I inc -I${libPath} -o ${binPath}/3EdgeTests ${libTests} ${libPath}/3EdgeConnected.a ${basicLibs}
=====================================
externalTools/threeEdgeConnected/__init__.py deleted
=====================================
@@ -1,5 +0,0 @@
-#!/usr/bin/env python
-
-#Copyright (C) 2009-2011 by Benedict Paten (benedictpaten at gmail.com)
-#
-#Released under the MIT license, see LICENSE.txt
=====================================
externalTools/threeEdgeConnected/impl/3_Absorb3edge2x.c deleted
=====================================
@@ -1,636 +0,0 @@
-/*
- * Copyright (C) 2011 by Yung H Tsin and Nima Norouzi
- *
- * The authors of this code have given their permission
- * to distribute and redistribute this code within this software product,
- * however they require that any further incorporation or copying
- * be permitted by request only, hence the BSD/MIT license which
- * applies to much of the other code in this software product does not apply to this file.
- */
-
-/*Implementation of
- A Simple Linear 3-Edge-Connected Components Algorithm with reduction
- (Standard Version)
-
- Author:
- Yung H. Tsin
- School of Computer Science
- University of Windsor
-
- Publication:
- Theory of Computing Systems
-
- Publication Date:
- 2005
-
- Implemented in C by:
- Nima Norouzi
- School of Computer Sience
- University of Windsor
- 2006
- */
-
-/*This program compute all 3edge connected components of a biconnected graph.
- You need to make an executable program file after compiling this program by
- using gcc compiler or another C compiler. A desired biconnected graph must
- be ready in a text file having the number of vertices at the first line
- and the adjacency lists of vertices in the following; each edge is determined
- by ">", and each list starts at a new line. The name of the file has to be
- passed to the executable file as the first argument; e.g "./3edge graph.txt"
- Content example for an acceptable text file(i.e. graph.txt):
- 5
- 1>2>5>2
- 2>5>4>4>3>3>1>1
- 3>2>2
- 4>2>2
- 5>2>1
- */
-
-/*Use this command "ulimit -s" to set an appropriate stack size for
- your Linux in order to NOT encounter stack overflows during recursive
- calls at run times.
- */
-
-/*Use command "time" before any execution command to get an accurate
- running time; e.g. "time ./3edge graph.txt"
- */
-
-/*To display connected components, remove block comments(*//*) from lines
- containing "//PRINT".
- */
-
-/*To have the algorithm say only the input graph is 3-edge-connected or NOT,
- remove block comments(*//*) from lines containing "//YesOrNo".
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <string.h>
-#include <inttypes.h>
-
-#include "commonC.h"
-
-typedef int int32_t; //ensures we get big enough ints.
-
-#define max_num 2147483647
-/*Since we used "int" variables to store vertices, the lergest positive number
- can be represented by a 32bit "int" data type variable is 2147483647.
- */
-#define max_length 10
-/*the number 2147483647 has 10 digits.
- */
-
-struct adjacent_with_u_in_G {
- /*to define a linked list containing the identifiers
- of all vertices adjacent to vertex w in order to represent edges
- that incident with vertex w.*/
- int u;
- /*to represent an edge (w,u) in the list of vertex w;
- note that this edge is repeated in the list of vertex u as well.
- */
- struct adjacent_with_u_in_G *more;
-};
-typedef struct adjacent_with_u_in_G* adjacentG;
-
-struct GlobalVariables {
- /** All this stuff used to be static global variables. They are
- * refactored into this structure so that they can be turned
- * local with minimum impact on rest of code in order to make
- * it thread safe
- */
-
- adjacentG *LG, *LB, *LBend;
-
- /* LG is a pointer to the pointer adjacentG. later on when we find out what is
- the vertex size of our graph, by using malloc we make LG to be
- a list of adjacentG pointers in order to construct our AJACANCY LISTs. At
- this stage LG could be considered as a list with only one element; in
- another word LG is a 1*1 array, and the only element it has is the
- adjacentG pointer. when we make LG a list of adjacentG pointers, we consider
- size of the list as the number of vertices. And while we construct
- adjacency lists we use each pointer of the list for adjacency of a vertex,
- and consider it as head of the link list(adjacency list).
- */
- adjacentG edge, edge2, temp;
-
- /*In order to handle edges of AJACANCY LISTs.
- */
- int count, Pu, compNum, degree, bedge, tmp2;
-
- /*bedge is used while we analysis lists of back edges to determine degree of u
- */
- int *pre, *lowpt, *nd, *next_on_path, *next_sigma_element;
- char *visited, *outgoing_tree_edge;
-
- int parent, child;
-
- stList *list;
- stList *list2;
-
- stSortedSet *adjacencyEdgesSet;
- //******************************************************************************
-};
-typedef struct GlobalVariables GlobalVars;
-
-static void absorb_path(GlobalVars* g, int x0, int xi, int end) {
- int xi_1 = x0;
- if (xi_1 != xi && xi_1 != end) {
- while (xi_1 != xi) {
- xi_1 = g->next_sigma_element[x0];
- g->next_sigma_element[x0] = g->next_sigma_element[xi];
- g->next_sigma_element[xi] = xi_1;
- /*using the variable xi_1 (temporalily) to swip g->next_sigma_element[x0] with g->next_sigma_element[xi]
- */
-
- /*going to append the entire LB[u](here LB[xi]) to LB[w](here LB[x0]).
- */
- if (g->LB[x0] == NULL) {
- g->LB[x0] = g->LB[xi];
- g->LBend[x0] = g->LBend[xi];
- } else {
- g->LBend[x0]->more = g->LB[xi];
- g->LBend[x0] = g->LBend[xi];
- }
- /*end of appending LB[u] to LB[w]
- */
- xi_1 = xi;
- if (xi != end)
- xi = g->next_on_path[xi];
- }
- }
-}
-
-struct Frame {
- int w;
- int v;
- int u;
- adjacentG edge;
- int start;
-};
-
-static void addToStack(int w, int v, int u, adjacentG edge, int start,
- stList *stack) {
- struct Frame *frame;
- frame = st_malloc(sizeof(struct Frame));
- frame->w = w;
- frame->v = v;
- frame->u = u;
- frame->edge = edge;
- frame->start = start;
- stList_append(stack, frame);
-}
-
-static adjacentG adjacencyEdge_construct(GlobalVars* g) {
- adjacentG ag = st_malloc(sizeof(struct adjacent_with_u_in_G));
- stSortedSet_insert(g->adjacencyEdgesSet, ag);
- return ag;
-}
-
-static void adjacencyEdge_destruct(GlobalVars* g, adjacentG ag) {
- assert(stSortedSet_search(g->adjacencyEdgesSet, ag) != NULL);
- stSortedSet_remove(g->adjacencyEdgesSet, ag);
- free(ag);
-}
-
-static void three_edge_connectP(GlobalVars *g, int w, int v, struct Frame *frame, stList *stack);
-
-static void three_edge_connect(GlobalVars *g, int w, int v) {
- struct Frame *frame;
- stList *stack;
-
- stack = stList_construct();
- addToStack(w, v, 0, NULL, 0, stack);
- while (stList_length(stack) > 0) {
- frame = stList_pop(stack);
- three_edge_connectP(g, frame->w, frame->v, frame, stack);
- free(frame);
- }
- stList_destruct(stack);
-}
-
-static void three_edge_connectP(GlobalVars *g, int w, int v, struct Frame *frame, stList *stack) {
-
- int u;
- adjacentG edge;
-
- if (frame->start == 1) {
- u = frame->u;
- edge = frame->edge;
- goto next;
- //naughty hack!
- }
-
- g->nd[w] = 1;
- g->visited[w] = 'Y';
-
- g->next_sigma_element[w] = w;
- /*to indicate elements of the set sigma(w) and print out the component of w
- */
- g->next_on_path[w] = w;
- /*To represent W-path and U-path; next_on_path[w] is the next vertex that can
- be absorbed on W_path. IF next_on_path[w] == w, that means W_path is NULL.
- In another word next_on_path[w] is a child of w on current W_path in each
- new resulting graph.
- */
-
- g->pre[w] = g->count;
- g->lowpt[w] = g->pre[w];
- g->count = g->count + 1;
-
- edge = g->LG[w];
- while (edge != NULL) {
- /*for every edge e=(w,u)=(w,edge->u) of LG[w] do the followings.
- */
- u = edge->u;
-
- //(Please ignore this!) deg[w] = deg[w] + 1; // it is obvious that after facing each new edge, deg[w] must be increased
-
-
- //1
- if (g->visited[u] == 'N') {
- addToStack(frame->w, frame->v, u, edge, 1, stack);
- addToStack(u, w, 0, NULL, 0, stack);
- return;
- next:
- //three_edge_connect(u,w);
- g->nd[w] = g->nd[w] + g->nd[u];
- g->degree = 0;
- g->bedge = 0;
- if (g->next_on_path[u] == u) {
- /*if U-path is null
- */
- while (g->bedge <= 1 && g->LB[u] != NULL) {
- /*Scan the list of back edges until more than one back edge is found or the list gets exhausted.
- */
- if (g->pre[u] > g->pre[g->LB[u]->u]) {
- /*The current back edge is not a self loop.
- Note that the current edge is the head of list.
- If this is the first one that we encounter then we memorize it
- using pointer temp, and set the next edge as the head of list
- in order to temporally eliminate the back edge from the list;
- however we add it again to the list after the while loop.
- If this is the second one that we encounter then bedge would
- become equal to 2, and the while loop ends having the current
- back edge (the second one) as the head of list.
- */
- g->bedge = g->bedge + 1;
- if (g->bedge == 1) {
- g->temp = g->LB[u];
- g->LB[u] = g->LB[u]->more;
- }
- } else {
- /*The current back edge is a self loop or an outdated one.
- We free up the allocated memory, and set the next edge on the
- list as the head of list in order to eliminate the self-loop
- from the list.
- */
- g->edge2 = g->LB[u];
- g->LB[u] = g->LB[u]->more;
- adjacencyEdge_destruct(g, g->edge2);
- }
- }
- /*lB[U] is always the head of list, and at this time either it is
- pointing to the second back edge we encountered or it is pointing
- to NULL because in the previous while loop the list got exhausted
- and we encountered at most one back edge; note that if we have seen
- the first back edge at the end of list, still LB[u] is pointing
- to NULL because we always eliminate the first back edge from the
- list temporally. Hence we must now add the first back edge to the
- list.
- Note that if the list got exhausted and we have seen a
- self-loop at the end of the list, therefore deg[u] is at most 2 and we
- have eliminated the last edge (self-loop) from the list and
- LBend[u] is now pointing
- to that eliminated self-loop but we don't update LBend[u] (set
- it to NULL or to the possible back-edge we found) because after this
- we might use LB[u] only one more time and we append the possible back-edge
- we found to LB[w] in the following steps and since LB[u] has at most
- one element we can do the appending without using LBend[u].
- */
- if (g->bedge != 0) { //if we encountered one or two back-edges, the first has been
- //eliminated. so we add it again.
- g->temp->more = g->LB[u];
- g->LB[u] = g->temp;
- }
- if (g->bedge <= 1)
- /*since the u-path is null, if no back-edge or exactly one back-edge was found in
- the list of back edges, degree of u is 2; it means degree of u is at most 2.
- */
- g->degree = 2; //degree of u is at most 2.
- } else {
- /*if u-path is not null
- */
- while (g->bedge == 0 && g->LB[u] != NULL) {
- /*Scan the list of back edges until no back edge is found or the
- list gets exhausted.
- */
- if (g->pre[u] > g->pre[g->LB[u]->u])
- /*the current back edge is not a self loop.
- */
- g->bedge = g->bedge + 1;
- else {
- /*The current back edge is a self loop or an outdated one.
- */
- g->edge2 = g->LB[u];
- g->LB[u] = g->LB[u]->more;
- adjacencyEdge_destruct(g, g->edge2);
- }
- }
- if (g->bedge == 0)
- /*since the U-path is not null, if no back edge was found in the
- list of back edges, degree of u is 2.
- */
- g->degree = 2;
- }
- //1.1
- if (g->degree == 2) { //if degree of u is at most 2.
- /*//YesOrNo
- printf("It's a NO instance!");
- exit(1);
- *///YesOrNo
- // if (g->LB[u]==NULL) {//U_path is not NULL
- if (g->next_on_path[u] != u) {
- g->Pu = g->next_on_path[u];
- /*equivalent to (Pu=Pu-u) what proposed in the paper.
- that means the next vertex can be absorbed on U-path is
- the one after u, and u is not absorbed at all because it
- has just been spitted out.
- */
- } else {//U_path is NULL
- /*Since next_on_path[u] == u, that means U-path is NULL, and there
- might be only u to be absorbed by w; but u has just been spitted
- out (deg(u)<=2) and became an isolated vertex; hence u can not be
- absorbed any more. To tell vertex w that it can not absorb u we do
- this: Pu = w. Note that although U_path is NULL, but u itself
- could be available to be absorbed on W_path by w. That is why when
- u is not also available to be absorbed, we set Pu to w(Pu = w;).
- In this way if we later set next_on_path[w] to Pu (1.4) that means
- W-path is NULL as well.
- */
- g->Pu = w;
- /*If at this point LB[u] is NULL that means U_path is not
- NULL and there is not any outgoing back edge of u. So not only u
- has not absorbed any vertex, but also nothing has been appended
- so far to LB[u] because the last descendent of u(let say y) has a
- degree bigger than 2, and is waiting for an incoming back edge
- (x,y) of x(x is an ancestor of u) to be explored by DFS so that y
- is added to sigma(x). Also any other descendent of u (if exists)
- has a degree of 2, and its LB is NULL same as u.
- Note that when a vertex x absorbs a vertex y, LB[y] can not be
- NULL, and LB[y] is appended to LB[x]. Sometimes y is a child of x,
- and degree of y is 2; so x does not absorb y, however if LB[y] is
- not NULL, LB[y] is appended to LB[x] when DSF backup from y to x.
- if LB[u] is not NULL, then we are going to append the entire LB[u]
- to LB[w]. (At this time LB[u] has only one element)
- */
- if (g->LB[u] != NULL) { //if there is an outgoing back-edge of u;
- //we know there might be at most one.
- if (g->LB[w] == NULL)
- g->LBend[w] = g->LB[u];
- g->LB[u]->more = g->LB[w];
- g->LB[w] = g->LB[u];
- /*Note that we can not bring the if statement after
- "LB[w] = LB[u];" because in that case LB[w] is assigned to
- something which in not NULL, hence the if statement never
- get satisfied.
- */
- }
- }
- g->compNum = g->compNum + 1;
- //PRINT
- g->list2 = stList_construct3(0, (void(*)(void *)) stIntTuple_destruct);
- stList_append(g->list, g->list2);
- stList_append(g->list2, stIntTuple_construct1( u-1));
- //st_logDebug("\nNew component found: %d", u);
- //PRINT
- g->tmp2 = g->next_sigma_element[u];
- while (g->tmp2 != u) {
- //PRINT
- //st_logDebug(",%d", tmp2);
- stList_append(g->list2, stIntTuple_construct1( g->tmp2-1)); //constructInt(tmp2));
- //PRINT
- g->tmp2 = g->next_sigma_element[g->tmp2];
- }
- }//end of if (degree==2)
- else
- g->Pu = u;
- /*since deg(u) is not 2 then the next vertex can be absorbed on
- U-path is u.
- */
- //1.2
- if (g->lowpt[w] <= g->lowpt[u])
- //1.3
- absorb_path(g, w, g->Pu, 0);//(w+Pu)
- else {
- g->lowpt[w] = g->lowpt[u];
- //1.4
- absorb_path(g, w, g->next_on_path[w], 0);//(Pw)
- g->next_on_path[w] = g->Pu;
- }
- }//end of if u is NOT visited
- else {
- /*when u is visited
- */
- if (u == v && g->outgoing_tree_edge[w] == '1') {
- g->outgoing_tree_edge[w] = '0';
- /*Once we encounter to an (w,u) edge, such that u is the
- parent of w, we consider this edge as the incoming tree edge from
- parent of w or outgoing_tree_edge of w.
- From now, no more outgoing_tree-edge (w,u) must be encountered!
- It means any other (if exists) (w,u) edge, which u=v=parent(w),
- is a parallel edge and also an outgoing back-edge!
- */
- }
- //1.5.0
- else if (g->pre[w] > g->pre[u]) {
- /*if (w,u) is an outgoing back-edge of w
- */
- /*going to append the outgoing back_edge to LB[w]
- */
- g->edge2 = adjacencyEdge_construct(g);
- g->edge2->u = u;
- g->edge2->more = g->LB[w];
- if (g->LB[w] == NULL)
- g->LBend[w] = g->edge2;
- g->LB[w] = g->edge2;
- /*set the new node as the head of the linked list of LB[w]
- */
- /*end of appending the outgoing back_edge to LB[w].
- */
-
- if (g->pre[u] < g->lowpt[w]) {
- //1.5
- absorb_path(g, w, g->next_on_path[w], 0);//Pw
- g->next_on_path[w] = w;
- g->lowpt[w] = g->pre[u];
- }
- }
- //1.6.0
- else if (g->next_on_path[w] != w) {
- /*When pre[w]<pre[u], it means (w,u) is an incoming back-edge of w
- , however we first check to make sure Pw is not Null (by
- next_on_path[w]!=w) because if it is Null there would be nothing
- to be absorbed by w at this time.
- */
- g->parent = w;
- g->child = g->next_on_path[w];
- while ((g->parent != g->child) && (g->pre[g->child] <= g->pre[u]) && (g->pre[u]
- <= g->pre[g->child] + g->nd[g->child] - 1)) {
- /*while g->parent_path in not NULL and child is an ancestor of u
- */
- g->parent = g->child;
- g->child = g->next_on_path[g->child];
- }
- //1.6
- absorb_path(g, w, g->next_on_path[w], g->parent);//Pw[w..u]
- /*starting from child of w absorb everything on Pw[w..u]
- until x(here variable parent) is absorbed. x lies on Pw[w..u]!
- */
- if (g->parent == g->next_on_path[g->parent])
- /*if X_path is NULL then Pw gets NULL as well.
- */
- g->next_on_path[w] = w;
- else
- /*if X_path is not NULL then Pw is set to X_path.
- */
- g->next_on_path[w] = g->next_on_path[g->parent];
- }
- }
- edge = edge->more;
- }
-}//end of three-edge-connect procedure
-//******************************************************************************
-
-stList *computeThreeEdgeConnectedComponents(stList *vertices) {
- GlobalVars g;
- g.compNum = 0;
- g.adjacencyEdgesSet = stSortedSet_construct2(free);
- g.list = stList_construct3(0, (void(*)(void *)) stList_destruct);
-
- int Vnum = stList_length(vertices) + 1;
- int edgeNum = 0; /*initilizing the number of edges in G*/
- int r, n, v, indx;
- int64_t i;
- double tsum;
- clock_t first, end;
- st_logInfo(
- "\nComputing 3edge connected components using\nDr. Tsin's algorithm(The one with reduction)...\n");
- first = clock(); //save CPU clock to variable first
-
- //*********************************Memory allocation
- g.LG = (adjacentG*) st_malloc(Vnum * sizeof(struct adjacent_with_u_in_G *));
-
- g.LB = (adjacentG*) st_malloc(Vnum * sizeof(struct adjacent_with_u_in_G *));
-
- g.LBend = (adjacentG*) st_malloc(Vnum * sizeof(struct adjacent_with_u_in_G *));
-
- g.lowpt = (int *) st_malloc(Vnum * sizeof(int));
-
- g.pre = (int *) st_malloc(Vnum * sizeof(int));
-
- g.nd = (int *) st_malloc(Vnum * sizeof(int));
-
- g.next_on_path = (int *) st_malloc(Vnum * sizeof(int));
-
- g.next_sigma_element = (int *) st_malloc(Vnum * sizeof(int));
-
- g.visited = (char *) st_malloc(Vnum * sizeof(char));
-
- g.outgoing_tree_edge = (char *) st_malloc(Vnum * sizeof(char));
-
- for (indx = 0; indx < Vnum; indx++) {
- g.LG[indx] = NULL;
- g.LB[indx] = NULL;
- g.LBend[indx] = NULL;
- g.visited[indx] = 'N';
- g.outgoing_tree_edge[indx] = '1';
- }
- indx = 0;
-
- for (i = 0; i < stList_length(vertices); i++) {
- stList *edges = stList_get(vertices, i);
- v = i + 1;
- stListIterator *it = stList_getIterator(edges);
- stIntTuple *N;
- while((N = stList_getNext(it)) != NULL) {
- n = stIntTuple_get(N, 0)+1;
- g.edge = adjacencyEdge_construct(&g);
- g.edge->u = n;
- g.edge->more = g.LG[v];
- g.LG[v] = g.edge;
- edgeNum = edgeNum + 1;
- }
- stList_destructIterator(it);
- }
- edgeNum = edgeNum / 2;
-
- st_logInfo("\nComplexity of the given graph:\n|V| + |E| = %d + %d = %d\n",
- Vnum - 1, edgeNum, Vnum + edgeNum - 1);
-
- g.count = 1;
- // r = 1;
- for (r = 1; r < Vnum; r++) {
- if (g.visited[r] == 'N') {
-
- /*//YesOrNo
- if (r>1) {
- printf("It's a NO instance!");
- exit(1);
- }
- *///YesOrNo
-
- three_edge_connect(&g, r, 0);
- g.compNum++;
- //PRINT
- g.list2 = stList_construct3(0, (void(*)(void *)) stIntTuple_destruct);
- stList_append(g.list, g.list2);
- stList_append(g.list2, stIntTuple_construct1( r-1));
- //st_logDebug("\nNew component found: %d", r);
- //PRINT
- g.tmp2 = g.next_sigma_element[r];
- while (g.tmp2 != r) {
- //PRINT
- //st_logDebug(",%d", tmp2);
- stList_append(g.list2, stIntTuple_construct1( g.tmp2-1));
- //PRINT
- g.tmp2 = g.next_sigma_element[g.tmp2];
- }
- }
- }
-
- st_logDebug("Found components\n");
-
- /*//YesOrNo
- printf("It's a YES instance!");
- end=clock(); //save again CPU clock to variable end
- tsum = (end-first)/CLOCKS_PER_SEC;//CLK_TCK; //compute total elapsed time
- printf("\nElapsed Time: %f",tsum);
- exit(1);
- *///YesOrNo
-
- end = clock(); //save again CPU clock to variable end
- tsum = (end - first) / CLOCKS_PER_SEC; //compute total elapsed time
- st_logInfo("\nElapsed Time: %f", tsum);
- st_logInfo("\nConnected Components: %d\n", g.compNum);
-
- //////////////
- //Cleanup
- /////////////
-
- stSortedSet_destruct(g.adjacencyEdgesSet); //This gets rid of all remaining edges
- g.adjacencyEdgesSet = NULL;
-
- free(g.LG);
- free(g.LB);
- free(g.LBend);
- free(g.lowpt);
- free(g.pre);
- free(g.nd);
- free(g.next_on_path);
- free(g.next_sigma_element);
- free(g.visited);
- free(g.outgoing_tree_edge);
-
- return g.list;
-}
=====================================
externalTools/threeEdgeConnected/inc/3_Absorb3edge2x.h deleted
=====================================
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2011 by Yung H Tsin and Nima Norouzi
- *
- * The authors of this code have given their permission
- * to distribute and redistribute this code within this software product,
- * however they require that any further incorporation or copying
- * be permitted by request only, hence the BSD/MIT license which
- * applies to much of the other code in this software product does not apply to this file.
- */
-
-#ifndef ABSORB_3_EDGE_2X_H_
-#define ABSORB_3_EDGE_2X_H_
-
-/*
- * Function takes an graph represented as an adjacency list. Each vertex is represented
- * by a list in the argument "vertices", it's index in the list is its identifier.
- * Each vertice's list contain 1 length stIntTuples that indicate what the vertex is
- * connected to. The return value is a list of lists of nodes,
- * also represented using stLists and stIntTuples.
- */
-stList *computeThreeEdgeConnectedComponents(stList *vertices);
-
-#endif
=====================================
externalTools/threeEdgeConnected/tests/3_Absorb3edge2xTest.c deleted
=====================================
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2009-2011 by Benedict Paten (benedictpaten at gmail.com)
- *
- * Released under the MIT license, see LICENSE.txt
- */
-
-/*
- * sonLibRandomTest.c
- *
- * Created on: 22-Jun-2010
- * Author: benedictpaten
- */
-
-#include "sonLib.h"
-#include "CuTest.h"
-#include "3_Absorb3edge2x.h"
-
-void addEdgeToList(stList *vertices, int64_t vertex1, int64_t vertex2) {
- stList *edges = stList_get(vertices, vertex1);
- stList_append(edges, stIntTuple_construct1( vertex2));
-}
-
-stList *getRandomGraph(int64_t vertexNumber, int64_t edgeNumber) {
- stList *vertices = stList_construct3(0, (void (*)(void *))stList_destruct);
- //Add vertices.
- for(int64_t i=0; i<vertexNumber; i++) {
- stList_append(vertices, stList_construct3(0, (void (*)(void *))stIntTuple_destruct));
- }
- //Add edges.
- while(edgeNumber-- > 0) {
- int64_t vertex1 = st_randomInt(0, vertexNumber);
- int64_t vertex2 = st_randomInt(0, vertexNumber);
- addEdgeToList(vertices, vertex1, vertex2);
- addEdgeToList(vertices, vertex2, vertex1);
- }
- return vertices;
-}
-
-static void test_3EdgeFunction(CuTest *testCase) {
- /*
- * Exercises the 3-edge function
- */
- for(int64_t test=0; test<100; test++) {
-
- /*
- * Get a random graph to test.
- */
- int64_t vertexNumber = st_randomInt(0, 100);
- int64_t edgeNumber = vertexNumber > 0 ? st_randomInt(0, vertexNumber * vertexNumber) : 0;
- stList *vertices = getRandomGraph(vertexNumber, edgeNumber);
-
- /*
- * Compute the 3-edge connected components.
- */
- stList *threeEdgeConnectedComponents = computeThreeEdgeConnectedComponents(vertices);
-
- /*
- * Check the output.
- */
- stSortedSet *seen = stSortedSet_construct3((int (*)(const void *, const void *))stIntTuple_cmpFn, NULL);
- stListIterator *it = stList_getIterator(threeEdgeConnectedComponents);
- stList *threeEdgeConnectedComponent;
- while((threeEdgeConnectedComponent = stList_getNext(it)) != NULL) {
- stListIterator *it2 = stList_getIterator(threeEdgeConnectedComponent);
- stIntTuple *vertex;
- while((vertex = stList_getNext(it2)) != NULL) {
- CuAssertTrue(testCase, stSortedSet_search(seen, vertex) == NULL);
- stSortedSet_insert(seen, vertex);
-
- /*
- * Now check other vertices in component are 3-edge connected to this vertex.
- */
-
- /*
- * And check other vertices are not three edge connected.
- */
- }
- stList_destructIterator(it2);
- }
- stList_destructIterator(it);
- CuAssertTrue(testCase, stList_length(vertices) == stSortedSet_size(seen));
-
- /*
- * Cleanup
- */
- stList_destruct(vertices);
- stSortedSet_destruct(seen);
- }
-}
-
-CuSuite* threeEdgeTestSuite(void) {
- CuSuite* suite = CuSuiteNew();
- SUITE_ADD_TEST(suite, test_3EdgeFunction);
- return suite;
-}
=====================================
externalTools/threeEdgeConnected/tests/allTests.c deleted
=====================================
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2009-2011 by Benedict Paten (benedictpaten at gmail.com)
- *
- * Released under the MIT license, see LICENSE.txt
- */
-
-#include "CuTest.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "sonLib.h"
-
-CuSuite* threeEdgeTestSuite(void);
-
-
-int threeEdgeRunAllTests(void) {
- CuString *output = CuStringNew();
- CuSuite* suite = CuSuiteNew();
- CuSuiteAddSuite(suite, threeEdgeTestSuite());
-
- CuSuiteRun(suite);
- CuSuiteSummary(suite, output);
- CuSuiteDetails(suite, output);
- printf("%s\n", output->buffer);
- return suite->failCount > 0;
-}
-
-int main(int argc, char *argv[]) {
- if(argc == 2) {
- st_setLogLevelFromString(argv[1]);
- }
- return threeEdgeRunAllTests();
-}
=====================================
externalTools/threeEdgeConnected/threeEdgeTests.py deleted
=====================================
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-
-#Copyright (C) 2009-2011 by Benedict Paten (benedictpaten at gmail.com)
-#
-#Released under the MIT license, see LICENSE.txt
-import unittest
-import sys
-
-from cactus.shared.test import parseCactusSuiteTestOptions
-from sonLib.bioio import system
-from sonLib.bioio import getLogLevelString
-
-class TestCase(unittest.TestCase):
- def test3Edge(self):
- """Run the 3-edge connected CuTests, fail if any of them fail.
- """
- system("3EdgeTests %s" % getLogLevelString())
-
-def main():
- parseCactusSuiteTestOptions()
- sys.argv = sys.argv[:1]
- unittest.main()
-
-if __name__ == '__main__':
- main()
View it on GitLab: https://salsa.debian.org/med-team/libpinchesandcacti/-/compare/5eb6330008ec348bc0c575aa2beff76dbf25b40f...19d5eb9f60e947c1629f9674e2be0422cc4d5fcb
--
View it on GitLab: https://salsa.debian.org/med-team/libpinchesandcacti/-/compare/5eb6330008ec348bc0c575aa2beff76dbf25b40f...19d5eb9f60e947c1629f9674e2be0422cc4d5fcb
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20261027/207c75ba/attachment-0001.htm>
More information about the debian-med-commit
mailing list