Example #1
0
 std::string
 finalizeStringMean() const
 {
   std::string n = numSrcStr();
   std::string a = accumStr();
   std::string z = a + " / " + n;
   return z;
 }
Example #2
0
 std::string
 finalizeStringMean() const
 {
   // Laks hack: for callers view and flat view, it would be
   // more accurate if we divide the sum with the aggregate
   // since the num of callers view and flat view will be 
   // accumulated
   std::string n = numSrcStr();
   std::string a = accumStr();
   std::string z = a + " / " + n;
   return z;
 }
Example #3
0
  std::string
  finalizeStringStdDev(std::string* meanRet = NULL) const
  {
    std::string n = numSrcStr();
    std::string a1 = accumStr();  // running sum
    std::string a2 = accum2Str(); // running sum of squares

    std::string mean = a1 + " / " + n;
    std::string z1 = "pow(" + mean + ", 2)"; // (mean)^2
    std::string z2 = "(" + a2 + " / " + n  + ")";      // (sum of squares)/n
    std::string sdev = "sqrt(" + z2 + " - " + z1 + ")";

    if (meanRet) {
      *meanRet = mean;
    }
    return sdev;
  }