generate and test different data

This commit is contained in:
CDaut 2024-06-08 23:37:20 +02:00
parent 8350b03c96
commit c7145cbf8b
Signed by: clara
GPG key ID: 223391B52FAD4463
10 changed files with 61 additions and 31 deletions

2
.gitignore vendored
View file

@ -183,4 +183,4 @@ _deps
# Blender files
*.blend
*.blend1
*.blend1!/utk_experiments/utk/cmake-build-debug/

2
.idea/.name generated
View file

@ -1 +1 @@
psa
utk_tests

View file

@ -1,19 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C>
<option name="INDENT_NAMESPACE_MEMBERS" value="2" />
<option name="INDENT_C_STRUCT_MEMBERS" value="2" />
<option name="INDENT_CLASS_MEMBERS" value="2" />
<option name="INDENT_INSIDE_CODE_BLOCK" value="2" />
</Objective-C>
<clangFormatSettings>
<option name="ENABLED" value="true" />
</clangFormatSettings>
<codeStyleSettings language="ObjectiveC">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>

7
.idea/misc.xml generated
View file

@ -3,7 +3,12 @@
<component name="CMakePythonSetting">
<option name="pythonIntegrationState" value="YES" />
</component>
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$/utk_experiments/psa">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$/utk_experiments">
<contentRoot DIR="$PROJECT_DIR$" />
</component>
<component name="CidrRootsConfiguration">
<excludeRoots>
<file path="$PROJECT_DIR$/utk_experiments/utk/cmake-build-debug" />
</excludeRoots>
</component>
</project>

3
.idea/vcs.xml generated
View file

@ -4,8 +4,5 @@
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/utk_experiments/psa" vcs="Git" />
<mapping directory="$PROJECT_DIR$/utk_experiments/utk" vcs="Git" />
<mapping directory="$PROJECT_DIR$/utk_experiments/utk/cmake-build-debug/_deps/cli11-src" vcs="Git" />
<mapping directory="$PROJECT_DIR$/utk_experiments/utk/cmake-build-debug/_deps/semidiscrete_ot_2d-src" vcs="Git" />
<mapping directory="$PROJECT_DIR$/utk_experiments/utk/cmake-build-debug/_deps/spdlog-src" vcs="Git" />
</component>
</project>

Binary file not shown.

Binary file not shown.

View file

@ -1,4 +1,5 @@
#include "utk/metrics/PCF.hpp"
#include "utk/metrics/RDF_Heck.hpp"
#include <utk/metrics/RadialSpectrum.hpp>
#include <utk/samplers/SamplerStep.hpp>
#include <utk/utils/Pointset.hpp>
@ -57,6 +58,28 @@ void writeRadspecToFile(const std::string &filename,
}
}
template <typename T>
void writeRDFtoFile(const std::string &filename,
std::pair<std::vector<T>, std::vector<int32_t>> radspec) {
std::ofstream file;
file.open(filename);
auto xs = radspec.first;
auto ys = radspec.second;
if (xs.size() != ys.size()) {
std::cerr << "Dimensions of radial spactrum are unequal: xDim: "
<< xs.size() << " yDim: " << ys.size() << std::endl;
std::terminate();
}
for (int i = 0; i < xs.size(); ++i) {
file << std::setprecision(std::numeric_limits<long double>::digits10 + 2)
<< std::fixed;
file << xs[i] << ", " << ys[i] << std::endl;
}
}
int main() {
// load Points from file and generate metrics
@ -75,10 +98,10 @@ int main() {
for (float i = 0.015625f; i <= 0.5f; i += 0.015625f) {
// PCF
std::cout << "Calculating PCF with " << NBINS << " bins for max radius " << i << "" << std::endl;
auto pcf = utk::PCF{true, 0.01, i, NBINS, 0.001}.compute(pointView);
std::cout << "Calculating RDF with " << NBINS << " bins for max radius " << i << "" << std::endl;
auto rdf = utk::RDF{true, NBINS, i}.compute(pointView);
writePCFToFile("pcffiles/pcf_" + std::to_string(i) + ".txt", pcf);
writeRDFtoFile("rdffiles/rdf_" + std::to_string(i) + ".txt", rdf);
}
// FFT based spectrum

File diff suppressed because one or more lines are too long

@ -1 +1 @@
Subproject commit a12c408ddac03425444c857a725572bfe6fa4837
Subproject commit 3a248e347abe6c377a0e87a9434fcec2782a6545