MCPcopy Create free account
hub / github.com/DamRsn/NeuralNote / loadCSVDataFile

Function loadCSVDataFile

Tests/test_utils.h:18–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16{
17template <typename T>
18static std::vector<T> loadCSVDataFile(std::ifstream& stream)
19{
20 std::vector<T> vec;
21
22 std::string line;
23 if (stream.is_open()) {
24 while (std::getline(stream, line))
25 vec.push_back(static_cast<T>(std::stod(line)));
26
27 stream.close();
28 }
29
30 return vec;
31}
32
33template <typename T>
34static std::vector<std::vector<T>> convert_1d_to_2d(std::vector<T> flattened_vec, int rows, int cols)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected