CMS 3D CMS Logo

Namespaces | Classes | Typedefs | Functions
npstat Namespace Reference

Namespaces

 Private
 

Classes

struct  AbsArrayProjector
 
struct  AbsMultivariateFunctor
 
struct  AbsVisitor
 
struct  addmul_left
 
struct  addmul_right
 
class  ArrayND
 
class  ArrayNDScanner
 
struct  ArrayRange
 
struct  assign_left
 
struct  assign_right
 
struct  BoxND
 
struct  CastingCopyConstructor
 
class  CircularMapper1d
 
struct  ComplexComparesAbs
 
struct  ComplexComparesAbs< std::complex< T > >
 
struct  ComplexComparesFalse
 
struct  ComplexComparesFalse< std::complex< T > >
 
class  CoordinateSelector
 
struct  DefaultConstructor0
 
struct  DefaultConstructor1
 
struct  DefaultConstructor2
 
struct  DefaultConstructor3
 
struct  diveq_left
 
struct  diveq_left_0by0isC
 
struct  diveq_right
 
struct  diveq_right_0by0isC
 
class  DualAxis
 
class  DualHistoAxis
 
struct  Element1D
 
struct  Element1DAt
 
class  EquidistantInLinearSpace
 
class  EquidistantInLogSpace
 
struct  FcnFunctor0
 
struct  FcnFunctor1
 
struct  FcnFunctor2
 
struct  FcnFunctor3
 
struct  Functor0
 
struct  Functor1
 
struct  Functor2
 
struct  Functor3
 
class  GridAxis
 
class  HistoAxis
 
class  HistoND
 
class  Interval
 
class  LinearMapper1d
 
class  LinInterpolatedTableND
 
struct  minuseq_left
 
struct  minuseq_right
 
struct  multeq_left
 
struct  multeq_right
 
struct  NpstatDomainError
 
struct  NpstatException
 
struct  NpstatInvalidArgument
 
struct  NpstatOutOfRange
 
struct  NpstatRuntimeError
 
class  NUHistoAxis
 
struct  pluseq_left
 
struct  pluseq_right
 
struct  PreciseType
 
struct  PreciseType< const std::complex< T > >
 
struct  PreciseType< const volatile std::complex< T > >
 
struct  PreciseType< std::complex< T > >
 
struct  PreciseType< volatile std::complex< T > >
 
struct  PreciseTypeHelper
 
struct  PreciseTypeHelper< T, 1 >
 
struct  ProperDblFromCmpl
 
struct  ProperDblFromCmpl< const std::complex< T > >
 
struct  ProperDblFromCmpl< const volatile std::complex< T > >
 
struct  ProperDblFromCmpl< std::complex< T > >
 
struct  ProperDblFromCmpl< volatile std::complex< T > >
 
struct  Same
 
struct  SameRef
 
struct  scast_assign_left
 
struct  scast_assign_right
 
struct  scast_minuseq_left
 
struct  scast_minuseq_right
 
struct  scast_pluseq_left
 
struct  scast_pluseq_right
 
class  StorableHistoNDFunctor
 
class  StorableInterpolationFunctor
 
class  StorableMultivariateFunctor
 
class  StorableMultivariateFunctorReader
 
class  UniformAxis
 
class  VisitCounter
 

Typedefs

typedef std::vector< unsigned > ArrayShape
 
typedef StorableHistoNDFunctor< double, DualHistoAxisDoubleHistoNDFunctor
 
typedef StorableInterpolationFunctor< double, DualAxisDoubleInterpolationFunctor
 
typedef StorableHistoNDFunctor< double, NUHistoAxisDoubleNUHistoNDFunctor
 
typedef StorableInterpolationFunctor< double, GridAxisDoubleNUInterpolationFunctor
 
typedef StorableHistoNDFunctor< double, HistoAxisDoubleUAHistoNDFunctor
 
typedef StorableInterpolationFunctor< double, UniformAxisDoubleUAInterpolationFunctor
 
typedef StorableHistoNDFunctor< float, DualHistoAxisFloatHistoNDFunctor
 
typedef StorableInterpolationFunctor< float, DualAxisFloatInterpolationFunctor
 
typedef StorableHistoNDFunctor< float, NUHistoAxisFloatNUHistoNDFunctor
 
typedef StorableInterpolationFunctor< float, GridAxisFloatNUInterpolationFunctor
 
typedef StorableHistoNDFunctor< float, HistoAxisFloatUAHistoNDFunctor
 
typedef StorableInterpolationFunctor< float, UniformAxisFloatUAInterpolationFunctor
 
typedef gs::StaticReader< StorableMultivariateFunctorReaderStaticStorableMultivariateFunctorReader
 

Functions

template<typename T >
Private::AbsReturnType< T >::type absDifference (const T &v1, const T &v2)
 
template<typename T >
Private::AbsReturnType< T >::type absValue (const T &v1)
 
template<typename T >
void clearBuffer (T *buf, const unsigned long len)
 
bool closeWithinTolerance (const double &a, const double &b, const double &tol)
 
template<typename Histo >
void convertHistoToDensity (Histo *histogram, bool knownNonNegative=false)
 
UniformAxis convertToGridAxis (const HistoAxis &histoAxis)
 
GridAxis convertToGridAxis (const NUHistoAxis &histoAxis)
 
HistoAxis convertToHistoAxis (const UniformAxis &gridAxis)
 
NUHistoAxis convertToHistoAxis (const GridAxis &gridAxis, double xMin)
 
template<typename Histo >
std::vector< CircularMapper1dconvolutionHistoMap (const Histo &histo, bool doubleDataRange)
 
template<typename T1 , typename T2 >
void copyBuffer (T1 *dest, const T2 *source, const unsigned long len)
 
template<typename Histo >
std::vector< LinearMapper1ddensityScanHistoMap (const Histo &histo)
 
template<typename T >
void destroyBuffer (T *thisBuffer, const T *stackBuffer)
 
ArrayShape doubleShape (const ArrayShape &inputShape)
 
ArrayShape halfShape (const ArrayShape &inputShape)
 
template<typename T >
T interpolate_cubic (const double x, const T &f0, const T &f1, const T &f2, const T &f3)
 
template<typename T >
T interpolate_linear (const double x, const T &f0, const T &f1)
 
template<typename T >
T interpolate_quadratic (const double x, const T &f0, const T &f1, const T &f2)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, const double *coords, unsigned coordsDim, unsigned interpolationDegree)
 
template<class Iter >
bool isMonotonous (Iter const begin, Iter const end)
 
template<class Iter >
bool isNonDecreasing (Iter begin, Iter const end)
 
template<class Iter >
bool isNonIncreasing (Iter begin, Iter const end)
 
template<class Iter >
bool isStrictlyDecreasing (Iter begin, Iter const end)
 
template<class Iter >
bool isStrictlyIncreasing (Iter begin, Iter const end)
 
template<class Iter >
bool isStrictlyMonotonous (Iter const begin, Iter const end)
 
bool isSubShape (const ArrayShape &sh1, const ArrayShape &sh2)
 
template<typename T >
TmakeBuffer (unsigned sizeNeeded, T *stackBuffer, unsigned sizeofStackBuffer)
 
template<typename T1 , typename T2 >
void transposeBuffer (T1 *dest, const T2 *source, const unsigned long dim)
 
template<typename T1 , typename T2 >
void transposeBuffer (T1 *dest, const T2 *source, const unsigned long M, const unsigned long N)
 
ArrayShape makeShape ()
 
ArrayShape makeShape (unsigned i0)
 
ArrayShape makeShape (unsigned i0, unsigned i1)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8, unsigned i9)
 
ArrayShape makeShape (const unsigned *indices, unsigned nIndices)
 
template<typename T >
unsigned interpolation_coefficients (T *buffer, unsigned bufLen, const T &f0, const T &f1)
 
template<typename T >
unsigned interpolation_coefficients (T *buffer, unsigned bufLen, const T &f0, const T &f1, const T &f2)
 
template<typename T >
unsigned interpolation_coefficients (T *buffer, unsigned bufLen, const T &f0, const T &f1, const T &f2, const T &f3)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, double x4, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, double x4, double x5, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, double x4, double x5, double x6, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, double x9, unsigned interpolationDegree)
 

Typedef Documentation

◆ ArrayShape

typedef std::vector<unsigned> npstat::ArrayShape

This type will be used to specify array length in each dimension

Definition at line 21 of file ArrayShape.h.

◆ DoubleHistoNDFunctor

Definition at line 18 of file HistoNDFunctorInstances.h.

◆ DoubleInterpolationFunctor

Definition at line 19 of file InterpolationFunctorInstances.h.

◆ DoubleNUHistoNDFunctor

Definition at line 22 of file HistoNDFunctorInstances.h.

◆ DoubleNUInterpolationFunctor

Definition at line 23 of file InterpolationFunctorInstances.h.

◆ DoubleUAHistoNDFunctor

Definition at line 20 of file HistoNDFunctorInstances.h.

◆ DoubleUAInterpolationFunctor

Definition at line 21 of file InterpolationFunctorInstances.h.

◆ FloatHistoNDFunctor

Definition at line 24 of file HistoNDFunctorInstances.h.

◆ FloatInterpolationFunctor

Definition at line 25 of file InterpolationFunctorInstances.h.

◆ FloatNUHistoNDFunctor

Definition at line 28 of file HistoNDFunctorInstances.h.

◆ FloatNUInterpolationFunctor

Definition at line 29 of file InterpolationFunctorInstances.h.

◆ FloatUAHistoNDFunctor

Definition at line 26 of file HistoNDFunctorInstances.h.

◆ FloatUAInterpolationFunctor

Definition at line 27 of file InterpolationFunctorInstances.h.

◆ StaticStorableMultivariateFunctorReader

The reader factory for descendants of StorableMultivariateFunctor

Definition at line 30 of file StorableMultivariateFunctorReader.h.

Function Documentation

◆ absDifference()

template<typename T >
Private::AbsReturnType<T>::type npstat::absDifference ( const T v1,
const T v2 
)
inline

Absolute value of the difference between two numbers. Works for all standard numeric types, including unsigned and complex.

Definition at line 73 of file absDifference.h.

References dumpMFGeometry_cfg::delta.

Referenced by npstat::ArrayND< Numeric >::isClose(), npstat::ArrayND< Numeric >::makeCopulaSteps(), and npstat::ArrayND< Numeric >::maxAbsDifference().

◆ absValue()

template<typename T >
Private::AbsReturnType<T>::type npstat::absValue ( const T v1)
inline

Absolute value of a number. Works for all standard numeric types, including unsigned and complex.

Definition at line 82 of file absDifference.h.

References relativeConstraints::value.

Referenced by npstat::ArrayND< Numeric >::sumsq().

◆ clearBuffer()

template<typename T >
void npstat::clearBuffer ( T buf,
const unsigned long  len 
)
inline

Clear a buffer (set all elements to the value produced by the default constructor)

Definition at line 86 of file allocators.h.

References cms::cuda::assert(), visDQMUpload::buf, mps_fire::i, and SiPixelPI::zero.

Referenced by npstat::ArrayND< Numeric >::ArrayND(), npstat::ArrayND< Numeric >::exportSubrange(), npstat::ArrayND< Numeric >::importSubrange(), and npstat::ArrayND< Numeric >::rotate().

86  {
87  if (len) {
88  assert(buf);
89  const T zero = T();
90  for (unsigned long i = 0; i < len; ++i)
91  *buf++ = zero;
92  }
93  }
assert(be >=bs)
long double T

◆ closeWithinTolerance()

bool npstat::closeWithinTolerance ( const double &  a,
const double &  b,
const double &  tol 
)
inline

Check if two doubles are within certain relative tolerance from each other. The "tol" argument which specifies the tolerance must be non-negative.

Definition at line 25 of file closeWithinTolerance.h.

References a, b, and WZElectronSkims53X_cff::max.

Referenced by npstat::UniformAxis::isClose(), npstat::NUHistoAxis::isClose(), npstat::GridAxis::isClose(), and npstat::HistoAxis::isClose().

25  {
26  if (tol < 0.0)
28  "In npstat::closeWithinTolerance: "
29  "negative tolerance is not allowed");
30  if (a == b)
31  return true;
32  else
33  return fabs(a - b) / std::max(fabs(a), fabs(b)) <= tol;
34  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121

