50 #ifndef ZOLTAN2_BASEMETRICVALUES_HPP
51 #define ZOLTAN2_BASEMETRICVALUES_HPP
55 #define UNKNOWN_METRICS_TYPE_NAME "UnknownMetricClass" // Unknown would be error
56 #define METRICS_UNSET_STRING "unset"
61 template <
typename scalar_t>
66 void resetValues(
int memCount ){
67 scalar_t *tmp =
new scalar_t [memCount];
68 memset(tmp, 0,
sizeof(scalar_t) * memCount);
69 values_ = arcp(tmp, 0, memCount,
true);
73 std::string metricName_;
78 ArrayRCP<scalar_t> values_;
83 scalar_t
getValue(
int enumIndex)
const {
return values_[enumIndex]; }
86 void setValue(
int enumIndex, scalar_t value) { values_[enumIndex] = value; }
97 metricName_(mname), values_() {
98 resetValues(memCount);
104 resetValues(memCount);
126 const std::string &
getName()
const {
return metricName_; }
129 void setName(std::string name) { metricName_ = name;}
142 return values_[metricIndex];
150 values_[metricIndex] = value;
156 const std::vector<std::string> & metricNames =
getMetrics();
157 size_t metricIndex = std::find(metricNames.begin(), metricNames.end(),
158 metric_name) - metricNames.begin();
183 template <
typename scalar_t>
190 template <
typename scalar_t>