Skip to content

Commit f6e9233

Browse files
committed
feat: Show bipartite start id in bipartite output
1 parent d1c0559 commit f6e9233

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/InfomapBase.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,13 +2046,15 @@ void InfomapBase::writeResult()
20462046

20472047
std::string InfomapBase::getOutputFileHeader()
20482048
{
2049+
std::string bipartiteInfo = io::Str() << "\n# bipartite start id " << m_network.bipartiteStartId();
20492050
return io::Str() << "# v" << INFOMAP_VERSION << "\n"
20502051
<< "# ./Infomap " << parsedString << "\n"
20512052
<< "# started at " << m_startDate << "\n"
20522053
<< "# completed in " << m_elapsedTime.getElapsedTimeInSec() << " s\n"
20532054
<< "# partitioned into " << maxTreeDepth() << " levels with " << numTopModules() << " top modules\n"
20542055
<< "# codelength " << codelength() << " bits\n"
2055-
<< "# relative codelength savings " << getRelativeCodelengthSavings() * 100 << "%";
2056+
<< "# relative codelength savings " << getRelativeCodelengthSavings() * 100 << "%" <<
2057+
(m_network.isBipartite() ? bipartiteInfo : "");
20562058
}
20572059

20582060
std::string InfomapBase::writeTree(std::string filename, bool states)
@@ -2083,7 +2085,7 @@ std::string InfomapBase::writeClu(std::string filename, bool states, int moduleI
20832085
SafeOutFile outFile(outputFilename);
20842086
outFile << std::setprecision(9);
20852087
outFile << getOutputFileHeader() << "\n";
2086-
outFile << "# module level: " << moduleIndexLevel << "\n";
2088+
outFile << "# module level " << moduleIndexLevel << "\n";
20872089
outFile << std::resetiosflags(std::ios::floatfield) << std::setprecision(6);
20882090
if (states) {
20892091
outFile << "# state_id module flow node_id";

0 commit comments

Comments
 (0)