Program Listing for File METISParser.hpp

Return to documentation for file (include/networkit/io/METISParser.hpp)

/*
 * METISParser.hpp
 *
 *  Created on: 27.11.2012
 *      Author: Christian Staudt
 */

#ifndef NETWORKIT_IO_METIS_PARSER_HPP_
#define NETWORKIT_IO_METIS_PARSER_HPP_

#include <fstream>
#include <string>
#include <tuple>
#include <vector>

#include <networkit/Globals.hpp>

namespace NetworKit {

class METISParser final {

    std::ifstream graphFile;

public:
    METISParser(std::string_view path);

    std::tuple<count, count, index, count> getHeader();

    bool hasNext();

    std::vector<node> getNext(count ignoreFirst = 0);

    std::vector<std::pair<node, double>> getNextWithWeights(count ignoreFirst = 0);
};
} /* namespace NetworKit */
#endif // NETWORKIT_IO_METIS_PARSER_HPP_