function dapply( out, dist, npts, ndims, matrix, ci ) {
	var offsetC;
	var offsetD;
	var strideD;
	var buf;
	var i;

	buf = matrix.data;

	strideD = matrix.strides[ 0 ];
	offsetC = strideD * ci;
	offsetD = 0;

	for ( i = 0; i < npts; i++ ) {
		out[ i ] = dist( ndims, buf, 1, offsetD, buf, 1, offsetC ); // Magic number `1` for stride is based on knowing that the matrix is row-major single-segment contiguous
		offsetD += strideD;
	}
	return out;
}
Applies a function for calculating the squared distance between each data point and a specified centroid.

@private
@param {Array} out - output array
@param {Function} dist - distance function to apply
@param {PositiveInteger} npts - number of data points
@param {PositiveInteger} ndims - number of dimensions
@param {ndarray} matrix - data point matrix
@param {NonNegativeInteger} ci - centroid row index
@returns {Array} output array