commit 48bfe391ee541dbdf21c603d7d589d6cbbc43cb3
parent 7860dd659c29871c143e6a0beb5a476027bd73aa
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 16 Mar 2017 14:55:49 +0100
Implement the registration of the sampled radiative paths
Diffstat:
13 files changed, 217 insertions(+), 31 deletions(-)
diff --git a/src/ssol.h b/src/ssol.h
@@ -298,6 +298,16 @@ struct ssol_instantiated_shaded_shape {
static const struct ssol_instantiated_shaded_shape
SSOL_INSTANTIATED_SHADED_SHAPE_NULL = SSOL_INSTANTIATED_SHADED_SHAPE_NULL__;
+struct ssol_path {
+ /* Internal data */
+ const void* vertices__;
+};
+
+struct ssol_path_vertex {
+ double pos[3]; /* Position */
+ double weight; /* Monte-Carlo weight */
+};
+
struct ssol_mc_result {
double E; /* Expectation */
double V; /* Variance */
@@ -969,6 +979,31 @@ ssol_estimator_get_sampled_area
double* area);
/*******************************************************************************
+ * Tracked paths
+ ******************************************************************************/
+SSOL_API res_T
+ssol_estimator_get_tracked_paths_count
+ (const struct ssol_estimator* estimator,
+ size_t* npaths);
+
+SSOL_API res_T
+ssol_estimator_get_tracked_path
+ (const struct ssol_estimator* estimator,
+ const size_t ipath,
+ struct ssol_path* path);
+
+SSOL_API res_T
+ssol_path_get_vertices_count
+ (const struct ssol_path* path,
+ size_t* nvertices);
+
+SSOL_API res_T
+ssol_path_get_vertex
+ (const struct ssol_path* path,
+ const size_t ivertex,
+ struct ssol_path_vertex* vertex);
+
+/*******************************************************************************
* Per receiver MC estimations
******************************************************************************/
SSOL_API res_T
@@ -998,6 +1033,7 @@ ssol_solve
(struct ssol_scene* scn,
struct ssp_rng* rng,
const size_t realisations_count,
+ const int track_paths, /* Define if the radiative paths are recorded */
FILE* output, /* May be NULL <=> does not ouput ssol_receiver_data */
struct ssol_estimator** estimator);
diff --git a/src/ssol_estimator.c b/src/ssol_estimator.c
@@ -20,9 +20,10 @@
#include "ssol_device_c.h"
#include "ssol_instance_c.h"
-#include <rsys/rsys.h>
+#include <rsys/double3.h>
#include <rsys/mem_allocator.h>
#include <rsys/ref_count.h>
+#include <rsys/rsys.h>
#include <math.h>
@@ -79,6 +80,7 @@ estimator_release(ref_T* ref)
dev = estimator->dev;
htable_receiver_release(&estimator->mc_receivers);
htable_sampled_release(&estimator->mc_sampled);
+ darray_path_release(&estimator->paths);
ASSERT(dev && dev->allocator);
MEM_RM(dev->allocator, estimator);
SSOL(device_ref_put(dev));
@@ -202,6 +204,54 @@ ssol_estimator_get_sampled_area
return RES_OK;
}
+res_T
+ssol_estimator_get_tracked_paths_count
+ (const struct ssol_estimator* estimator, size_t* npaths)
+{
+ if(!estimator || !npaths) return RES_BAD_ARG;
+ *npaths = darray_path_size_get(&estimator->paths);
+ return RES_OK;
+}
+
+res_T
+ssol_estimator_get_tracked_path
+ (const struct ssol_estimator* estimator,
+ const size_t ipath,
+ struct ssol_path* path)
+{
+ if(!estimator || ipath >= darray_path_size_get(&estimator->paths) || !path)
+ return RES_BAD_ARG;
+ path->vertices__ = darray_path_cdata_get(&estimator->paths) + ipath;
+ return RES_OK;
+}
+
+res_T
+ssol_path_get_vertices_count(const struct ssol_path* path, size_t* nvertices)
+{
+ const struct darray_path_vertex* vertices;
+ if(!path || !nvertices) return RES_BAD_ARG;
+ vertices = path->vertices__;
+ *nvertices = darray_path_vertex_size_get(vertices);
+ return RES_OK;
+}
+
+res_T
+ssol_path_get_vertex
+ (const struct ssol_path* path,
+ const size_t ivertex,
+ struct ssol_path_vertex* vertex)
+{
+ const struct darray_path_vertex* vertices;
+ const struct path_vertex* vert;
+ if(!path || !vertex) return RES_BAD_ARG;
+ vertices = path->vertices__;
+ if(ivertex >= darray_path_vertex_size_get(vertices)) return RES_BAD_ARG;
+ vert = darray_path_vertex_cdata_get(vertices) + ivertex;
+ d3_set(vertex->pos, vert->pos);
+ vertex->weight = vert->weight;
+ return RES_OK;
+}
+
/*******************************************************************************
* Local function
******************************************************************************/
@@ -227,6 +277,7 @@ estimator_create
htable_receiver_init(dev->allocator, &estimator->mc_receivers);
htable_sampled_init(dev->allocator, &estimator->mc_sampled);
+ darray_path_init(dev->allocator, &estimator->paths);
SSOL(device_ref_get(dev));
estimator->dev = dev;
ref_init(&estimator->ref);
diff --git a/src/ssol_estimator_c.h b/src/ssol_estimator_c.h
@@ -377,6 +377,26 @@ error:
#include <rsys/hash_table.h>
/*******************************************************************************
+ * Radiative path
+ ******************************************************************************/
+struct path_vertex {
+ double pos[3];
+ double weight;
+};
+
+#define DARRAY_NAME path_vertex
+#define DARRAY_DATA struct path_vertex
+#include <rsys/dynamic_array.h>
+
+#define DARRAY_NAME path
+#define DARRAY_DATA struct darray_path_vertex
+#define DARRAY_FUNCTOR_INIT darray_path_vertex_init
+#define DARRAY_FUNCTOR_RELEASE darray_path_vertex_release
+#define DARRAY_FUNCTOR_COPY darray_path_vertex_copy
+#define DARRAY_FUNCTOR_COPY_AND_RELEASE darray_path_vertex_copy_and_release
+#include <rsys/dynamic_array.h>
+
+/*******************************************************************************
* Estimator data structure
******************************************************************************/
struct ssol_estimator {
@@ -391,6 +411,8 @@ struct ssol_estimator {
struct htable_receiver mc_receivers; /* Per receiver MC */
struct htable_sampled mc_sampled; /* Per sampled instance MC */
+ struct darray_path paths; /* Tracked paths */
+
/* Overall area of the sampled instances. Actually this is not the area that
* is effectively sampled since an instance may be sampled through a proxy
* geometry */
diff --git a/src/ssol_solver.c b/src/ssol_solver.c
@@ -55,6 +55,7 @@ struct thread_context {
struct mc_data cos_loss;
struct htable_receiver mc_rcvs;
struct htable_sampled mc_samps;
+ struct darray_path paths; /* paths */
};
static void
@@ -65,6 +66,7 @@ thread_context_release(struct thread_context* ctx)
if(ctx->bsdf) SSF(bsdf_ref_put(ctx->bsdf));
htable_receiver_release(&ctx->mc_rcvs);
htable_sampled_release(&ctx->mc_samps);
+ darray_path_release(&ctx->paths);
}
static res_T
@@ -76,6 +78,7 @@ thread_context_init(struct mem_allocator* allocator, struct thread_context* ctx)
memset(ctx, 0, sizeof(ctx[0]));
htable_receiver_init(allocator, &ctx->mc_rcvs);
htable_sampled_init(allocator, &ctx->mc_samps);
+ darray_path_init(allocator, &ctx->paths);
res = ssf_bsdf_create(allocator, &ctx->bsdf);
if(res != RES_OK) goto error;
@@ -104,6 +107,8 @@ thread_context_copy
if(res != RES_OK) return res;
res = htable_sampled_copy(&dst->mc_samps, &src->mc_samps);
if(res != RES_OK) return res;
+ res = darray_path_copy(&dst->paths, &src->paths);
+ if(res != RES_OK) return res;
return RES_OK;
}
@@ -114,6 +119,7 @@ thread_context_clear(struct thread_context* ctx)
if(ctx->rng) SSP(rng_ref_put(ctx->rng));
htable_receiver_clear(&ctx->mc_rcvs);
htable_sampled_clear(&ctx->mc_samps);
+ darray_path_clear(&ctx->paths);
}
static res_T
@@ -447,6 +453,37 @@ check_scene(const struct ssol_scene* scene, const char* caller)
return RES_OK;
}
+static INLINE res_T
+path_add_vertex
+ (struct darray_path_vertex* path,
+ const double pos[3],
+ const double weight)
+{
+ struct path_vertex vertex;
+ ASSERT(path && pos && weight >= 0);
+ d3_set(vertex.pos, pos);
+ vertex.weight = weight;
+ return darray_path_vertex_push_back(path, &vertex);
+}
+
+static INLINE res_T
+path_register_and_clear
+ (struct darray_path* paths,
+ struct darray_path_vertex* path)
+{
+ struct darray_path_vertex* dst;
+ size_t ipath;
+ res_T res = RES_OK;
+ ASSERT(paths && path);
+
+ ipath = darray_path_size_get(paths);
+ res = darray_path_resize(paths, ipath + 1);
+ if(res != RES_OK) return res;
+
+ dst = darray_path_data_get(paths) + ipath;
+ return darray_path_vertex_copy_and_clear(dst, path);
+}
+
static res_T
accum_mc_receivers_1side
(struct mc_receiver_1side* dst,
@@ -620,7 +657,7 @@ update_mc
res = mc_shape_1side_get_mc_primitive(mc_shape1, pt->prim.prim_id, &mc_prim1);
if(res != RES_OK) goto error;
- #define ACCUM_WEIGHT(Name, W) { \
+ #define ACCUM_WEIGHT(Name, W) { \
mc_prim1->Name.weight += (W); \
mc_prim1->Name.sqr_weight += (W)*(W); \
} (void)0
@@ -647,8 +684,10 @@ trace_radiative_path
struct s3d_scene_view* view_rt,
struct ranst_sun_dir* ran_sun_dir,
struct ranst_sun_wl* ran_sun_wl,
+ const int track_paths,
FILE* output) /* May be NULL */
{
+ struct darray_path_vertex path;
struct s3d_hit hit = S3D_HIT_NULL;
struct point pt;
float org[3], dir[3], range[2] = { 0, FLT_MAX };
@@ -657,11 +696,20 @@ trace_radiative_path
res_T res = RES_OK;
ASSERT(thread_ctx && scn && view_samp && view_rt && ran_sun_dir && ran_sun_wl);
+ if(track_paths) {
+ darray_path_vertex_init(scn->dev->allocator, &path);
+ }
+
/* Find a new starting point of the radiative random walk */
res = point_init(&pt, sampled_area_proxy, scn, &thread_ctx->mc_samps,
view_samp, view_rt, ran_sun_dir, ran_sun_wl, thread_ctx->rng, &is_lit);
if(res != RES_OK) goto error;
+ if(track_paths) {
+ res = path_add_vertex(&path, pt.pos, pt.weight);
+ if(res != RES_OK) goto error;
+ }
+
if(!is_lit) { /* The starting point is not lit */
pt.mc_samp->shadowed.weight += pt.weight;
pt.mc_samp->shadowed.sqr_weight += pt.weight;
@@ -734,6 +782,11 @@ trace_radiative_path
/* Update the point */
point_update_from_hit(&pt, scn, org, dir, &hit, &ray_data);
+
+ if(track_paths) {
+ res = path_add_vertex(&path, pt.pos, pt.weight);
+ if(res != RES_OK) goto error;
+ }
}
if(!hit_a_receiver) {
thread_ctx->missing.weight += pt.weight;
@@ -741,7 +794,13 @@ trace_radiative_path
}
}
+ if(track_paths) {
+ res = path_register_and_clear(&thread_ctx->paths, &path);
+ if(res != RES_OK) goto error;
+ }
+
exit:
+ if(track_paths) darray_path_vertex_release(&path);
return res;
error:
goto exit;
@@ -755,6 +814,7 @@ ssol_solve
(struct ssol_scene* scn,
struct ssp_rng* rng_state,
const size_t realisations_count,
+ const int track_paths,
FILE* output,
struct ssol_estimator** out_estimator)
{
@@ -832,7 +892,7 @@ ssol_solve
/* Execute a MC experiment */
res_local = trace_radiative_path((size_t)i, sampled_area_proxy, thread_ctx,
- scn, view_samp, view_rt, ran_sun_dir, ran_sun_wl, output);
+ scn, view_samp, view_rt, ran_sun_dir, ran_sun_wl, track_paths, output);
if(res_local != RES_OK) {
ATOMIC_SET(&res, res_local);
continue;
@@ -901,6 +961,23 @@ ssol_solve
}
}
+ /* Merge per thread tracked paths */
+ if(track_paths) {
+ FOR_EACH(i, 0, nthreads) {
+ struct thread_context* thread_ctx;
+ size_t ipath, npaths;
+
+ thread_ctx = darray_thread_ctx_data_get(&thread_ctxs) + i;
+ npaths = darray_path_size_get(&thread_ctx->paths);
+ FOR_EACH(ipath, 0, npaths) {
+ struct darray_path_vertex* path;
+ path = darray_path_data_get(&thread_ctx->paths) + ipath;
+ res = path_register_and_clear(&estimator->paths, path);
+ if(res != RES_OK) goto error;
+ }
+ }
+ }
+
estimator->realisation_count = realisations_count;
estimator->sampled_area = sampled_area;
diff --git a/src/test_ssol_by_receiver_integration.c b/src/test_ssol_by_receiver_integration.c
@@ -134,19 +134,19 @@ main(int argc, char** argv)
#define S_DNI_cos (4 * 1000 * cos(PI / 4))
#define GET_MC_RCV ssol_estimator_get_mc_receiver
#define GET_MC_SAMP_X_RCV ssol_estimator_get_mc_sampled_x_receiver
- CHECK(ssol_solve(scene, rng, N__, NULL, &estimator1), RES_OK);
+ CHECK(ssol_solve(scene, rng, N__, 0, NULL, &estimator1), RES_OK);
CHECK(GET_MC_RCV(estimator1, target, SSOL_FRONT, &mc_rcv), RES_OK);
printf("Ir(target) = %g +/- %g\n",
mc_rcv.integrated_irradiance.E, mc_rcv.integrated_irradiance.SE);
CHECK(ssol_instance_set_receiver(heliostat, SSOL_FRONT, 0), RES_OK);
CHECK(eq_eps(mc_rcv.integrated_irradiance.E, S_DNI_cos, S_DNI_cos * 2e-1), 1);
- CHECK(ssol_solve(scene, rng, 8 * N__, NULL, &estimator2), RES_OK);
+ CHECK(ssol_solve(scene, rng, 8 * N__, 0, NULL, &estimator2), RES_OK);
CHECK(GET_MC_RCV(estimator2, target, SSOL_FRONT, &mc_rcv), RES_OK);
printf("Ir(target) = %g +/- %g\n",
mc_rcv.integrated_irradiance.E, mc_rcv.integrated_irradiance.SE);
CHECK(eq_eps(mc_rcv.integrated_irradiance.E, S_DNI_cos, S_DNI_cos * 5e-2), 1);
CHECK(ssol_estimator_ref_put(estimator1), RES_OK);
- CHECK(ssol_solve(scene, rng, 3 * N__, NULL, &estimator1), RES_OK);
+ CHECK(ssol_solve(scene, rng, 3 * N__, 0, NULL, &estimator1), RES_OK);
CHECK(GET_MC_RCV(estimator1, target, SSOL_FRONT, &mc_rcv), RES_OK);
printf("Ir(target) = %g +/- %g\n",
mc_rcv.integrated_irradiance.E, mc_rcv.integrated_irradiance.SE);
diff --git a/src/test_ssol_solver1.c b/src/test_ssol_solver1.c
@@ -120,14 +120,14 @@ main(int argc, char** argv)
CHECK(ssol_scene_create(dev, &scene), RES_OK);
CHECK(ssol_scene_attach_sun(scene, sun), RES_OK);
- CHECK(ssol_solve(NULL, rng, 10, NULL, &estimator), RES_BAD_ARG);
- CHECK(ssol_solve(scene, NULL, 10, NULL, &estimator), RES_BAD_ARG);
- CHECK(ssol_solve(scene, rng, 0, NULL, &estimator), RES_BAD_ARG);
- CHECK(ssol_solve(scene, rng, 10, NULL, &estimator), RES_BAD_ARG);
- CHECK(ssol_solve(scene, rng, 10, NULL, NULL), RES_BAD_ARG);
+ CHECK(ssol_solve(NULL, rng, 10, 0, NULL, &estimator), RES_BAD_ARG);
+ CHECK(ssol_solve(scene, NULL, 10, 0, NULL, &estimator), RES_BAD_ARG);
+ CHECK(ssol_solve(scene, rng, 0, 0, NULL, &estimator), RES_BAD_ARG);
+ CHECK(ssol_solve(scene, rng, 10, 0, NULL, &estimator), RES_BAD_ARG);
+ CHECK(ssol_solve(scene, rng, 10, 0, NULL, NULL), RES_BAD_ARG);
/* No geometry */
- CHECK(ssol_solve(scene, rng, 10, NULL, &estimator), RES_BAD_ARG);
+ CHECK(ssol_solve(scene, rng, 10, 0, NULL, &estimator), RES_BAD_ARG);
/* Create scene content */
CHECK(ssol_shape_create_mesh(dev, &dummy), RES_OK);
@@ -162,7 +162,7 @@ main(int argc, char** argv)
CHECK(ssol_instance_set_receiver(target, SSOL_FRONT, 0), RES_OK);
CHECK(ssol_scene_attach_instance(scene, target), RES_OK);
- CHECK(ssol_solve(scene, rng, 1, NULL, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, 1, 0, NULL, &estimator), RES_OK);
CHECK(ssol_estimator_get_sampled_area(NULL, NULL), RES_BAD_ARG);
CHECK(ssol_estimator_get_sampled_area(estimator, NULL), RES_BAD_ARG);
@@ -196,7 +196,7 @@ main(int argc, char** argv)
CHECK(ssol_instance_sample(target, 0), RES_OK);
CHECK(ssol_instance_sample(secondary, 0), RES_OK);
CHECK(ssol_instance_sample(heliostat, 0), RES_OK);
- CHECK(ssol_solve(scene, rng, 10, NULL, &estimator), RES_BAD_ARG);
+ CHECK(ssol_solve(scene, rng, 10, 0, NULL, &estimator), RES_BAD_ARG);
CHECK(ssol_instance_sample(target, 1), RES_OK);
CHECK(ssol_instance_sample(secondary, 1), RES_OK);
@@ -204,7 +204,7 @@ main(int argc, char** argv)
/* No attached sun */
CHECK(ssol_scene_detach_sun(scene, sun), RES_OK);
- CHECK(ssol_solve(scene, rng, 10, NULL, &estimator), RES_BAD_ARG);
+ CHECK(ssol_solve(scene, rng, 10, 0, NULL, &estimator), RES_BAD_ARG);
CHECK(ssol_sun_ref_put(sun), RES_OK);
/* Sun with no spectrum */
@@ -212,7 +212,7 @@ main(int argc, char** argv)
CHECK(ssol_sun_set_direction(sun, d3(dir, 1, 0, -1)), RES_OK);
CHECK(ssol_sun_set_dni(sun, 1000), RES_OK);
CHECK(ssol_scene_attach_sun(scene, sun), RES_OK);
- CHECK(ssol_solve(scene, rng, 10, NULL, &estimator), RES_BAD_ARG);
+ CHECK(ssol_solve(scene, rng, 10, 0, NULL, &estimator), RES_BAD_ARG);
CHECK(ssol_scene_detach_sun(scene, sun), RES_OK);
CHECK(ssol_sun_ref_put(sun), RES_OK);
@@ -221,14 +221,14 @@ main(int argc, char** argv)
CHECK(ssol_sun_set_direction(sun, d3(dir, 1, 0, -1)), RES_OK);
CHECK(ssol_sun_set_spectrum(sun, spectrum), RES_OK);
CHECK(ssol_scene_attach_sun(scene, sun), RES_OK);
- CHECK(ssol_solve(scene, rng, 10, NULL, &estimator), RES_BAD_ARG);
+ CHECK(ssol_solve(scene, rng, 10, 0, NULL, &estimator), RES_BAD_ARG);
CHECK(ssol_sun_set_dni(sun, 1000), RES_OK);
/* No receiver in scene */
CHECK(ssol_instance_set_receiver(heliostat, 0, 0), RES_OK);
CHECK(ssol_instance_set_receiver(secondary, 0, 0), RES_OK);
CHECK(ssol_instance_set_receiver(target, 0, 0), RES_OK);
- CHECK(ssol_solve(scene, rng, 10, NULL, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, 10, 0, NULL, &estimator), RES_OK);
CHECK(ssol_instance_set_receiver(heliostat, SSOL_FRONT, 0), RES_OK);
CHECK(ssol_instance_set_receiver(secondary, SSOL_FRONT, 0), RES_OK);
CHECK(ssol_instance_set_receiver(target, SSOL_FRONT, 0), RES_OK);
@@ -243,7 +243,7 @@ main(int argc, char** argv)
CHECK(ssol_atmosphere_create_uniform(dev, &atm), RES_OK);
CHECK(ssol_atmosphere_set_uniform_absorption(atm, abs), RES_OK);
CHECK(ssol_scene_attach_atmosphere(scene, atm), RES_OK);
- CHECK(ssol_solve(scene, rng, 10, NULL, &estimator), RES_BAD_ARG);
+ CHECK(ssol_solve(scene, rng, 10, 0, NULL, &estimator), RES_BAD_ARG);
CHECK(ssol_scene_detach_atmosphere(scene, atm), RES_OK);
CHECK(ssol_spectrum_ref_put(abs), RES_OK);
CHECK(ssol_atmosphere_ref_put(atm), RES_OK);
@@ -253,7 +253,7 @@ main(int argc, char** argv)
#define N__ 10000
#define GET_MC_RCV ssol_estimator_get_mc_receiver
#define GET_MC_GLOBAL ssol_estimator_get_mc_global
- CHECK(ssol_solve(scene, rng, N__, tmp, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, N__, 0, tmp, &estimator), RES_OK);
CHECK(ssol_instance_get_id(target, &r_id), RES_OK);
CHECK(ssol_estimator_get_count(estimator, &count), RES_OK);
CHECK(count, N__);
@@ -302,7 +302,7 @@ main(int argc, char** argv)
CHECK(ssol_instance_sample(secondary, 0), RES_OK);
NCHECK(tmp = tmpfile(), 0);
- CHECK(ssol_solve(scene, rng, N__, tmp, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, N__, 0, tmp, &estimator), RES_OK);
CHECK(ssol_estimator_get_count(estimator, &count), RES_OK);
CHECK(count, N__);
CHECK(pp_sum(tmp, (int32_t)r_id, count, &m, &std), RES_OK);
@@ -333,7 +333,7 @@ main(int argc, char** argv)
CHECK(ssol_scene_attach_atmosphere(scene, atm), RES_OK);
NCHECK(tmp = tmpfile(), 0);
- CHECK(ssol_solve(scene, rng, N__, tmp, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, N__, 0, tmp, &estimator), RES_OK);
CHECK(ssol_estimator_get_count(estimator, &count), RES_OK);
CHECK(count, N__);
CHECK(pp_sum(tmp, (int32_t)r_id, count, &m, &std), RES_OK);
@@ -381,7 +381,7 @@ main(int argc, char** argv)
CHECK(ssol_instance_set_receiver(target, SSOL_FRONT, 1), RES_OK);
NCHECK(tmp = tmpfile(), 0);
- CHECK(ssol_solve(scene, rng, N__, tmp, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, N__, 0, tmp, &estimator), RES_OK);
CHECK(ssol_estimator_get_count(estimator, &count), RES_OK);
CHECK(count, N__);
CHECK(pp_sum(tmp, (int32_t)r_id, count, &a_m, &a_std), RES_OK);
@@ -481,7 +481,7 @@ main(int argc, char** argv)
desc.count = 2;
CHECK(ssol_spectrum_setup(abs, get_wlen, 2, &desc), RES_OK);
NCHECK(tmp = tmpfile(), 0);
- CHECK(ssol_solve(scene, rng, N__, tmp, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, N__, 0, tmp, &estimator), RES_OK);
CHECK(ssol_estimator_get_count(estimator, &count), RES_OK);
CHECK(count, N__);
CHECK(pp_sum(tmp, (int32_t)r_id, count, &m, &std), RES_OK);
diff --git a/src/test_ssol_solver2.c b/src/test_ssol_solver2.c
@@ -180,7 +180,7 @@ main(int argc, char** argv)
NCHECK(tmp = tmpfile(), 0);
#define N__ 10000
#define GET_MC_RCV ssol_estimator_get_mc_receiver
- CHECK(ssol_solve(scene, rng, N__, tmp, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, N__, 0, tmp, &estimator), RES_OK);
CHECK(ssol_instance_get_id(target, &r_id), RES_OK);
CHECK(ssol_estimator_get_count(estimator, &count), RES_OK);
CHECK(count, N__);
diff --git a/src/test_ssol_solver2b.c b/src/test_ssol_solver2b.c
@@ -183,7 +183,7 @@ main(int argc, char** argv)
NCHECK(tmp = tmpfile(), 0);
#define N__ 50000
- CHECK(ssol_solve(scene, rng, N__, tmp, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, N__, 0, tmp, &estimator), RES_OK);
CHECK(ssol_instance_get_id(target, &r_id), RES_OK);
CHECK(ssol_estimator_get_count(estimator, &count), RES_OK);
CHECK(count, N__);
diff --git a/src/test_ssol_solver3.c b/src/test_ssol_solver3.c
@@ -137,7 +137,7 @@ main(int argc, char** argv)
NCHECK(tmp = tmpfile(), 0);
#define N__ 20000
- CHECK(ssol_solve(scene, rng, N__, tmp, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, N__, 0, tmp, &estimator), RES_OK);
CHECK(ssol_instance_get_id(target, &r_id), RES_OK);
CHECK(ssol_estimator_get_count(estimator, &count), RES_OK);
CHECK(count, N__);
diff --git a/src/test_ssol_solver4.c b/src/test_ssol_solver4.c
@@ -146,7 +146,7 @@ main(int argc, char** argv)
NCHECK(tmp = tmpfile(), 0);
#define N__ 10000
#define GET_MC_RCV ssol_estimator_get_mc_receiver
- CHECK(ssol_solve(scene, rng, N__, tmp, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, N__, 0, tmp, &estimator), RES_OK);
CHECK(ssol_instance_get_id(target1, &r_id1), RES_OK);
CHECK(ssol_instance_get_id(target2, &r_id2), RES_OK);
CHECK(ssol_estimator_get_count(estimator, &count), RES_OK);
diff --git a/src/test_ssol_solver5.c b/src/test_ssol_solver5.c
@@ -138,7 +138,7 @@ main(int argc, char** argv)
NCHECK(tmp = tmpfile(), 0);
#define N__ 10000
- CHECK(ssol_solve(scene, rng, N__, tmp, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, N__, 0, tmp, &estimator), RES_OK);
CHECK(ssol_instance_get_id(target, &r_id), RES_OK);
CHECK(ssol_estimator_get_count(estimator, &count), RES_OK);
CHECK(count, N__);
diff --git a/src/test_ssol_solver6.c b/src/test_ssol_solver6.c
@@ -178,7 +178,7 @@ main(int argc, char** argv)
NCHECK(tmp = tmpfile(), 0);
#define N__ 10000
#define GET_MC_RCV ssol_estimator_get_mc_receiver
- CHECK(ssol_solve(scene, rng, N__, tmp, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, N__, 0, tmp, &estimator), RES_OK);
CHECK(fclose(tmp), 0);
CHECK(ssol_estimator_get_mc_global(estimator, &mc_global), RES_OK);
printf("Shadows = %g +/- %g\n", mc_global.shadowed.E, mc_global.shadowed.SE);
diff --git a/src/test_ssol_solver7.c b/src/test_ssol_solver7.c
@@ -198,7 +198,7 @@ main(int argc, char** argv)
#define GET_MC_RCV ssol_estimator_get_mc_receiver
NCHECK(tmp = tmpfile(), 0);
- CHECK(ssol_solve(scene, rng, N__, tmp, &estimator), RES_OK);
+ CHECK(ssol_solve(scene, rng, N__, 0, tmp, &estimator), RES_OK);
CHECK(fclose(tmp), 0);
printf("Total = %g\n", TOTAL);