MCPcopy Create free account
hub / github.com/TheRealMJP/BakingLab / SortSpectrumSamples

Function SortSpectrumSamples

SampleFramework11/v1.02/Graphics/Spectrum.cpp:62–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void SortSpectrumSamples(float *lambda, float *vals, int n) {
63 std::vector<std::pair<float, float>> sortVec;
64 sortVec.reserve(n);
65 for (int i = 0; i < n; ++i)
66 sortVec.push_back(std::make_pair(lambda[i], vals[i]));
67 std::sort(sortVec.begin(), sortVec.end());
68 for (int i = 0; i < n; ++i) {
69 lambda[i] = sortVec[i].first;
70 vals[i] = sortVec[i].second;
71 }
72}
73
74float AverageSpectrumSamples(const float *lambda, const float *vals, int n,
75 float lambdaStart, float lambdaEnd) {

Callers 2

FromSampledMethod · 0.85
FromSampledMethod · 0.85

Calls 3

endMethod · 0.80
reserveMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected