Commit 5ffa57c4 authored by Ale Abdo's avatar Ale Abdo
Browse files

updates from master

parents 74f1cdae 300d6f4a
......@@ -123,7 +123,7 @@ def parse_options(arguments = sys.argv[1:]):
["remove-edge-property", "PROPERTY", "remove the selected edge property", {}, "graph.RemoveEdgeProperty($PROPERTY)"],
["remove-graph-property", "PROPERTY", "remove the selected graph property", {}, "graph.RemoveGraphProperty($PROPERTY)"],
["insert-vertex-index-property", "PROPERTY", "insert vertex index as property", {}, "graph.InsertVertexIndexProperty($PROPERTY)"],
["insert-edge-index-property", "PROPERTY", "insert edge index as property", {}, "graph.InsertEdgeIndexProperty($PROPERTY"],
["insert-edge-index-property", "PROPERTY", "insert edge index as property", {}, "graph.InsertEdgeIndexProperty($PROPERTY)"],
["list-properties", None, "list all properties", {}, "graph.ListProperties()"],
["purge-vertices", None, "Remove all vertices of the graph which are currently being filtered out, and return to the unfiltered state",
{}, ["graph.PurgeVertices()", "graph.SetVertexFilterProperty('')" ]],
......@@ -158,7 +158,7 @@ def parse_options(arguments = sys.argv[1:]):
["average-sampled-harmonic-distance", "[OPTIONS[|FILE]]", "get the average sampled harmonic distance. Options are $OPTIONS_LIST",
{"FILE":"-", "OPTIONS":[ ("samples",("int",1000)), ("weight",("str","")), ("seed",("int",int(time.time())))] },
["hist = graph.GetSampledDistanceHistogram($weight,$samples,$seed)",
"avg, err = get_mean(dict((1.0/k,v) for k,v in hist.iteritems()))",
"avg, err = get_mean(dict([(1.0/k,v) for k,v in hist.iteritems()]))",
"(1.0/avg, err/(avg**2))"]],
["label-components", "PROPERTY", "label components to PROPERTY", {}, "graph.LabelComponents($PROPERTY)"],
["label-parallel-edges", "PROPERTY", "label parallel edges to PROPERTY", {}, "graph.LabelParallelEdges($PROPERTY)"],
......@@ -413,7 +413,7 @@ def parse_options(arguments = sys.argv[1:]):
if opt.type == "bool":
value = eval(value)
else:
value = eval("%s('%s')" % (opt.type, value))
value = eval("%s('%s')" % (opt.type, self.unquote(value)))
except ValueError:
raise OptionError(self, "invalid value for '%s': %s (expected %s)" % (opt.name, value, opt.type))
subopts[opt.name] = value
......
......@@ -71,12 +71,12 @@ GraphInterface::GraphInterface()
_vertex_index(get(vertex_index,_mg)),
_edge_index(get(edge_index_t(),_mg)),
_vertex_filter_map(_vertex_index),
_vertex_range(make_pair(numeric_limits<double>::min(), numeric_limits<double>::max())),
_vertex_range_include(make_pair(false, false)),
_vertex_range(make_pair(0.0, numeric_limits<double>::max())),
_vertex_range_include(make_pair(true, true)),
_vertex_range_invert(false),
_edge_filter_map(_edge_index),
_edge_range(make_pair(numeric_limits<double>::min(), numeric_limits<double>::max())),
_edge_range_include(make_pair(false, false)),
_edge_range(make_pair(0.0, numeric_limits<double>::max())),
_edge_range_include(make_pair(true, true)),
_edge_range_invert(false)
{
......@@ -125,8 +125,8 @@ void GraphInterface::SetVertexFilterProperty(string property)
else
{
_vertex_filter_map = _vertex_index;
_vertex_range = make_pair(numeric_limits<double>::min(), numeric_limits<double>::max());
_vertex_range_include = make_pair(false, false);
_vertex_range = make_pair(0.0, numeric_limits<double>::max());
_vertex_range_include = make_pair(true, true);
_vertex_range_invert = false;
}
#else
......@@ -169,8 +169,8 @@ void GraphInterface::SetEdgeFilterProperty(string property)
else
{
_edge_filter_map = _edge_index;
_edge_range = make_pair(numeric_limits<double>::min(), numeric_limits<double>::max());
_edge_range_include = make_pair(false, false);
_edge_range = make_pair(0.0, numeric_limits<double>::max());
_edge_range_include = make_pair(true, true);
_edge_range_invert = false;
}
#else
......
......@@ -54,9 +54,9 @@ public:
};
// histogram types
typedef std::tr1::unordered_map<double,size_t> hist_t;
typedef std::tr1::unordered_map<double,double> hist_t;
typedef std::tr1::unordered_map<std::pair<double,double>,double, boost::hash<std::pair<double,double> > > hist2d_t;
typedef std::tr1::unordered_map<boost::tuple<double,double,double>,double_t, boost::hash<boost::tuple<double,double,double> > > hist3d_t;
typedef std::tr1::unordered_map<boost::tuple<double,double,double>,double, boost::hash<boost::tuple<double,double,double> > > hist3d_t;
typedef std::tr1::unordered_map<double,std::pair<double,double> > avg_corr_t;
typedef boost::variant<degree_t,std::string> deg_t;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment