Revision 0fb04b649d8638b89b63ec60d63f6327b9b487e5 authored by Max Göttlicher on 16 August 2023, 15:13:47 UTC, committed by Max Göttlicher on 16 August 2023, 15:16:03 UTC
1 parent f7f376c
converter.cpp
//
// Created by max on 31.08.22.
//
#include "graphio.hpp"
int main(int argc, const char** argv) {
if (argc != 2) {
throw std::runtime_error("expected file name");
}
std::string filename = argv[1];
namespace fs = std::filesystem;
fmt::print("opening {}\n", fs::absolute(filename).string());
pds::PowerGrid graph;
if (filename.ends_with(".graph")) {
graph = pds::readEdgeList(filename);
} else if (filename.ends_with(".ptxt")) {
graph = pds::readPtxt(filename);
} else {
throw std::runtime_error("unsupported file: " + filename);
}
fmt::print("graph n={}, m={}\n", graph.numVertices(), graph.numEdges());
}

Computing file changes ...