Zoltan2
Public Member Functions | List of all members
Zoltan2::EvaluatePartition< Adapter > Class Template Reference

A class that computes and returns quality metrics. More...

#include <Zoltan2_EvaluatePartition.hpp>

Public Member Functions

 EvaluatePartition (const Adapter *ia, ParameterList *p, const PartitioningSolution< Adapter > *soln, const RCP< const GraphModel< typename Adapter::base_adapter_t > > &graphModel=Teuchos::null)
 Constructor where communicator is Teuchos default. More...
 
 EvaluatePartition (const Adapter *ia, ParameterList *p, const RCP< const Comm< int > > &problemComm, const PartitioningSolution< Adapter > *soln, const RCP< const GraphModel< typename Adapter::base_adapter_t > > &graphModel=Teuchos::null)
 Constructor where Teuchos communicator is specified. More...
 
base_metric_array_type getAllMetrics () const
 Return the full metric list which will be mixed types. More...
 
std::vector< std::string > getMetricTypes () const
 
ArrayView< RCP< base_metric_type > > getAllMetricsOfType (std::string metricType) const
 Return the metric list for types matching the given metric type. More...
 
scalar_t getObjectCountImbalance () const
 Return the object count imbalance. More...
 
scalar_t getNormedImbalance () const
 Return the object normed weight imbalance. Normed imbalance is only valid if there is at least 2 elements - the second one is the normed imbalance. If we have weights (which start at the second element) the spec is to have this return that element. More...
 
scalar_t getWeightImbalance (int weightIndex) const
 Return the imbalance for the requested weight. More...
 
scalar_t getMaxEdgeCut () const
 Return the max cut for the requested weight. More...
 
scalar_t getMaxWeightEdgeCut (int weightIndex) const
 getMaxWeightEdgeCuts weighted for the specified index More...
 
scalar_t getTotalEdgeCut () const
 getTotalEdgeCut More...
 
scalar_t getTotalWeightEdgeCut (int weightIndex) const
 getTotalWeightEdgeCut weighted for the specified index More...
 
void printMetrics (std::ostream &os, bool bIncludeUnusedTypes=true) const
 Print all the metrics based on the metric object type. More...
 
void printMetrics (std::ostream &os, std::string metricType) const
 Print all metrics of type metricType based on the metric object type. More...
 

Detailed Description

template<typename Adapter>
class Zoltan2::EvaluatePartition< Adapter >

A class that computes and returns quality metrics.

Todo:

For some problems it will be necessary to build the Model again in order to compute metrics. For now we don't have any problems like that.

write a unit test for this class

Examples:
rcb_C.cpp.

Definition at line 110 of file Zoltan2_EvaluatePartition.hpp.

Constructor & Destructor Documentation

◆ EvaluatePartition() [1/2]

template<typename Adapter >
Zoltan2::EvaluatePartition< Adapter >::EvaluatePartition ( const Adapter *  ia,
ParameterList *  p,
const PartitioningSolution< Adapter > *  soln,
const RCP< const GraphModel< typename Adapter::base_adapter_t > > &  graphModel = Teuchos::null 
)
inline

Constructor where communicator is Teuchos default.

Parameters
iathe problem input adapter
pthe parameter list
solnthe solution
graphModelthe graph model The constructor does global communication to compute the metrics. The rest of the methods are local.

Definition at line 147 of file Zoltan2_EvaluatePartition.hpp.

◆ EvaluatePartition() [2/2]

template<typename Adapter >
Zoltan2::EvaluatePartition< Adapter >::EvaluatePartition ( const Adapter *  ia,
ParameterList *  p,
const RCP< const Comm< int > > &  problemComm,
const PartitioningSolution< Adapter > *  soln,
const RCP< const GraphModel< typename Adapter::base_adapter_t > > &  graphModel = Teuchos::null 
)
inline

Constructor where Teuchos communicator is specified.

Parameters
iathe problem input adapter
pthe parameter list
problemCommthe problem communicator
solnthe solution
graphModelthe graph model The constructor does global communication to compute the metrics. The rest of the methods are local.