◆ convertHistoToDensity()

template<typename Histo >
void npstat::convertHistoToDensity ( Histo *  histogram,
bool  knownNonNegative = false 
)

Reset negative histogram bins to zero and then divide histogram bin contents by the histogram integral. If the "knownNonNegative" argument is true, it will be assumed that there are no negative bins, and their explicit reset is unnecessary.

This function will throw npstat::NpstatRuntimeError in case the histogram is empty after all negative bins are reset.

This function is not a member of the HistoND class itself because these operations do not necessarily make sense for all bin types. Making such operation a member would make creation of HistoND scripting API (e.g., for python) more difficult.

Definition at line 3534 of file HistoND.h.

References cms::cuda::assert(), and h.

3534  {
3535  assert(h);
3536  if (!knownNonNegative)
3537  (const_cast<ArrayND<typename Histo::value_type>&>(h->binContents())).makeNonNegative();
3538  const double integ = h->integral();
3539  *h /= integ;
3540  }
assert(be >=bs)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ convertToGridAxis() [1/2]

UniformAxis npstat::convertToGridAxis ( const HistoAxis histoAxis)

Convert uniform histogram to uniform grid axis axis

Definition at line 15 of file convertAxis.cc.

References npstat::HistoAxis::binCenter(), npstat::HistoAxis::label(), ecalPedestalPCLworker_cfi::nBins, npstat::HistoAxis::nBins(), TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

15  {
16  const unsigned nBins = histoAxis.nBins();
17  const double xmin = histoAxis.binCenter(0);
18  const double xmax = histoAxis.binCenter(nBins - 1);
19  UniformAxis ax(nBins, xmin, xmax, histoAxis.label().c_str());
20  return ax;
21  }

◆ convertToGridAxis() [2/2]

GridAxis npstat::convertToGridAxis ( const NUHistoAxis histoAxis)

Note that conversion from non-uniform histogram axis into the grid axis is always possible, but it is loosing information (we are writing the positions of bin centers only, not edges)

Definition at line 42 of file convertAxis.cc.

References npstat::NUHistoAxis::binCenter(), mps_fire::i, npstat::NUHistoAxis::label(), ecalPedestalPCLworker_cfi::nBins, and npstat::NUHistoAxis::nBins().

42  {
43  const unsigned nBins = histoAxis.nBins();
44  std::vector<double> coords;
45  coords.reserve(nBins);
46  for (unsigned i = 0; i < nBins; ++i)
47  coords.push_back(histoAxis.binCenter(i));
48  GridAxis ax(coords, histoAxis.label().c_str());
49  return ax;
50  }

◆ convertToHistoAxis() [1/2]

HistoAxis npstat::convertToHistoAxis ( const UniformAxis gridAxis)

Convert uniform grid axis to uniform histogram axis

Definition at line 6 of file convertAxis.cc.

References npstat::UniformAxis::label(), npstat::UniformAxis::max(), npstat::UniformAxis::min(), ecalPedestalPCLworker_cfi::nBins, npstat::UniformAxis::nCoords(), mitigatedMETSequence_cff::U, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

6  {
7  const unsigned nBins = gridAxis.nCoords();
8  const double xmin = gridAxis.min();
9  const double xmax = gridAxis.max();
10  const double hbw = 0.5 * (xmax - xmin) / (nBins - 1U);
11  HistoAxis ax(nBins, xmin - hbw, xmax + hbw, gridAxis.label().c_str());
12  return ax;
13  }

◆ convertToHistoAxis() [2/2]

NUHistoAxis npstat::convertToHistoAxis ( const GridAxis gridAxis,
double  xMin 
)

The conversion from non-uniform grid axis to non-uniform histogram axis is only unambiguous when some additional info is available. Here, in particular, we are asking for the position of the axis minimum. This function will throw npstat::NpstatInvalidArgument in case the conversion is impossible.

Definition at line 23 of file convertAxis.cc.

References npstat::GridAxis::coordinate(), mps_fire::i, npstat::GridAxis::label(), npstat::GridAxis::nCoords(), mitigatedMETSequence_cff::U, x, and photonAnalyzer_cfi::xMin.

23  {
24  const unsigned nCoords = gridAxis.nCoords();
25  std::vector<double> binEdges;
26  binEdges.reserve(nCoords + 1U);
27  binEdges.push_back(xMin);
28  for (unsigned i = 0; i < nCoords; ++i) {
29  const double x = gridAxis.coordinate(i);
30  if (x <= xMin)
32  "In npstat::convertToHistoAxis: "
33  "conversion is impossible");
34  const double halfbin = x - xMin;
35  xMin = x + halfbin;
36  binEdges.push_back(xMin);
37  }
38  NUHistoAxis ax(binEdges, gridAxis.label().c_str());
39  return ax;
40  }
float x

◆ convolutionHistoMap()

template<typename Histo >
std::vector< CircularMapper1d > npstat::convolutionHistoMap ( const Histo &  histo,
bool  doubleDataRange 
)

Generate a density scanning map for subsequent use with the "DensityScanND" template when a density is to be convolved with the histogram data. Only histograms with uniform binning can be used here.

The "doubleDataRange" should be set "true" in case the data will be mirrored (or just empty range added) to avoid circular spilling after convolution.

Definition at line 3555 of file HistoND.h.

References ztail::d, timingPdfMaker::histo, mps_fire::i, and mps_fire::result.

3555  {
3556  std::vector<CircularMapper1d> result;
3557  const unsigned d = histo.dim();
3558  result.reserve(d);
3559  for (unsigned i = 0; i < d; ++i)
3560  result.push_back(histo.axis(i).kernelScanMapper(doubleRange));
3561  return result;
3562  }
d
Definition: ztail.py:151

◆ copyBuffer()

template<typename T1 , typename T2 >
void npstat::copyBuffer ( T1 *  dest,
const T2 *  source,
const unsigned long  len 
)
inline

Copy a buffer (with possible type conversion on the fly)

Definition at line 38 of file allocators.h.

References cms::cuda::assert(), mps_fire::dest, mps_fire::i, and source.

Referenced by npstat::ArrayND< Numeric >::ArrayND(), npstat::ArrayND< Numeric >::dot(), npstat::ArrayND< Numeric >::operator=(), npstat::ArrayND< Numeric >::setData(), and npstat::ArrayND< Numeric >::transpose().

