PISM, A Parallel Ice Sheet Model  stable v2.1.1 committed by Constantine Khrulev on 2024-12-04 13:36:58 -0900

◆ subset_start_and_count()

static void pism::subset_start_and_count ( const std::vector< double > &  x,
double  subset_x_min,
double  subset_x_max,
int &  x_start,
int &  x_count 
)
static

Compute start and count for getting a subset of x.

Given a grid x we find x_start and x_count so that [subset_x_min, subset_x_max] is in [x[x_start], x[x_start + x_count]].

x_start and x_count define the smallest subset of x with this property.

Note that x_start + x_count <= x.size() as long as x is strictly increasing.

Parameters
[in]xinput grid (defined interpolation domain)
[in]subset_x_minminimum x of a subset (interpolation range)
[in]subset_x_maxmaxumum x of a subset (interpolation range)
[out]x_startstarting index
[out]x_countnumber of elements required

Definition at line 52 of file LocalInterpCtx.cc.

References pism::array::min().

Referenced by pism::LocalInterpCtx::LocalInterpCtx().