Method
NumCosmoMathFunctionSampleSetexpand_domain
Declaration [src]
void
ncm_function_sample_set_expand_domain (
NcmFunctionSampleSet* fss,
NcmFunctionSampleSetFunc f,
const gdouble x_min_hard,
const gdouble x_max_hard,
const gdouble expansion_factor,
const gdouble epsilon,
const guint max_iterations,
const guint consecutive_tries,
gpointer user_data
)
Description [src]
Expands the domain of the function sample set by alternating between left and right boundary expansion until convergence or limits are reached. At each step:
- Left expansion proposes: $x_{\text{new}} = x_{\text{min}} \times (1 - \alpha)$
- Right expansion proposes: $x_{\text{new}} = x_{\text{max}} \times (1 + \alpha)$
- where $\alpha$ is the
expansion_factor
The function recomputes the reference scale $F_{\text{ref}} = |\text{absmaxF}|_2$ after each point insertion, ensuring proper convergence detection even when the function is still growing. Expansion on each side stops when:
- $|F(x)| < \epsilon \times F_{\text{ref}}$ for
consecutive_triesconsecutive points, OR - A hard limit is reached
The interleaved expansion pattern (left, right, left, right, …) ensures the reference scale tracks the global function behavior correctly.
Parameters
f-
Type:
NcmFunctionSampleSetFuncCallback function to evaluate at new points.
x_min_hard-
Type:
const gdoubleMinimum allowed x value (hard limit).
x_max_hard-
Type:
const gdoubleMaximum allowed x value (hard limit).
expansion_factor-
Type:
const gdoubleMultiplicative factor for domain expansion (e.g., 0.2 for 20%).
epsilon-
Type:
const gdoubleConvergence threshold relative to reference scale.
max_iterations-
Type:
const guintMaximum number of expansion iterations.
consecutive_tries-
Type:
const guintNumber of consecutive converged points required on each side.
user_data-
Type:
gpointerUser data passed to callback function.
The argument can be NULL.The data is owned by the caller of the method.