38  {
39  if (len) {
40  assert(dest);
41  assert(source);
42  for (unsigned long i = 0; i < len; ++i)
43  *dest++ = static_cast<T1>(*source++);
44  }
45  }
assert(be >=bs)
static std::string const source
Definition: EdmProvDump.cc:49

◆ densityScanHistoMap()

template<typename Histo >
std::vector< LinearMapper1d > npstat::densityScanHistoMap ( const Histo &  histo)

Generate a density scanning map for subsequent use with the "DensityScanND" template. Naturally, only histograms with uniform binning can be used here.

Definition at line 3543 of file HistoND.h.

References ztail::d, timingPdfMaker::histo, mps_fire::i, visualization-live-secondInstance_cfg::m, and mps_fire::result.

3543  {
3544  std::vector<LinearMapper1d> result;
3545  const unsigned d = histo.dim();
3546  result.reserve(d);
3547  for (unsigned i = 0; i < d; ++i) {
3548  const LinearMapper1d& m = histo.axis(i).binNumberMapper(false);
3549  result.push_back(m.inverse());
3550  }
3551  return result;
3552  }
d
Definition: ztail.py:151

◆ destroyBuffer()

template<typename T >
void npstat::destroyBuffer ( T thisBuffer,
const T stackBuffer 
)
inline

◆ doubleShape()

ArrayShape npstat::doubleShape ( const ArrayShape inputShape)

Multiply the sise in each dimension by 2

Definition at line 148 of file ArrayShape.cc.

References mps_fire::i, alignCSCRings::s, and mitigatedMETSequence_cff::U.

Referenced by npstat::ArrayND< Numeric >::multiMirror().

148  {
149  ArrayShape s(inputShape);
150  const unsigned len = s.size();
151  for (unsigned i = 0; i < len; ++i)
152  s[i] *= 2U;
153  return s;
154  }
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21

◆ halfShape()

ArrayShape npstat::halfShape ( const ArrayShape inputShape)

Divide the size in each dimension by 2 (generate dynamic fault if odd)

Definition at line 156 of file ArrayShape.cc.

References mps_fire::i, alignCSCRings::s, and mitigatedMETSequence_cff::U.

156  {
157  ArrayShape s(inputShape);
158  const unsigned len = s.size();
159  for (unsigned i = 0; i < len; ++i) {
160  if (!(s[i] % 2U == 0))
162  "In npstat::halfShape: array span must be "
163  "even in each dimension");
164  s[i] /= 2U;
165  }
166  return s;
167  }
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21

◆ interpolate_cubic()

template<typename T >
T npstat::interpolate_cubic ( const double  x,
const T f0,
const T f1,
const T f2,
const T f3 
)
inline

Cubic interpolation. Assume that the function values are given at 0, 1, 2, and 3.

Definition at line 44 of file interpolate.h.

References validate-o2o-wbm::f1, validate-o2o-wbm::f2, interpolate_linear(), and x.

Referenced by npstat::ArrayND< Numeric >::interpolateLoop().

44  {
45  return interpolate_linear(
46  x * (3.0 - x) / 2.0, interpolate_linear(x / 3.0, f0, f3), interpolate_linear(x - 1.0, f1, f2));
47  }
float x
T interpolate_linear(const double x, const T &f0, const T &f1)
Definition: interpolate.h:23

◆ interpolate_linear()

template<typename T >
T npstat::interpolate_linear ( const double  x,
const T f0,
const T f1 
)
inline

Linear interpolation. Assumes that the function values are given at 0 and 1.

Definition at line 23 of file interpolate.h.

References PVValHelper::dx, validate-o2o-wbm::f1, and x.

Referenced by interpolate_cubic(), and npstat::ArrayND< Numeric >::interpolateLoop().

23  {
24  const typename ProperDblFromCmpl<T>::type dx = 1.0 - x;
25  return f0 * dx + f1 * static_cast<typename ProperDblFromCmpl<T>::type>(x);
26  }
float x

◆ interpolate_quadratic()

template<typename T >
T npstat::interpolate_quadratic ( const double  x,
const T f0,
const T f1,
const T f2 
)
inline

Quadratic interpolation. Assume that the function values are given at 0, 1, and 2.

Definition at line 33 of file interpolate.h.

References PVValHelper::dx, validate-o2o-wbm::f1, validate-o2o-wbm::f2, SiPixelPI::two, and x.

Referenced by npstat::ArrayND< Numeric >::interpolateLoop().

33  {
34  static const typename ProperDblFromCmpl<T>::type two = 2.0;
35  const typename ProperDblFromCmpl<T>::type dx = x - 1.0;
36  return f1 + ((f2 - f0) / two + ((f2 - f1) + (f0 - f1)) * (dx / two)) * dx;
37  }
float x

◆ interpolateHistoND() [1/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
const double *  coords,
unsigned  coordsDim,
unsigned  interpolationDegree 
)

The interpolation degree in this method can be set to 0, 1, or 3 which results, respectively, in closest bin lookup, multilinear interpolation, or multicubic interpolation. Value of the closest bin inside the histogram range is used if some coordinate is outside of the corresponding axis limits.

Definition at line 156 of file interpolateHistoND.h.

References cms::cuda::assert(), isotrackApplyRegressor::bins, timingPdfMaker::histo, mps_fire::i, npstat::Private::iHND_checkArgs(), mitigatedMETSequence_cff::U, and x.

Referenced by npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::operator()().

159  {
160  Private::iHND_checkArgs(histo, xDim, interpolationDegree);
161  assert(x);
162  const Axis* ax = &histo.axes()[0];
163  double coords[CHAR_BIT * sizeof(unsigned long)];
164  for (unsigned i = 0; i < xDim; ++i)
165  coords[i] = ax[i].fltBinNumber(x[i], false);
166  const ArrayND<Float>& bins(histo.binContents());
167  switch (interpolationDegree) {
168  case 1U:
169  return bins.interpolate1(coords, xDim);
170  case 3U:
171  return bins.interpolate3(coords, xDim);
172  default:
173  return bins.closest(coords, xDim);
174  }
175  }
void iHND_checkArgs(const HistoND< Float, Axis > &histo, const unsigned xDim, const unsigned interpolationDegree)
assert(be >=bs)
float x

