Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Implemented absolute threshold for sum.

  • Loading branch information...
commit a0d89459a9c8b21e49031cae32cbe46d78a03129 1 parent a1257b8
Naoaki Okazaki authored November 25, 2011
1  approxcounter.vcxproj
@@ -80,6 +80,7 @@
80 80
     <ClInclude Include="exact.h" />
81 81
     <ClInclude Include="optparse.h" />
82 82
     <ClInclude Include="spacesaving.h" />
  83
+    <ClInclude Include="sum_spacesaving.h" />
83 84
     <ClInclude Include="tokenize.h" />
84 85
   </ItemGroup>
85 86
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
3  main.cpp
@@ -145,9 +145,10 @@ int do_sum(const option& opt)
145 145
         n += freq;
146 146
     }
147 147
 
  148
+    double threshold = opt.absolute_support ? opt.support : opt.support * n;
148 149
     typename counter_t::const_iterator it;
149 150
     for (it = counter.begin();it != counter.end();++it) {
150  
-        if (it->second / (double)n > opt.support) {
  151
+        if (it->second  >= threshold) {
151 152
             std::cout << it->first << '\t' << it->second << std::endl;
152 153
         }
153 154
     }

0 notes on commit a0d8945

Please sign in to comment.
Something went wrong with that request. Please try again.