Permalink
Browse files

Dead code removal

  • Loading branch information...
1 parent 7e4e632 commit 1981fe919d37fddca778a60d565abd8e6d2ed5f3 @jts committed Mar 12, 2013
View
@@ -9,7 +9,5 @@ libbigraph_a_SOURCES = \
Bigraph.h Bigraph.cpp \
Vertex.h Vertex.cpp \
Edge.h Edge.cpp \
- TransitiveGroup.h TransitiveGroup.cpp \
- TransitiveGroupCollection.h TransitiveGroupCollection.cpp \
EdgeDesc.h EdgeDesc.cpp \
GraphCommon.h
@@ -1,91 +0,0 @@
-//-----------------------------------------------
-// Copyright 2009 Wellcome Trust Sanger Institute
-// Written by Jared Simpson (js18@sanger.ac.uk)
-// Released under the GPL
-//-----------------------------------------------
-//
-// TransitiveGroup - A set of edges that form a
-// mutually transitive set
-//
-#include "Edge.h"
-#include "TransitiveGroup.h"
-
-TransitiveGroup::TransitiveGroup(Vertex* pVertex, Edge* pIrreducible) : m_pVertex(pVertex)
-{
- m_edges.push_back(pIrreducible);
-}
-
-//
-void TransitiveGroup::add(Edge* pEdge)
-{
- m_edges.push_back(pEdge);
-}
-
-//
-size_t TransitiveGroup::numElements() const
-{
- return m_edges.size();
-}
-
-//
-Edge* TransitiveGroup::getIrreducible() const
-{
- assert(!m_edges.empty());
- // The irreducible edge is the first one in the group
- return m_edges[0];
-}
-
-//
-Edge* TransitiveGroup::getEdge(size_t idx) const
-{
- assert(idx < m_edges.size());
- return m_edges[idx];
-}
-
-//
-Edge* TransitiveGroup::getEdge(EdgeDesc ed) const
-{
- for(size_t i = 0; i < m_edges.size(); ++i)
- {
- if(m_edges[i]->getDesc() == ed)
- return m_edges[i];
- }
-
- return NULL;
-}
-
-// Return the MultiOverlap corresponding to this transitive group
-MultiOverlap TransitiveGroup::getMultiOverlap() const
-{
- MultiOverlap mo(m_pVertex->getID(), m_pVertex->getSeq().toString());
-
- for(size_t i = 0; i < m_edges.size(); ++i)
- {
- Edge* pEdge = m_edges[i];
- mo.add(pEdge->getEnd()->getSeq().toString(), pEdge->getOverlap());
- }
- return mo;
-}
-//
-bool TransitiveGroup::hasEdge(EdgeDesc ed) const
-{
- Edge* pe = getEdge(ed);
- return pe != NULL;
-}
-
-//
-void TransitiveGroup::print() const
-{
- std::cout << "\tIrr: " << *m_edges[0] << "\n";
- for(size_t i = 1; i < m_edges.size(); ++i)
- {
- std::cout << "\tTrans: " << *m_edges[i] << "\n";
- }
-}
-
-//
-void TransitiveGroup::printMultiOverlap() const
-{
- MultiOverlap mo = getMultiOverlap();
- mo.printPileup();
-}
@@ -1,48 +0,0 @@
-//-----------------------------------------------
-// Copyright 2009 Wellcome Trust Sanger Institute
-// Written by Jared Simpson (js18@sanger.ac.uk)
-// Released under the GPL
-//-----------------------------------------------
-//
-// TransitiveGroup - A set of edges that form a
-// mutually transitive set wrt a given vertex
-//
-#ifndef TRANSITIVEGROUPS_H
-#define TRANSITIVEGROUPS_H
-
-#include <vector>
-#include "MultiOverlap.h"
-
-// Forward declare
-class Edge;
-class Vertex;
-struct EdgeDesc;
-
-typedef std::vector<Edge*> EdgePtrVec;
-
-class TransitiveGroup
-{
- public:
- TransitiveGroup(Vertex* pVertex, Edge* pIrreducible);
-
- void add(Edge* pEdge);
-
- Edge* getIrreducible() const;
- Edge* getEdge(size_t idx) const;
- Edge* getEdge(EdgeDesc ed) const;
- MultiOverlap getMultiOverlap() const;
- bool hasEdge(EdgeDesc ed) const;
- size_t numElements() const;
-
- // IO
- void print() const;
- void printMultiOverlap() const;
-
- private:
-
- // data
- Vertex* m_pVertex;
- EdgePtrVec m_edges;
-};
-
-#endif
@@ -1,62 +0,0 @@
-//-----------------------------------------------
-// Copyright 2009 Wellcome Trust Sanger Institute
-// Written by Jared Simpson (js18@sanger.ac.uk)
-// Released under the GPL
-//-----------------------------------------------
-//
-// TransitiveGroupCollection - A collection
-// of TransitiveGroups, representing the partitioning
-// of edges for a given vertex
-//
-#include "TransitiveGroupCollection.h"
-#include "Edge.h"
-
-//
-TransitiveGroupCollection::TransitiveGroupCollection(Vertex* pVertex,
- EdgeDir dir) : m_pVertex(pVertex), m_dir(dir)
-{
-
-}
-
-//
-TransitiveGroup& TransitiveGroupCollection::createGroup(Edge* pIrreducible)
-{
- m_groups.push_back(TransitiveGroup(m_pVertex, pIrreducible));
- return m_groups.back();
-}
-
-//
-TransitiveGroup& TransitiveGroupCollection::getGroup(size_t idx)
-{
- assert(idx < m_groups.size());
- return m_groups[idx];
-}
-
-// Find the group that the edge with EdgeDesc is in
-size_t TransitiveGroupCollection::findGroup(EdgeDesc ed) const
-{
- for(size_t i = 0; i < numGroups(); ++i)
- {
- if(m_groups[i].hasEdge(ed))
- return i;
- }
- assert(false);
- return 0;
-}
-
-//
-size_t TransitiveGroupCollection::numGroups() const
-{
- return m_groups.size();
-}
-
-//
-void TransitiveGroupCollection::print() const
-{
- for(size_t i = 0; i < numGroups(); ++i)
- {
- std::cout << "Group: " << i << "\n";
- m_groups[i].printMultiOverlap();
- }
-}
-
@@ -1,41 +0,0 @@
-//-----------------------------------------------
-// Copyright 2009 Wellcome Trust Sanger Institute
-// Written by Jared Simpson (js18@sanger.ac.uk)
-// Released under the GPL
-//-----------------------------------------------
-//
-// TransitiveGroupCollection - A collection
-// of TransitiveGroups, representing the partitioning
-// of edges for a given vertex
-//
-#ifndef TRANSITIVEGROUPCOLLECTION_H
-#define TRANSITIVEGROUPCOLLECTION_H
-
-#include "GraphCommon.h"
-#include "TransitiveGroup.h"
-
-class Vertex;
-struct EdgeDesc;
-
-typedef std::vector<TransitiveGroup> TransitiveGroupVector;
-
-class TransitiveGroupCollection
-{
- public:
- TransitiveGroupCollection(Vertex* pVertex, EdgeDir dir);
-
- TransitiveGroup& createGroup(Edge* pIrreducible);
- TransitiveGroup& getGroup(size_t idx);
- size_t findGroup(EdgeDesc ed) const;
- size_t numGroups() const;
-
- void print() const;
-
- private:
-
- Vertex* m_pVertex;
- EdgeDir m_dir;
- TransitiveGroupVector m_groups;
-};
-
-#endif
Oops, something went wrong.

0 comments on commit 1981fe9

Please sign in to comment.