|
template<class Axis > |
std::vector< Axis > | addAxis (const std::vector< Axis > &axes, const Axis &newAxis, const unsigned newAxisNumber) |
|
template<class Axis > |
std::vector< Axis > | axesOfASlice (const std::vector< Axis > &axes, const unsigned *fixedIndices, const unsigned nFixedIndices) |
|
void | h_badargs (const char *method) |
|
template<typename Float , class Axis > |
void | iHND_checkArgs (const HistoND< Float, Axis > &histo, const unsigned xDim, const unsigned interpolationDegree) |
|
double | lind_interpolateSimple (const double x0, const double x1, const double y0, const double y1, const double x) |
|
template<typename Numeric , class Axis > |
void | lind_invert1DSlice (const ArrayND< Numeric > &fromSlice, const Axis &fromAxis, const Axis &toAxis, const bool leftLinear, const bool rightLinear, ArrayND< Numeric > *toSlice) |
|
template<class Axis > |
ArrayShape | makeHistoShape (const std::vector< Axis > &axes) |
|
template<class Axis > |
ArrayShape | makeHistoShape (const Axis &xAxis) |
|
template<class Axis > |
ArrayShape | makeHistoShape (const Axis &xAxis, const Axis &yAxis) |
|
template<class Axis > |
ArrayShape | makeHistoShape (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis) |
|
template<class Axis > |
ArrayShape | makeHistoShape (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const Axis &tAxis) |
|
template<class Axis > |
ArrayShape | makeHistoShape (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const Axis &tAxis, const Axis &vAxis) |
|
template<class Axis > |
ArrayShape | makeTableShape (const std::vector< Axis > &axes) |
|
template<class Axis > |
ArrayShape | makeTableShape (const Axis &xAxis) |
|
template<class Axis > |
ArrayShape | makeTableShape (const Axis &xAxis, const Axis &yAxis) |
|
template<class Axis > |
ArrayShape | makeTableShape (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis) |
|
template<class Axis > |
ArrayShape | makeTableShape (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const Axis &tAxis) |
|
template<class Axis > |
ArrayShape | makeTableShape (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const Axis &tAxis, const Axis &vAxis) |
|
template<class Axis > |
std::vector< Axis > | rebinAxes (const std::vector< Axis > &axes, const unsigned *newBins, const unsigned lenNewBins) |
|
template<class Axis > |
ArrayShape | shapeOfASlice (const std::vector< Axis > &axes, const unsigned *fixedIndices, const unsigned nFixedIndices) |
|
template<class Axis > |
ArrayShape | shapeWithExtraAxis (const std::vector< Axis > &axes, const Axis &newAxis, const unsigned newAxisNumber) |
|
template<typename Numeric , class Axis >
void npstat::Private::lind_invert1DSlice |
( |
const ArrayND< Numeric > & |
fromSlice, |
|
|
const Axis & |
fromAxis, |
|
|
const Axis & |
toAxis, |
|
|
const bool |
leftLinear, |
|
|
const bool |
rightLinear, |
|
|
ArrayND< Numeric > * |
toSlice |
|
) |
| |
Definition at line 349 of file LinInterpolatedTableND.h.
References cms::cuda::assert(), npstat::ArrayND< Numeric, StackLen, StackDim >::data(), mps_fire::i, npstat::isStrictlyMonotonous(), npstat::ArrayND< Numeric, StackLen, StackDim >::length(), lind_interpolateSimple(), cuda_std::lower_bound(), and npstat::ArrayND< Numeric, StackLen, StackDim >::rank().
Referenced by npstat::LinInterpolatedTableND< Numeric, Axis >::invertWRTAxis().
359 const Numeric* fromData = fromSlice.
data();
360 const unsigned fromLen = fromSlice.
length();
362 assert(fromLen == fromAxis.nCoords());
363 const Numeric* fromDataEnd = fromData + fromLen;
366 "In npstat::Private::lind_invert1DSlice: "
367 "slice data is not monotonous and can not be inverted");
369 const Numeric yfirst = fromData[0];
370 const Numeric ylast = fromData[fromLen - 1U];
371 const bool increasing = yfirst < ylast;
373 Numeric* toD =
const_cast<Numeric*
>(toSlice->
data());
374 const unsigned nAxisPoints = toAxis.nCoords();
377 for (
unsigned ipt = 0; ipt < nAxisPoints; ++ipt) {
378 const Numeric
y =
static_cast<Numeric
>(toAxis.coordinate(ipt));
383 yfirst, fromData[1], fromAxis.coordinate(0), fromAxis.coordinate(1),
y);
385 toD[ipt] = fromAxis.coordinate(0);
386 }
else if (y >= ylast) {
389 fromData[fromLen - 2U],
390 fromAxis.coordinate(fromLen - 1U),
391 fromAxis.coordinate(fromLen - 2U),
394 toD[ipt] = fromAxis.coordinate(fromLen - 1U);
398 fromData[i - 1U], fromData[i], fromAxis.coordinate(i - 1U), fromAxis.coordinate(i),
y);
406 fromData[fromLen - 2U],
407 fromAxis.coordinate(fromLen - 1U),
408 fromAxis.coordinate(fromLen - 2U),
411 toD[ipt] = fromAxis.coordinate(fromLen - 1U);
412 }
else if (y >= yfirst) {
415 yfirst, fromData[1], fromAxis.coordinate(0), fromAxis.coordinate(1),
y);
417 toD[ipt] = fromAxis.coordinate(0);
419 const unsigned i =
std::lower_bound(fromData, fromDataEnd, y, std::greater<Numeric>()) - fromData;
421 fromData[i - 1U], fromData[i], fromAxis.coordinate(i - 1U), fromAxis.coordinate(i),
y);
unsigned long length() const
const Numeric * data() const
double lind_interpolateSimple(const double x0, const double x1, const double y0, const double y1, const double x)
bool isStrictlyMonotonous(Iter const begin, Iter const end)
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})