generate and test different data
This commit is contained in:
parent
8350b03c96
commit
c7145cbf8b
10 changed files with 61 additions and 31 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue