75 #ifndef prof_Prof_Metric_AExpr_hpp 76 #define prof_Prof_Metric_AExpr_hpp 100 #define epsilon (0.000001) 145 double z =
eval(mdata);
239 virtual std::ostream&
240 dump(std::ostream& os = std::cout)
const 246 virtual std::ostream&
247 dumpMe(std::ostream& os = std::cout)
const = 0;
261 for (
uint i = 0; i < sz; ++i) {
262 double x = opands[i]->
eval(mdata);
269 static std::pair<double, double>
274 for (
uint i = 0; i < sz; ++i) {
275 double x = opands[i]->
eval(mdata);
279 return std::make_pair(z1, z2);
286 double sum =
evalSum(mdata, opands, sz);
287 double z = sum / (double) sz;
293 static std::pair<double, double>
298 for (
uint i = 0; i < sz; ++i) {
299 double t = opands[i]->
eval(mdata);
300 double delta = t - x_mean;
301 x_mean += delta / (i + 1);
302 x_var += delta * (t - x_mean);
306 return std::make_pair(x_var, x_mean);
315 double z2 = z.second;
324 const char* sep =
", ");
366 virtual std::ostream&
367 dumpMe(std::ostream& os = std::cout)
const;
410 virtual std::ostream&
411 dumpMe(std::ostream& os = std::cout)
const;
427 Var(std::string name,
int metricId)
428 : m_name(name), m_metricId(metricId)
461 virtual std::ostream&
462 dumpMe(std::ostream& os = std::cout)
const;
481 : m_base(base), m_exponent(exponent)
510 virtual std::ostream&
511 dumpMe(std::ostream& os = std::cout)
const;
530 : m_numerator(numerator), m_denominator(denominator)
536 delete m_denominator;
558 virtual std::ostream&
559 dumpMe(std::ostream& os = std::cout)
const;
578 : m_minuend(minuend), m_subtrahend(subtrahend)
606 virtual std::ostream&
607 dumpMe(std::ostream& os = std::cout)
const;
626 : m_opands(oprnds), m_sz(numOprnds)
656 virtual std::ostream&
657 dumpMe(std::ostream& os = std::cout)
const;
676 : m_opands(oprnds), m_sz(numOprnds)
700 virtual std::ostream&
701 dumpMe(std::ostream& os = std::cout)
const;
722 : m_opands(oprnds), m_sz(numOprnds)
752 virtual std::ostream&
753 dumpMe(std::ostream& os = std::cout)
const;
771 : m_opands(oprnds), m_sz(numOprnds)
801 virtual std::ostream&
802 dumpMe(std::ostream& os = std::cout)
const;
820 : m_opands(oprnds), m_sz(numOprnds)
831 double z =
evalSum(mdata, m_opands, m_sz);
862 virtual std::ostream&
863 dumpMe(std::ostream& os = std::cout)
const;
881 : m_opands(oprnds), m_sz(numOprnds)
928 virtual std::ostream&
929 dumpMe(std::ostream& os = std::cout)
const;
947 : m_opands(oprnds), m_sz(numOprnds)
994 virtual std::ostream&
995 dumpMe(std::ostream& os = std::cout)
const;
1013 : m_opands(oprnds), m_sz(numOprnds)
1060 virtual std::ostream&
1061 dumpMe(std::ostream& os = std::cout)
const;
1087 {
return (
double)m_numSrc; }
1112 virtual std::ostream&
1113 dumpMe(std::ostream& os = std::cout)
const;
virtual uint numSrcFxd() const
Plus(AExpr **oprnds, uint numOprnds)
std::string combineString2StdDev() const
virtual uint numSrcFxd() const
virtual std::string combineString1() const
virtual std::string finalizeString() const
std::string finalizeStringStdDev(std::string *meanRet=NULL) const
virtual double eval(const Metric::IData &GCC_ATTR_UNUSED mdata) const
std::string finalizeStringSum() const
std::string combineString1NumSource() const
std::string finalizeStringCoefVar() const
std::vector< AExpr * > AExprVec
RStdDev(AExpr **oprnds, uint numOprnds)
virtual double evalNF(Metric::IData &mdata) const
virtual bool hasNumSrcVar() const
CoefVar(AExpr **oprnds, uint numOprnds)
virtual uint numSrcFxd() const
virtual std::string finalizeString() const
virtual uint numSrcVarId() const
virtual uint accumId(int i) const
virtual double evalNF(Metric::IData &mdata) const
double evalStdDevNF(Metric::IData &mdata, AExpr **opands, uint sz) const
const char * DIAG_Unimplemented
virtual uint numSrcFxd() const
virtual uint numSrcFxd() const
virtual std::string combineString1() const
virtual std::string finalizeString() const
virtual std::string combineString2() const
void accumId(int i, uint x)
virtual std::string combineString1() const
virtual uint numSrcFxd() const
virtual std::ostream & dump(std::ostream &os=std::cout) const
virtual std::string combineString1() const
uint m_accumId[maxAccums]
virtual uint numSrcFxd() const
virtual std::string finalizeString() const
virtual uint numAccum() const
std::string finalizeStringNumSource() const
StdDev(AExpr **oprnds, uint numOprnds)
virtual std::string toString() const
virtual std::string combineString2() const
virtual uint numSrcFxd() const
virtual uint numSrcFxd() const
std::string finalizeStringRStdDev() const
virtual std::string finalizeString() const
virtual std::string finalizeString() const
static bool isok(double x)
virtual uint numAccum() const
virtual bool hasNumSrcVar() const
virtual bool hasNumSrcVar() const
Minus(AExpr *minuend, AExpr *subtrahend)
virtual uint numSrcFxd() const
virtual double eval(const Metric::IData &GCC_ATTR_UNUSED mdata) const
virtual std::string finalizeString() const
std::string combineString1Max() const
Times(AExpr **oprnds, uint numOprnds)
virtual uint numSrcFxd() const
std::string finalizeStringMean() const
std::string combineString1Min() const
virtual double eval(const Metric::IData &mdata) const =0
double & accumVar(int i, Metric::IData &mdata) const
virtual uint numSrcFxd() const
virtual bool hasNumSrcVar() const
std::string combineString1Mean() const
virtual std::string combineString2() const
virtual double evalNF(Metric::IData &mdata) const
virtual double eval(const Metric::IData &mdata) const
virtual uint numSrcFxd() const
virtual std::string combineString1() const
virtual int hasAccum() const
Mean(AExpr **oprnds, uint numOprnds)
virtual uint numSrcFxd() const
virtual double evalNF(Metric::IData &mdata) const
virtual std::string finalizeString() const
virtual std::string combineString1() const
virtual bool hasNumSrcVar() const
double demandMetric(size_t mId, size_t size=0) const
Max(AExpr **oprnds, uint numOprnds)
virtual uint numSrcFxd() const
Var(std::string name, int metricId)
std::string finalizeStringMin() const
static void dump_opands(std::ostream &os, AExpr **opands, uint sz, const char *sep=", ")
static double evalMean(const Metric::IData &mdata, AExpr **opands, uint sz)
Divide(AExpr *numerator, AExpr *denominator)
virtual std::ostream & dumpMe(std::ostream &os=std::cout) const =0
static std::pair< double, double > evalVariance(const Metric::IData &mdata, AExpr **opands, uint sz)
virtual std::string combineString1() const
static double evalSum(const Metric::IData &mdata, AExpr **opands, uint sz)
std::string finalizeStringMax() const
std::string combineString1Sum() const
std::string combineString1StdDev() const
virtual std::string combineString2() const
static std::pair< double, double > evalSumSquares(const Metric::IData &mdata, AExpr **opands, uint sz)
virtual std::string combineString1() const
virtual std::string combineString1() const
Min(AExpr **oprnds, uint numOprnds)
virtual uint numSrcFxd() const
virtual uint numAccum() const
virtual std::string combineString1() const
virtual double evalNF(Metric::IData &mdata) const
Power(AExpr *base, AExpr *exponent)
virtual std::string finalizeString() const
virtual std::string finalizeString() const
static double & var(Metric::IData &mdata, uint mId)