MCPcopy Create free account
hub / github.com/OpenPathGuidingLibrary/openpgl / addSample

Method addSample

openpgl/data/SampleStatistics.h:29–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 }
28
29 inline void addSample(const Point3 sample)
30 {
31 numSamples++;
32 float incWeight = 1.f / float(numSamples);
33 OPENPGL_ASSERT(numSamples > 0.0f);
34 OPENPGL_ASSERT(embree::isvalid(incWeight));
35 OPENPGL_ASSERT(incWeight >= 0.0f);
36
37 const Point3 oldMean = mean;
38 mean += (sample - oldMean) * incWeight;
39 variance += (((sample - oldMean) * (sample - mean)) - variance) * incWeight;
40 sampleBounds.extend(sample);
41 OPENPGL_ASSERT(isValid());
42 }
43
44 inline Point3 getMean() const
45 {

Callers

nothing calls this directly

Calls 2

isValidFunction · 0.70
isvalidFunction · 0.50

Tested by

no test coverage detected