MorphoGraphX  2.0-1-227
GraphAlgorithms.hpp
Go to the documentation of this file.
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2015 Richard S. Smith and collaborators.
4 //
5 // If you use MorphoGraphX in your work, please cite:
6 // http://dx.doi.org/10.7554/eLife.05864
7 //
8 // MorphoGraphX is free software, and is licensed under under the terms of the
9 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
10 //
11 #ifndef GRAPHALGORITHMS_HPP
12 #define GRAPHALGORITHMS_HPP
13 
14 #include <Misc.hpp>
15 #include <Subdivide.hpp>
16 #include <Attributes.hpp>
17 
18 #include <queue>
19 
20 //#include "DivisionAnalysisData.hpp"
21 
22 using namespace std;
23 
24 namespace mgx {
25 
26 
27 typedef std::pair<int, int> IntInt;
28 typedef std::pair<IntInt, double> IntIntDouble;
29 
30 
31  mgx_EXPORT void matrixInverseGSL(std::vector<std::vector<double> >& inputM, std::vector<std::vector<double> >& outputM);
32  mgx_EXPORT void systemSolveGSL(std::vector<std::vector<double> >& inputM, std::vector<double>& x);
33 
34  // calculates the betweenness centrality for the (unweighted) cell graph
35  mgx_EXPORT void calcBetweenness(cellGraph &C, std::map<cell, double>& cellBetweenessMap);
36 
37  // calculates the betweenness centrality for the (weighted) cell graph
38  mgx_EXPORT bool calcBetweenness(cellGraph &C, std::map<IntInt, double>& weights, std::map<cell, double>& cellBetweenessMap);
39 
40  mgx_EXPORT bool calcBetweenness(std::map<IntInt, double>& neighborhoodGraph, std::map<int, double>& cellBetweenessMap);
41 
42  // generate a weight map for the edges
43  mgx_EXPORT std::map<IntInt, double> generateWeights(std::map<IntInt, double> neighborMap, bool constWeight);
44 
45  // generate an ordering for cells (bfs)
46  mgx_EXPORT std::vector<cell> cuthillMckeeOrdering(cellGraph &C, std::map<cell, int>& cellOrder);
47  mgx_EXPORT std::vector<cell> cuthillMckeeOrdering(cellGraph &C, std::map<cell, int>& cellOrder, const cell &minCell);
48 
49  mgx_EXPORT void reverseVector(std::vector<cell>& input);
50 
51 }
52 
53 #endif
Attributes.hpp
mgx::IntInt
std::pair< int, int > IntInt
Definition: GraphAlgorithms.hpp:27
mgx::calcBetweenness
mgx_EXPORT bool calcBetweenness(std::map< IntInt, double > &neighborhoodGraph, std::map< int, double > &cellBetweenessMap)
mgx::cuthillMckeeOrdering
mgx_EXPORT std::vector< cell > cuthillMckeeOrdering(cellGraph &C, std::map< cell, int > &cellOrder, const cell &minCell)
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::neighborhoodGraph
mgx_EXPORT bool neighborhoodGraph(const vvGraph &S, double tolerance, NhbdGraphInfo &info, bool throwError=true)
Subdivide.hpp
mgx::systemSolveGSL
mgx_EXPORT void systemSolveGSL(std::vector< std::vector< double > > &inputM, std::vector< double > &x)
Misc.hpp
mgx::generateWeights
mgx_EXPORT std::map< IntInt, double > generateWeights(std::map< IntInt, double > neighborMap, bool constWeight)
mgx::matrixInverseGSL
mgx_EXPORT void matrixInverseGSL(std::vector< std::vector< double > > &inputM, std::vector< std::vector< double > > &outputM)
mgx::IntIntDouble
std::pair< IntInt, double > IntIntDouble
Definition: GraphAlgorithms.hpp:28
mgx::reverseVector
mgx_EXPORT void reverseVector(std::vector< cell > &input)
mgx::VVGraph< mgx::CellData, mgx::WallData >
mgx::Vertex
Definition: Vertex.hpp:58