/* * * Copyright (c) 1994 * Hewlett-Packard Company * */ #ifndef STATISTICAL_ELEMENT_H #define STATISTICAL_ELEMENT_H class StatisticalElement { protected: int value; public: static double compCount; static double moveCount; StatisticalElement() {} StatisticalElement(StatisticalElement& x) : value(x.value) { moveCount += 1.; } int operator-(StatisticalElement& x) { compCount += 1.; return value - x.value; } int operator<(StatisticalElement& x) { return *this - x < 0; } int operator>(StatisticalElement& x) { return *this - x > 0; } void operator=(int x) { value = x; } void operator=(StatisticalElement& x) { *this = x.value; moveCount += 1.; } }; double StatisticalElement::compCount = 0; double StatisticalElement::moveCount = 0; #endif