• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/elements/genericProc/programs/MTGL/test/test_find_assortativity.h

00001 /*  _________________________________________________________________________
00002  *
00003  *  MTGL: The MultiThreaded Graph Library
00004  *  Copyright (c) 2008 Sandia Corporation.
00005  *  This software is distributed under the BSD License.
00006  *  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00007  *  the U.S. Government retains certain rights in this software.
00008  *  For more information, see the README file in the top MTGL directory.
00009  *  _________________________________________________________________________
00010  */
00011 
00012 /****************************************************************************/
00013 /*! \file test_find_assortivity.h
00014 
00015     \author Jon Berry (jberry@sandia.gov)
00016 
00017     \date 12/4/2007
00018 */
00019 /****************************************************************************/
00020 
00021 #include <mtgl/util.hpp>
00022 #include <mtgl/metrics.hpp>
00023 
00024 using namespace mtgl;
00025 
00026 #ifndef GET_FREQ
00027 #define GET_FREQ
00028 
00029 double get_freq()
00030 {
00031 #ifdef __MTA__
00032   double freq = mta_clock_freq();
00033 #else
00034   double freq = 1000000;
00035 #endif
00036   return freq;
00037 }
00038 #endif
00039 
00040 template <typename graph>
00041 void test_find_assortativity(graph& g, int types)
00042 {
00043   double result;
00044 
00045   find_assortativity<graph> fa(g, &result, types);
00046 //  mta_resume_event_logging();
00047   int ticks1 = fa.run();
00048 //  mta_suspend_event_logging();
00049 
00050   fprintf(stdout, "assortativity = %lf\n", result);
00051   fprintf(stderr, "RESULT: find_assortativity %lu (%6.2lf, 0)\n",
00052   num_edges(g), ticks1 / get_freq());
00053 }

Generated on Fri Oct 22 2010 11:02:23 for SST by  doxygen 1.7.1