Added keyformatter for VariableIndex::print()
parent
8ee0342f7a
commit
a95ade1f88
|
@ -30,11 +30,11 @@ bool VariableIndex::equals(const VariableIndex& other, double tol) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void VariableIndex::print(const string& str) const {
|
void VariableIndex::print(const string& str, const KeyFormatter& keyFormatter) const {
|
||||||
cout << str;
|
cout << str;
|
||||||
cout << "nEntries = " << nEntries() << ", nFactors = " << nFactors() << "\n";
|
cout << "nEntries = " << nEntries() << ", nFactors = " << nFactors() << "\n";
|
||||||
BOOST_FOREACH(KeyMap::value_type key_factors, index_) {
|
BOOST_FOREACH(KeyMap::value_type key_factors, index_) {
|
||||||
cout << "var " << key_factors.first << ":";
|
cout << "var " << keyFormatter(key_factors.first) << ":";
|
||||||
BOOST_FOREACH(const size_t factor, key_factors.second)
|
BOOST_FOREACH(const size_t factor, key_factors.second)
|
||||||
cout << " " << factor;
|
cout << " " << factor;
|
||||||
cout << "\n";
|
cout << "\n";
|
||||||
|
|
|
@ -106,7 +106,8 @@ public:
|
||||||
bool equals(const VariableIndex& other, double tol=0.0) const;
|
bool equals(const VariableIndex& other, double tol=0.0) const;
|
||||||
|
|
||||||
/** Print the variable index (for unit tests and debugging). */
|
/** Print the variable index (for unit tests and debugging). */
|
||||||
void print(const std::string& str = "VariableIndex: ") const;
|
void print(const std::string& str = "VariableIndex: ",
|
||||||
|
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output dual hypergraph to Metis file format for use with hmetis
|
* Output dual hypergraph to Metis file format for use with hmetis
|
||||||
|
|
Loading…
Reference in New Issue