Commit 300d6f4a authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix vertex and edge filtering, when only one is active

    
When only one of vertex or edge filtering was disabled, the allowed
range of the disabled filter was set to
]numeric_limits<double>::min(), numeric_limits<double>::max()[, and
the selected filtering property was the respective index. But
according to the STL documentation from GCC,
numeric_limits<>::min() returns:
    
   "The minimum finite value, or for floating types with
    denormalization, the minimum positive normalized value."
    
which is always positive for double (!), thus introducing a weird
regression, where the first vertex (index 0) is always filtered out if
only the edge filter is active, and vice-versa.
parent d28e2f34
......@@ -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
......
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