-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added some quality of life features: more timers and options for elli…
…ptic-single.
- Loading branch information
1 parent
fc18564
commit 8a79581
Showing
12 changed files
with
168 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "Helpers.hpp" | ||
|
||
namespace EllipticForest { | ||
|
||
std::string getCurrentDateTimeString() { | ||
std::time_t now = std::time(nullptr); | ||
std::tm timeinfo = *std::localtime(&now); | ||
|
||
std::ostringstream oss; | ||
oss << std::put_time(&timeinfo, "%Y%m%d%H%M%S"); | ||
return oss.str(); | ||
} | ||
|
||
void writeMapToCSV(const std::map<std::string, std::vector<double>>& data, const std::string& filename) { | ||
std::ofstream file(filename); | ||
if (!file.is_open()) { | ||
std::cerr << "Error opening file " << filename << std::endl; | ||
return; | ||
} | ||
|
||
for (const auto& entry : data) { | ||
file << entry.first; // Writing the key to the file | ||
const auto& vec = entry.second; | ||
for (const auto& value : vec) { | ||
file << "," << value; // Writing values in the vector | ||
} | ||
file << std::endl; // End of row | ||
} | ||
|
||
file.close(); | ||
} | ||
|
||
} // NAMESPACE : EllipticForest |
Oops, something went wrong.