◆ interpolateHistoND() [2/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
unsigned  interpolationDegree 
)

Convenience function for interpolating histograms, with an explicit coordinate argument for each histogram dimension

Definition at line 178 of file interpolateHistoND.h.

References isotrackApplyRegressor::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), and mitigatedMETSequence_cff::U.

178  {
179  const unsigned expDim = 1U;
180  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
181  const double coords = histo.axis(0).fltBinNumber(x0, false);
182  const ArrayND<Float>& bins(histo.binContents());
183  switch (interpolationDegree) {
184  case 1U:
185  return bins.interpolate1(&coords, expDim);
186  case 3U:
187  return bins.interpolate3(&coords, expDim);
188  default:
189  return bins.closest(&coords, expDim);
190  }
191  }
void iHND_checkArgs(const HistoND< Float, Axis > &histo, const unsigned xDim, const unsigned interpolationDegree)

◆ interpolateHistoND() [3/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
unsigned  interpolationDegree 
)

Definition at line 194 of file interpolateHistoND.h.

References isotrackApplyRegressor::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), and mitigatedMETSequence_cff::U.

197  {
198  const unsigned expDim = 2U;
199  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
200  const Axis* ax = &histo.axes()[0];
201  double coords[expDim];
202  coords[0] = ax[0].fltBinNumber(x0, false);
203  coords[1] = ax[1].fltBinNumber(x1, false);
204  const ArrayND<Float>& bins(histo.binContents());
205  switch (interpolationDegree) {
206  case 1U:
207  return bins.interpolate1(coords, expDim);
208  case 3U:
209  return bins.interpolate3(coords, expDim);
210  default:
211  return bins.closest(coords, expDim);
212  }
213  }
void iHND_checkArgs(const HistoND< Float, Axis > &histo, const unsigned xDim, const unsigned interpolationDegree)

◆ interpolateHistoND() [4/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
unsigned  interpolationDegree 
)

Definition at line 216 of file interpolateHistoND.h.

References isotrackApplyRegressor::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), and mitigatedMETSequence_cff::U.

220  {
221  const unsigned expDim = 3U;
222  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
223  const Axis* ax = &histo.axes()[0];
224  double coords[expDim];
225  coords[0] = ax[0].fltBinNumber(x0, false);
226  coords[1] = ax[1].fltBinNumber(x1, false);
227  coords[2] = ax[2].fltBinNumber(x2, false);
228  const ArrayND<Float>& bins(histo.binContents());
229  switch (interpolationDegree) {
230  case 1U:
231  return bins.interpolate1(coords, expDim);
232  case 3U:
233  return bins.interpolate3(coords, expDim);
234  default:
235  return bins.closest(coords, expDim);
236  }
237  }
void iHND_checkArgs(const HistoND< Float, Axis > &histo, const unsigned xDim, const unsigned interpolationDegree)

◆ interpolateHistoND() [5/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
unsigned  interpolationDegree 
)

Definition at line 240 of file interpolateHistoND.h.

References isotrackApplyRegressor::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), and mitigatedMETSequence_cff::U.

245  {
246  const unsigned expDim = 4U;
247  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
248  const Axis* ax = &histo.axes()[0];
249  double coords[expDim];
250  coords[0] = ax[0].fltBinNumber(x0, false);
251  coords[1] = ax[1].fltBinNumber(x1, false);
252  coords[2] = ax[2].fltBinNumber(x2, false);
253  coords[3] = ax[3].fltBinNumber(x3, false);
254  const ArrayND<Float>& bins(histo.binContents());
255  switch (interpolationDegree) {
256  case 1U:
257  return bins.interpolate1(coords, expDim);
258  case 3U:
259  return bins.interpolate3(coords, expDim);
260  default:
261  return bins.closest(coords, expDim);
262  }
263  }
void iHND_checkArgs(const HistoND< Float, Axis > &histo, const unsigned xDim, const unsigned interpolationDegree)

◆ interpolateHistoND() [6/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
unsigned  interpolationDegree 
)

Definition at line 266 of file interpolateHistoND.h.

References isotrackApplyRegressor::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), and mitigatedMETSequence_cff::U.

272  {
273  const unsigned expDim = 5U;
274  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
275  const Axis* ax = &histo.axes()[0];
276  double coords[expDim];
277  coords[0] = ax[0].fltBinNumber(x0, false);
278  coords[1] = ax[1].fltBinNumber(x1, false);
279  coords[2] = ax[2].fltBinNumber(x2, false);
280  coords[3] = ax[3].fltBinNumber(x3, false);
281  coords[4] = ax[4].fltBinNumber(x4, false);
282  const ArrayND<Float>& bins(histo.binContents());
283  switch (interpolationDegree) {
284  case 1U:
285  return bins.interpolate1(coords, expDim);
286  case 3U:
287  return bins.interpolate3(coords, expDim);
288  default:
289  return bins.closest(coords, expDim);
290  }
291  }
void iHND_checkArgs(const HistoND< Float, Axis > &histo, const unsigned xDim, const unsigned interpolationDegree)

◆ interpolateHistoND() [7/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
unsigned  interpolationDegree 
)

Definition at line 294 of file interpolateHistoND.h.

References isotrackApplyRegressor::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), and mitigatedMETSequence_cff::U.

301  {
302  const unsigned expDim = 6U;
303  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
304  const Axis* ax = &histo.axes()[0];
305  double coords[expDim];
306  coords[0] = ax[0].fltBinNumber(x0, false);
307  coords[1] = ax[1].fltBinNumber(x1, false);
308  coords[2] = ax[2].fltBinNumber(x2, false);
309  coords[3] = ax[3].fltBinNumber(x3, false);
310  coords[4] = ax[4].fltBinNumber(x4, false);
311  coords[5] = ax[5].fltBinNumber(x5, false);
312  const ArrayND<Float>& bins(histo.binContents());
313  switch (interpolationDegree) {
314  case 1U:
315  return bins.interpolate1(coords, expDim);
316  case 3U:
317  return bins.interpolate3(coords, expDim);
318  default:
319  return bins.closest(coords, expDim);
320  }
321  }
void iHND_checkArgs(const HistoND< Float, Axis > &histo, const unsigned xDim, const unsigned interpolationDegree)

