Commit c28e4ec7 authored by Davis King's avatar Davis King

Clarified spec with regards to infinite weight edges.

parent be223250
...@@ -29,7 +29,8 @@ namespace dlib ...@@ -29,7 +29,8 @@ namespace dlib
- Interprets edges as a directed graph. That is, it contains the edges on the - Interprets edges as a directed graph. That is, it contains the edges on the
said graph and the ordered_sample_pair::distance() values define the edge said graph and the ordered_sample_pair::distance() values define the edge
weights (larger values indicating a stronger edge connection between the weights (larger values indicating a stronger edge connection between the
nodes). nodes). If an edge has a distance() value of infinity then it is considered
a "must link" edge.
- returns the number of clusters found. - returns the number of clusters found.
- #labels.size() == max_index_plus_one(edges) - #labels.size() == max_index_plus_one(edges)
- for all valid i: - for all valid i:
......
...@@ -19,6 +19,8 @@ namespace dlib ...@@ -19,6 +19,8 @@ namespace dlib
/*! /*!
requires requires
- labels.size() == max_index_plus_one(edges) - labels.size() == max_index_plus_one(edges)
- for all valid i:
- 0 <= edges[i].distance() < std::numeric_limits<double>::infinity()
ensures ensures
- Interprets edges as an undirected graph. That is, it contains the edges on - Interprets edges as an undirected graph. That is, it contains the edges on
the said graph and the sample_pair::distance() values define the edge weights the said graph and the sample_pair::distance() values define the edge weights
...@@ -42,6 +44,8 @@ namespace dlib ...@@ -42,6 +44,8 @@ namespace dlib
/*! /*!
requires requires
- labels.size() == max_index_plus_one(edges) - labels.size() == max_index_plus_one(edges)
- for all valid i:
- 0 <= edges[i].distance() < std::numeric_limits<double>::infinity()
ensures ensures
- Interprets edges as a directed graph. That is, it contains the edges on the - Interprets edges as a directed graph. That is, it contains the edges on the
said graph and the ordered_sample_pair::distance() values define the edge said graph and the ordered_sample_pair::distance() values define the edge
...@@ -72,6 +76,8 @@ namespace dlib ...@@ -72,6 +76,8 @@ namespace dlib
/*! /*!
requires requires
- is_ordered_by_index(edges) == true - is_ordered_by_index(edges) == true
- for all valid i:
- 0 <= edges[i].distance() < std::numeric_limits<double>::infinity()
ensures ensures
- This function performs the clustering algorithm described in the paper - This function performs the clustering algorithm described in the paper
Modularity and community structure in networks by M. E. J. Newman. Modularity and community structure in networks by M. E. J. Newman.
...@@ -99,6 +105,9 @@ namespace dlib ...@@ -99,6 +105,9 @@ namespace dlib
const unsigned long max_iterations = 2000 const unsigned long max_iterations = 2000
); );
/*! /*!
requires
- for all valid i:
- 0 <= edges[i].distance() < std::numeric_limits<double>::infinity()
ensures ensures
- This function is identical to the above newman_cluster() routine except that - This function is identical to the above newman_cluster() routine except that
it operates on a vector of sample_pair objects instead of it operates on a vector of sample_pair objects instead of
......
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