Ignore:
Timestamp:
Dec 15, 2011, 12:38:09 AM (8 years ago)
Author:
vla24
Message:

Added some code to support performance tests using PAPI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/SymbolTable/symbol_stat_gatherer.h

    r1769 r1786  
    2424    int min(vector<int>v);
    2525    int max(vector<int>v);
     26    float total(vector<int>v);
    2627    double average(vector<int>v);
    2728};
     
    6768//    symbol density (symbol separation distance)
    6869    vector<int> symbol_density = compute_symbol_density(density_starts, density_ends);
    69     printf ("Avg symbol density: %f\n", average(symbol_density));
     70//    printf ("Avg symbol density: %f\n", average(symbol_density));
     71    float total_lgth = total(symbol_lgth);
     72    float total_delimiters = total(symbol_density);
     73    printf ("Symbol density: %f\n", total_lgth/(total_lgth+total_delimiters));
    7074}
    7175
     
    104108}
    105109
     110float SymbolStatGatherer::total(vector<int> v)
     111{
     112    float result = 0;
     113    for (vector<int>::iterator it = v.begin(); it < v.end(); it++)
     114    {
     115        int number = *it;
     116        result += number;
     117    }
     118    return result;
     119}
     120
    106121int SymbolStatGatherer::max(vector<int> v)
    107122{
Note: See TracChangeset for help on using the changeset viewer.