◆ interpolateHistoND() [8/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
unsigned  interpolationDegree 
)

Definition at line 324 of file interpolateHistoND.h.

References isotrackApplyRegressor::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), and mitigatedMETSequence_cff::U.

332  {
333  const unsigned expDim = 7U;
334  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
335  const Axis* ax = &histo.axes()[0];
336  double coords[expDim];
337  coords[0] = ax[0].fltBinNumber(x0, false);
338  coords[1] = ax[1].fltBinNumber(x1, false);
339  coords[2] = ax[2].fltBinNumber(x2, false);
340  coords[3] = ax[3].fltBinNumber(x3, false);
341  coords[4] = ax[4].fltBinNumber(x4, false);
342  coords[5] = ax[5].fltBinNumber(x5, false);
343  coords[6] = ax[6].fltBinNumber(x6, false);
344  const ArrayND<Float>& bins(histo.binContents());
345  switch (interpolationDegree) {
346  case 1U:
347  return bins.interpolate1(coords, expDim);
348  case 3U:
349  return bins.interpolate3(coords, expDim);
350  default:
351  return bins.closest(coords, expDim);
352  }
353  }
void iHND_checkArgs(const HistoND< Float, Axis > &histo, const unsigned xDim, const unsigned interpolationDegree)

◆ interpolateHistoND() [9/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
unsigned  interpolationDegree 
)

Definition at line 356 of file interpolateHistoND.h.

References isotrackApplyRegressor::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), and mitigatedMETSequence_cff::U.

365  {
366  const unsigned expDim = 8U;
367  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
368  const Axis* ax = &histo.axes()[0];
369  double coords[expDim];
370  coords[0] = ax[0].fltBinNumber(x0, false);
371  coords[1] = ax[1].fltBinNumber(x1, false);
372  coords[2] = ax[2].fltBinNumber(x2, false);
373  coords[3] = ax[3].fltBinNumber(x3, false);
374  coords[4] = ax[4].fltBinNumber(x4, false);
375  coords[5] = ax[5].fltBinNumber(x5, false);
376  coords[6] = ax[6].fltBinNumber(x6, false);
377  coords[7] = ax[7].fltBinNumber(x7, false);
378  const ArrayND<Float>& bins(histo.binContents());
379  switch (interpolationDegree) {
380  case 1U:
381  return bins.interpolate1(coords, expDim);
382  case 3U:
383  return bins.interpolate3(coords, expDim);
384  default:
385  return bins.closest(coords, expDim);
386  }
387  }
void iHND_checkArgs(const HistoND< Float, Axis > &histo, const unsigned xDim, const unsigned interpolationDegree)

◆ interpolateHistoND() [10/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
unsigned  interpolationDegree 
)

Definition at line 390 of file interpolateHistoND.h.

References isotrackApplyRegressor::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), and mitigatedMETSequence_cff::U.

400  {
401  const unsigned expDim = 9U;
402  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
403  const Axis* ax = &histo.axes()[0];
404  double coords[expDim];
405  coords[0] = ax[0].fltBinNumber(x0, false);
406  coords[1] = ax[1].fltBinNumber(x1, false);
407  coords[2] = ax[2].fltBinNumber(x2, false);
408  coords[3] = ax[3].fltBinNumber(x3, false);
409  coords[4] = ax[4].fltBinNumber(x4, false);
410  coords[5] = ax[5].fltBinNumber(x5, false);
411  coords[6] = ax[6].fltBinNumber(x6, false);
412  coords[7] = ax[7].fltBinNumber(x7, false);
413  coords[8] = ax[8].fltBinNumber(x8, false);
414  const ArrayND<Float>& bins(histo.binContents());
415  switch (interpolationDegree) {
416  case 1U:
417  return bins.interpolate1(coords, expDim);
418  case 3U:
419  return bins.interpolate3(coords, expDim);
420  default:
421  return bins.closest(coords, expDim);
422  }
423  }
void iHND_checkArgs(const HistoND< Float, Axis > &histo, const unsigned xDim, const unsigned interpolationDegree)

◆ interpolateHistoND() [11/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
double  x9,
unsigned  interpolationDegree 
)

Definition at line 426 of file interpolateHistoND.h.

References isotrackApplyRegressor::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), and mitigatedMETSequence_cff::U.

437  {
438  const unsigned expDim = 10U;
439  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
440  const Axis* ax = &histo.axes()[0];
441  double coords[expDim];
442  coords[0] = ax[0].fltBinNumber(x0, false);
443  coords[1] = ax[1].fltBinNumber(x1, false);
444  coords[2] = ax[2].fltBinNumber(x2, false);
445  coords[3] = ax[3].fltBinNumber(x3, false);
446  coords[4] = ax[4].fltBinNumber(x4, false);
447  coords[5] = ax[5].fltBinNumber(x5, false);
448  coords[6] = ax[6].fltBinNumber(x6, false);
449  coords[7] = ax[7].fltBinNumber(x7, false);
450  coords[8] = ax[8].fltBinNumber(x8, false);
451  coords[9] = ax[9].fltBinNumber(x9, false);
452  const ArrayND<Float>& bins(histo.binContents());
453  switch (interpolationDegree) {
454  case 1U:
455  return bins.interpolate1(coords, expDim);
456  case 3U:
457  return bins.interpolate3(coords, expDim);
458  default:
459  return bins.closest(coords, expDim);
460  }
461  }
void iHND_checkArgs(const HistoND< Float, Axis > &histo, const unsigned xDim, const unsigned interpolationDegree)

◆ interpolation_coefficients() [1/3]

template<typename T >
unsigned npstat::interpolation_coefficients ( T buffer,
unsigned  bufLen,
const T f0,
const T f1 
)

Get the coefficients of the interpolating polynomial. The interpolated function values are provided at 0, 1, ... The return value of the function is the number of coefficients (i.e., the polynomial degree plus one). On exit, the coefficients are placed into the "buffer" array in the order of increasing monomial degree. The length of the provided buffer must be sufficient to hold all these coefficients.

Definition at line 73 of file interpolate.h.

References edmScanValgrind::buffer, validate-o2o-wbm::f1, and mitigatedMETSequence_cff::U.

