MCPcopy Create free account
hub / github.com/LuxCoreRender/LuxCore / Distribution2D

Method Distribution2D

src/luxrays/utils/mc.cpp:394–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392BOOST_CLASS_EXPORT_IMPLEMENT(luxrays::Distribution2D)
393
394Distribution2D::Distribution2D(const float *data, u_int nu, u_int nv) {
395 pConditionalV.reserve(nv);
396 // Compute conditional sampling distribution for $\tilde{v}$
397 for (u_int v = 0; v < nv; ++v)
398 pConditionalV.push_back(new Distribution1D(data + v * nu, nu));
399 // Compute marginal sampling distribution $p[\tilde{v}]$
400 std::vector<float> marginalFunc;
401 marginalFunc.reserve(nv);
402 for (u_int v = 0; v < nv; ++v)
403 marginalFunc.push_back(pConditionalV[v]->Average());
404 pMarginal = new Distribution1D(&marginalFunc[0], nv);
405}
406
407Distribution2D::~Distribution2D() {
408 delete pMarginal;

Callers

nothing calls this directly

Calls 3

reserveMethod · 0.45
push_backMethod · 0.45
AverageMethod · 0.45

Tested by

no test coverage detected