Show
Ignore:
Timestamp:
11/07/08 13:57:29 (2 months ago)
Author:
mrkn
Message:

clustering coefficient of the isolated and one-edge vertices is zero.

Location:
lang/cplusplus/boost-supplement/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/cplusplus/boost-supplement/trunk/ChangeLog

    r22565 r22911  
     12008-11-07  Kenta Murata  <mrkn@mrkn.jp> 
     2 
     3        * boost_supplement/graph/clustering_coefficient.hpp (boost_supplement::clustering_coefficient): 
     4        clustering coefficient of the isolated and one-edge vertices is zero. 
     5 
    162008-11-02  Kenta Murata  <mrkn@mrkn.jp> 
    27 
  • lang/cplusplus/boost-supplement/trunk/boost_supplement/graph/clustering_coefficient.hpp

    r21208 r22911  
    2727    tie(ai, ai_end) = adjacent_vertices(v, g); 
    2828    long n = std::distance(ai, ai_end); 
     29#if 0 
    2930    if (n == 0) { put(vcc_map, v, 0.0); continue; } // skip isolated vertex 
    3031    if (n == 1) { put(vcc_map, v, 1.0); continue; } // skip one-edge-vertex 
     32#else 
     33    if (n == 0 || n == 1) { put(vcc_map, v, 0.0); continue; } // skip isolated vertex and one-edge-vertex 
     34#endif 
    3135    double den = n*(n-1) / 2.0; 
    3236