Method

NumCosmoMathFunctionSampleSetiter_insert_after

Declaration [src]

void
ncm_function_sample_set_iter_insert_after (
  NcmFunctionSampleSet* fss,
  NcmFunctionSampleSetIter* iter,
  const gdouble x,
  NcmVector* y,
  NcmFunctionSampleSetIter** iter_out
)

Description [src]

Inserts a new sample after the position of iter. The vector y must have dimension matching fss:len property. The new sample’s interval_ok is initialized to 0 and new_point is set to TRUE. When iter_out points to a NULL pointer the callee allocates a new iterator that must be freed with ncm_function_sample_set_iter_free(). When iter_out points to an already-allocated iterator (e.g. a stack variable) no allocation occurs and no free is required.

Warning: This does not check if the insertion maintains x-order. Use with care.

Parameters

iter

Type: NcmFunctionSampleSetIter

A NcmFunctionSampleSetIter.

The data is owned by the caller of the method.
x

Type: const gdouble

Knot position.

y

Type: NcmVector

Vector value at x.

The data is owned by the caller of the method.
iter_out

Type: NcmFunctionSampleSetIter

Iterator pointing to the newly inserted sample; if *iter_out is NULL a new iterator is heap-allocated, otherwise the existing memory is reused.

The argument will be set by the function.
The caller of the method takes ownership of the returned data, and is responsible for freeing it.