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_tries consecutive 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: NcmFunctionSampleSetFunc

Callback function to evaluate at new points.

x_min_hard

Type: const gdouble

Minimum allowed x value (hard limit).

x_max_hard

Type: const gdouble

Maximum allowed x value (hard limit).

expansion_factor

Type: const gdouble

Multiplicative factor for domain expansion (e.g., 0.2 for 20%).

epsilon

Type: const gdouble

Convergence threshold relative to reference scale.

max_iterations

Type: const guint

Maximum number of expansion iterations.

consecutive_tries

Type: const guint

Number of consecutive converged points required on each side.

user_data

Type: gpointer

User data passed to callback function.

The argument can be NULL.
The data is owned by the caller of the method.