73  {
74  if (bufLen <= 1U)
76  "In npstat::interpolation_coefficients: "
77  "insufficient length of the output buffer");
78  buffer[0] = f0;
79  buffer[1] = f1 - f0;
80  return 2U;
81  }

◆ interpolation_coefficients() [2/3]

template<typename T >
unsigned npstat::interpolation_coefficients ( T buffer,
unsigned  bufLen,
const T f0,
const T f1,
const T f2 
)

Definition at line 84 of file interpolate.h.

References edmScanValgrind::buffer, validate-o2o-wbm::f1, validate-o2o-wbm::f2, and mitigatedMETSequence_cff::U.

84  {
85  if (bufLen <= 2U)
87  "In npstat::interpolation_coefficients: "
88  "insufficient length of the output buffer");
89  buffer[0] = f0;
90  buffer[1] = static_cast<T>((f1 - f2 + 3 * (f1 - f0)) / 2.0);
91  buffer[2] = static_cast<T>(((f0 - f1) + (f2 - f1)) / 2.0);
92  return 3U;
93  }
long double T

◆ interpolation_coefficients() [3/3]

template<typename T >
unsigned npstat::interpolation_coefficients ( T buffer,
unsigned  bufLen,
const T f0,
const T f1,
const T f2,
const T f3 
)

Definition at line 96 of file interpolate.h.

References edmScanValgrind::buffer, validate-o2o-wbm::f1, validate-o2o-wbm::f2, and mitigatedMETSequence_cff::U.

97  {
98  if (bufLen <= 3U)
100  "In npstat::interpolation_coefficients: "
101  "insufficient length of the output buffer");
102  buffer[0] = f0;
103  buffer[1] = static_cast<T>((11 * (f1 - f0) + 7 * (f1 - f2) + 2 * (f3 - f2)) / 6.0);
104  buffer[2] = static_cast<T>((2 * (f0 - f1) + 3 * (f2 - f1) + (f2 - f3)) / 2.0);
105  buffer[3] = static_cast<T>(((f3 - f0) + 3 * (f1 - f2)) / 6.0);
106  return 4U;
107  }
long double T

◆ isMonotonous()

template<class Iter >
bool npstat::isMonotonous ( Iter const  begin,
Iter const  end 
)
inline

Check if the sequence of values is either non-increasing or non-decreasing

Definition at line 79 of file isMonotonous.h.

References isNonDecreasing(), and isNonIncreasing().

79  {
81  }
bool isNonDecreasing(Iter begin, Iter const end)
Definition: isMonotonous.h:50
bool isNonIncreasing(Iter begin, Iter const end)
Definition: isMonotonous.h:63

◆ isNonDecreasing()

template<class Iter >
bool npstat::isNonDecreasing ( Iter  begin,
Iter const  end 
)
inline

Check if the sequence of values is not decreasing

Definition at line 50 of file isMonotonous.h.

References dqmdumpme::first, and mps_update::status.

Referenced by isMonotonous().

50  {
51  if (begin == end)
52  return false;
53  Iter first(begin);
54  bool status = ++begin != end;
55  for (; begin != end && status; ++begin, ++first)
56  if (*begin < *first)
57  status = false;
58  return status;
59  }

◆ isNonIncreasing()

template<class Iter >
bool npstat::isNonIncreasing ( Iter  begin,
Iter const  end 
)
inline

Check if the sequence of values is not increasing

Definition at line 63 of file isMonotonous.h.

References dqmdumpme::first, and mps_update::status.

Referenced by isMonotonous().

63  {
64  if (begin == end)
65  return false;
66  Iter first(begin);
67  bool status = ++begin != end;
68  for (; begin != end && status; ++begin, ++first)
69  if (*begin > *first)
70  status = false;
71  return status;
72  }

◆ isStrictlyDecreasing()

template<class Iter >
bool npstat::isStrictlyDecreasing ( Iter  begin,
Iter const  end 
)
inline

Check if the sequence of values is strictly decreasing

Definition at line 31 of file isMonotonous.h.

References dqmdumpme::first, and mps_update::status.

Referenced by isStrictlyMonotonous().

31  {
32  if (begin == end)
33  return false;
34  Iter first(begin);
35  bool status = ++begin != end;
36  for (; begin != end && status; ++begin, ++first)
37  if (!(*begin < *first))
38  status = false;
39  return status;
40  }

◆ isStrictlyIncreasing()

template<class Iter >
bool npstat::isStrictlyIncreasing ( Iter  begin,
Iter const  end 
)
inline

Check if the sequence of values is strictly increasing

Definition at line 18 of file isMonotonous.h.

References dqmdumpme::first, and mps_update::status.

Referenced by isStrictlyMonotonous().

18  {
19  if (begin == end)
20  return false;
21  Iter first(begin);
22  bool status = ++begin != end;
23  for (; begin != end && status; ++begin, ++first)
24  if (!(*first < *begin))
25  status = false;
26  return status;
27  }

◆ isStrictlyMonotonous()

template<class Iter >
bool npstat::isStrictlyMonotonous ( Iter const  begin,
Iter const  end 
)
inline

Check if the sequence of values is strictly increasing or decreasing

Definition at line 44 of file isMonotonous.h.

References isStrictlyDecreasing(), and isStrictlyIncreasing().

Referenced by npstat::Private::lind_invert1DSlice().

44  {
46  }
bool isStrictlyIncreasing(Iter begin, Iter const end)
Definition: isMonotonous.h:18
bool isStrictlyDecreasing(Iter begin, Iter const end)
Definition: isMonotonous.h:31

◆ isSubShape()

bool npstat::isSubShape ( const ArrayShape sh1,
const ArrayShape sh2 
)

This function returns true if the number of elements is the same in both vectors and every element of the first vector does not exceed corresponding element of the second

Definition at line 169 of file ArrayShape.cc.

References mps_fire::i.

169  {
170  const unsigned len = sh1.size();
171  if (len != sh2.size())
172  return false;
173  for (unsigned i = 0; i < len; ++i)
174  if (sh1[i] > sh2[i])
175  return false;
176  return true;
177  }

◆ makeBuffer()

template<typename T >
T* npstat::makeBuffer ( unsigned  sizeNeeded,
T stackBuffer,
unsigned  sizeofStackBuffer 
)
inline

