Skip to content

Commit

Permalink
Scattering data is now saved with scientific precision.
Browse files Browse the repository at this point in the history
  • Loading branch information
vidanovic committed Oct 22, 2024
1 parent 8a896f7 commit 27e71f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if(NOT TARGET FileParse)
FetchContent_Declare(
FileParse
GIT_REPOSITORY https://github.com/LBNL-ETA/FileParse.git
GIT_TAG "Version_1.0"
GIT_TAG "main"
)

FetchContent_MakeAvailable(FileParse)
Expand Down
8 changes: 7 additions & 1 deletion src/bsdfdata/Serializers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,13 @@ namespace BSDFData
std::string serializeRow(const std::vector<double> & row)
{
std::ostringstream rowStream;
std::copy(row.begin(), row.end(), std::ostream_iterator<double>(rowStream, ", "));

// Transform each element into a formatted string and join them with ", "
std::transform(row.begin(), row.end(), std::ostream_iterator<std::string>(rowStream, ", "),
[](double value) {
return FileParse::formatDouble(value, 5, 1, 0.99);
});

return rowStream.str();
}
} // anonymous namespace
Expand Down

0 comments on commit 27e71f8

Please sign in to comment.