Definition at line 169 of file Zoltan2_EvaluatePartition.hpp.

Member Function Documentation

◆ getAllMetrics()

template<typename Adapter >
base_metric_array_type Zoltan2::EvaluatePartition< Adapter >::getAllMetrics ( ) const
inline

Return the full metric list which will be mixed types.

Definition at line 210 of file Zoltan2_EvaluatePartition.hpp.

◆ getMetricTypes()

template<typename Adapter >
std::vector<std::string> Zoltan2::EvaluatePartition< Adapter >::getMetricTypes ( ) const
inline

the unique class names which are actually used

Definition at line 216 of file Zoltan2_EvaluatePartition.hpp.

◆ getAllMetricsOfType()

template<typename Adapter >
ArrayView<RCP<base_metric_type> > Zoltan2::EvaluatePartition< Adapter >::getAllMetricsOfType ( std::string  metricType) const
inline

Return the metric list for types matching the given metric type.

Definition at line 239 of file Zoltan2_EvaluatePartition.hpp.

◆ getObjectCountImbalance()

template<typename Adapter >
scalar_t Zoltan2::EvaluatePartition< Adapter >::getObjectCountImbalance ( ) const
inline

Return the object count imbalance.

Definition at line 262 of file Zoltan2_EvaluatePartition.hpp.

◆ getNormedImbalance()

template<typename Adapter >
scalar_t Zoltan2::EvaluatePartition< Adapter >::getNormedImbalance ( ) const
inline

Return the object normed weight imbalance. Normed imbalance is only valid if there is at least 2 elements - the second one is the normed imbalance. If we have weights (which start at the second element) the spec is to have this return that element.

Definition at line 279 of file Zoltan2_EvaluatePartition.hpp.

◆ getWeightImbalance()

template<typename Adapter >
scalar_t Zoltan2::EvaluatePartition< Adapter >::getWeightImbalance ( int  weightIndex) const
inline

Return the imbalance for the requested weight.

Definition at line 297 of file Zoltan2_EvaluatePartition.hpp.

◆ getMaxEdgeCut()

template<typename Adapter >
scalar_t Zoltan2::EvaluatePartition< Adapter >::getMaxEdgeCut ( ) const
inline

Return the max cut for the requested weight.

Definition at line 332 of file Zoltan2_EvaluatePartition.hpp.

◆ getMaxWeightEdgeCut()

template<typename Adapter >
scalar_t Zoltan2::EvaluatePartition< Adapter >::getMaxWeightEdgeCut ( int  weightIndex) const
inline

getMaxWeightEdgeCuts weighted for the specified index

Definition at line 345 of file Zoltan2_EvaluatePartition.hpp.

◆ getTotalEdgeCut()

template<typename Adapter >
scalar_t Zoltan2::EvaluatePartition< Adapter >::getTotalEdgeCut ( ) const
inline

getTotalEdgeCut

Definition at line 371 of file Zoltan2_EvaluatePartition.hpp.

◆ getTotalWeightEdgeCut()

template<typename Adapter >
scalar_t Zoltan2::EvaluatePartition< Adapter >::getTotalWeightEdgeCut ( int  weightIndex) const
inline

getTotalWeightEdgeCut weighted for the specified index

Definition at line 384 of file Zoltan2_EvaluatePartition.hpp.

◆ printMetrics() [1/2]

template<typename Adapter >
void Zoltan2::EvaluatePartition< Adapter >::printMetrics ( std::ostream &  os,
bool  bIncludeUnusedTypes = true 
) const
inline

Print all the metrics based on the metric object type.

Definition at line 410 of file Zoltan2_EvaluatePartition.hpp.

◆ printMetrics() [2/2]

template<typename Adapter >
void Zoltan2::EvaluatePartition< Adapter >::printMetrics ( std::ostream &  os,
std::string  metricType 
) const
inline

Print all metrics of type metricType based on the metric object type.

Definition at line 422 of file Zoltan2_EvaluatePartition.hpp.


The documentation for this class was generated from the following file: