Skip to content

Commit 67a7481

Browse files
author
Andrea Hornakova
committed
switched order of procedures in methods
1 parent ad70380 commit 67a7481

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

solverILP/include/disjoint-paths/disjointPathsMethods.hxx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,25 @@ namespace py = pybind11;
4343
namespace disjointPaths {
4444

4545

46+
template<class T=char>
47+
std::vector<std::string> split(
48+
std::string inputString, T delim) {
49+
size_t occurence = 0;
50+
size_t newOccurence = 0;
51+
std::vector<std::string> strings;
52+
while (newOccurence < inputString.size()) {
53+
newOccurence = std::min(inputString.find_first_of(delim, occurence),
54+
inputString.size());
55+
56+
std::string newString(inputString, occurence, newOccurence - occurence);
57+
strings.push_back(newString);
58+
newOccurence = newOccurence + 1;
59+
occurence = newOccurence;
60+
}
61+
62+
return strings;
63+
}
64+
4665

4766
template<class T=size_t>
4867
std::vector<std::vector<T>> readLines(std::string inputFileName, char delim) {
@@ -86,25 +105,6 @@ std::vector<std::vector<T>> readLines(std::string inputFileName, char delim) {
86105
}
87106

88107

89-
template<class T=char>
90-
std::vector<std::string> split(
91-
std::string inputString, T delim) {
92-
size_t occurence = 0;
93-
size_t newOccurence = 0;
94-
std::vector<std::string> strings;
95-
while (newOccurence < inputString.size()) {
96-
newOccurence = std::min(inputString.find_first_of(delim, occurence),
97-
inputString.size());
98-
99-
std::string newString(inputString, occurence, newOccurence - occurence);
100-
strings.push_back(newString);
101-
newOccurence = newOccurence + 1;
102-
occurence = newOccurence;
103-
}
104-
105-
return strings;
106-
}
107-
108108

109109
inline void writeOutputToFile(const std::vector<std::vector<size_t>>& paths,std::string outputFileName){
110110

0 commit comments

Comments
 (0)