◆ makeShape() [1/12]

ArrayShape npstat::makeShape ( )

This convenience function will construct an array shape using an explicit list of indices

Definition at line 7 of file ArrayShape.cc.

7 { return ArrayShape(); }
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21

◆ makeShape() [2/12]

ArrayShape npstat::makeShape ( unsigned  i0)

Definition at line 9 of file ArrayShape.cc.

9 { return ArrayShape(1, i0); }
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21

◆ makeShape() [3/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1 
)

Definition at line 11 of file ArrayShape.cc.

References testProducerWithPsetDescEmpty_cfi::i1, and alignCSCRings::s.

11  {
12  ArrayShape s;
13  s.reserve(2);
14  s.push_back(i0);
15  s.push_back(i1);
16  return s;
17  }
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21

◆ makeShape() [4/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2 
)

Definition at line 19 of file ArrayShape.cc.

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, and alignCSCRings::s.

19  {
20  ArrayShape s;
21  s.reserve(3);
22  s.push_back(i0);
23  s.push_back(i1);
24  s.push_back(i2);
25  return s;
26  }
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21

◆ makeShape() [5/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3 
)

◆ makeShape() [6/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4 
)

Definition at line 38 of file ArrayShape.cc.

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and alignCSCRings::s.

38  {
39  ArrayShape s;
40  s.reserve(5);
41  s.push_back(i0);
42  s.push_back(i1);
43  s.push_back(i2);
44  s.push_back(i3);
45  s.push_back(i4);
46  return s;
47  }
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21

◆ makeShape() [7/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5 
)

Definition at line 49 of file ArrayShape.cc.

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and alignCSCRings::s.

49  {
50  ArrayShape s;
51  s.reserve(6);
52  s.push_back(i0);
53  s.push_back(i1);
54  s.push_back(i2);
55  s.push_back(i3);
56  s.push_back(i4);
57  s.push_back(i5);
58  return s;
59  }
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21

◆ makeShape() [8/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6 
)

Definition at line 61 of file ArrayShape.cc.

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and alignCSCRings::s.

61  {
62  ArrayShape s;
63  s.reserve(7);
64  s.push_back(i0);
65  s.push_back(i1);
66  s.push_back(i2);
67  s.push_back(i3);
68  s.push_back(i4);
69  s.push_back(i5);
70  s.push_back(i6);
71  return s;
72  }
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21

◆ makeShape() [9/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7 
)

Definition at line 74 of file ArrayShape.cc.

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and alignCSCRings::s.

75  {
76  ArrayShape s;
77  s.reserve(8);
78  s.push_back(i0);
79  s.push_back(i1);
80  s.push_back(i2);
81  s.push_back(i3);
82  s.push_back(i4);
83  s.push_back(i5);
84  s.push_back(i6);
85  s.push_back(i7);
86  return s;
87  }
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21

◆ makeShape() [10/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8 
)

Definition at line 89 of file ArrayShape.cc.

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and alignCSCRings::s.

97  {
98  ArrayShape s;
99  s.reserve(9);
100  s.push_back(i0);
101  s.push_back(i1);
102  s.push_back(i2);
103  s.push_back(i3);
104  s.push_back(i4);
105  s.push_back(i5);
106  s.push_back(i6);
107  s.push_back(i7);
108  s.push_back(i8);
109  return s;
110  }
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21

◆ makeShape() [11/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
unsigned  i9 
)

Definition at line 112 of file ArrayShape.cc.

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and alignCSCRings::s.

121  {
122  ArrayShape s;
123  s.reserve(10);
124  s.push_back(i0);
125  s.push_back(i1);
126  s.push_back(i2);
127  s.push_back(i3);
128  s.push_back(i4);
129  s.push_back(i5);
130  s.push_back(i6);
131  s.push_back(i7);
132  s.push_back(i8);
133  s.push_back(i9);
134  return s;
135  }
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21

◆ makeShape() [12/12]

ArrayShape npstat::makeShape ( const unsigned *  indices,
unsigned  nIndices 
)

Definition at line 137 of file ArrayShape.cc.

References cms::cuda::assert(), mps_fire::i, dqmdumpme::indices, and alignCSCRings::s.

137  {
138  ArrayShape s;
139  if (nIndices) {
140  assert(indices);
141  s.reserve(nIndices);
142  for (unsigned i = 0; i < nIndices; ++i)
143  s.push_back(indices[i]);
144  }
145  return s;
146  }
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
assert(be >=bs)

◆ transposeBuffer() [1/2]

template<typename T1 , typename T2 >
void npstat::transposeBuffer ( T1 *  dest,
const T2 *  source,
const unsigned long  dim 
)
inline

Copy a buffer (with possible type conversion on the fly) transposing it in the process (treating as a square matrix)

Definition at line 52 of file allocators.h.

References cms::cuda::assert(), mps_fire::dest, mps_fire::i, dqmiolumiharvest::j, and source.

52  {
53  if (dim) {
54  assert(dest);
55  assert(source);
56  for (unsigned long i = 0; i < dim; ++i) {
57  for (unsigned long j = 0; j < dim; ++j)
58  dest[j * dim] = static_cast<T1>(*source++);
59  ++dest;
60  }
61  }
62  }
assert(be >=bs)
static std::string const source
Definition: EdmProvDump.cc:49

◆ transposeBuffer() [2/2]

template<typename T1 , typename T2 >
void npstat::transposeBuffer ( T1 *  dest,
const T2 *  source,
const unsigned long  M,
const unsigned long  N 
)
inline

Copy a buffer (with possible type conversion on the fly) transposing it in the process (treating as an M x N matrix)

Definition at line 69 of file allocators.h.

References cms::cuda::assert(), mps_fire::dest, mps_fire::i, dqmiolumiharvest::j, N, and source.

69  {
70  if (M && N) {
71  assert(dest);
72  assert(source);
73  for (unsigned long i = 0; i < M; ++i) {
74  for (unsigned long j = 0; j < N; ++j)
75  dest[j * M] = static_cast<T1>(*source++);
76  ++dest;
77  }
78  }
79  }
assert(be >=bs)
#define N
Definition: blowfish.cc:9
static std::string const source
Definition: EdmProvDump.cc:49