CMS 3D CMS Logo

PiecewiseScalingPolynomial.cc
Go to the documentation of this file.
1 #include <climits>
2 
4 
6  const std::vector<double>& limits)
7  : coeffs_(coeffs), limits_(limits) {
8  if (!validate())
9  throw cms::Exception("Invalid PiecewiseScalingPolynomial constructor arguments");
10 }
11 
13  const std::size_t nLimits(limits_.size());
14  if (!nLimits)
15  return false;
16  if (nLimits >= static_cast<std::size_t>(UINT_MAX))
17  return false;
18  if (limits_[0] <= 0.0)
19  return false;
20  for (std::size_t i = 0; i < nLimits - 1; ++i)
21  if (!(limits_[i] < limits_[i + 1]))
22  return false;
23  if (coeffs_.size() != nLimits + 1)
24  return false;
25  for (std::size_t i = 0; i <= nLimits; ++i) {
26  if (coeffs_[i].empty())
27  return false;
28  if (coeffs_[i].size() >= static_cast<std::size_t>(INT_MAX))
29  return false;
30  }
31  return true;
32 }
mps_fire.i
i
Definition: mps_fire.py:428
PiecewiseScalingPolynomial.h
PiecewiseScalingPolynomial::PiecewiseScalingPolynomial
PiecewiseScalingPolynomial()
Definition: PiecewiseScalingPolynomial.h:13
PiecewiseScalingPolynomial::limits_
std::vector< double > limits_
Definition: PiecewiseScalingPolynomial.h:48
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
PiecewiseScalingPolynomial::validate
bool validate() const
Definition: PiecewiseScalingPolynomial.cc:12
TH2PolyOfflineMaps.limits
limits
Definition: TH2PolyOfflineMaps.py:45
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
Exception
Definition: hltDiff.cc:245
PiecewiseScalingPolynomial::coeffs_
std::vector< std::vector< double > > coeffs_
Definition: PiecewiseScalingPolynomial.h:47
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443