49 #ifndef ZOLTAN2_IMBALANCEMETRICS_HPP
50 #define ZOLTAN2_IMBALANCEMETRICS_HPP
56 #define IMBALANCE_METRICS_TYPE_NAME "ImbalanceMetrics"
61 template <
typename scalar_t>
81 virtual void printLine(std::ostream &os)
const;
141 template <
typename scalar_t>
152 template <
typename scalar_t>
155 os << std::setw(20) <<
" ";
156 os << std::setw(11) <<
"min" << std::setw(11) <<
"max" << std::setw(11) <<
"avg";
157 os << std::setw(2) <<
" ";
158 os << std::setw(10) <<
"imbalance";
162 template <
typename scalar_t>
165 std::string label( this->getName() );
168 std::ostringstream oss;
171 oss << this->getName() <<
" (1)";
174 oss << this->getName() <<
" (2)";
177 oss << this->getName() <<
" (inf)";
180 oss << this->getName() <<
" (?)";
187 os << std::setw(20) << label;
188 os << std::setw(11) << std::setprecision(4)
189 << this->getMetricValue(
"global minimum");
190 os << std::setw(11) << std::setprecision(4)
191 << this->getMetricValue(
"global maximum");
192 os << std::setw(11) << std::setprecision(4)
193 << this->getMetricValue(
"global average");
195 os << std::setw(2) <<
" ";
196 os << std::setw(10) << std::setprecision(4)
197 << this->getMetricValue(
"maximum imbalance");
scalar_t getLocalSum() const
Get the sum on the local process.
void setLocalSum(scalar_t x)
Set the sum on the local process.
static std::string static_metricTypeName_
void setGlobalMin(scalar_t x)
Set the global minimum across parts.
virtual const std::string & getMetricType() const
Get the class type of the metric.
virtual const std::vector< std::string > & getMetrics() const
virtual void printLine(std::ostream &os) const
Print a standard line of data that fits under the header.
void setGlobalSum(scalar_t x)
Set the global sum.
scalar_t getAvgImbalance() const
Get the average of the part imbalances.
void setAvgImbalance(scalar_t x)
Set the average imbalance of all parts.
scalar_t getMetricValue(const std::string &metric_name) const
scalar_t getGlobalMin() const
Get the global minimum across all parts.
#define IMBALANCE_METRICS_TYPE_NAME
void setMetricValue(const std::string &metric_name, scalar_t value) const
scalar_t getGlobalMax() const
Get the global maximum across all parts.
static void printHeader(std::ostream &os)
Print a standard header.
static std::vector< std::string > static_metricNames_
void setGlobalMax(scalar_t x)
Set the global maximum across parts.
void setMaxImbalance(scalar_t x)
Set the imbalance of the worst imbalanced part. This is what we normally call the imbalance of a part...
void setNorm(multiCriteriaNorm normVal)
Set or reset the norm.
scalar_t getMaxImbalance() const
Get the imbalance of the most imbalanced part. This is what we normally call the imbalance of a parti...
multiCriteriaNorm getNorm()
Get the norm.
multiCriteriaNorm
Enumerator used in code for multicriteria norm choice.
ImbalanceMetrics()
Constructor.
Defines the GraphModel interface.
ImbalanceMetrics(std::string mname)
Constructor.
scalar_t getGlobalSum() const
Get the global sum for all parts.