CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions
npstat::EquidistantInLinearSpace Class Reference

#include <EquidistantSequence.h>

Inheritance diagram for npstat::EquidistantInLinearSpace:

Public Member Functions

 EquidistantInLinearSpace (double minScale, double maxScale, unsigned nScales)
 
 EquidistantInLinearSpace ()=delete
 
virtual ~EquidistantInLinearSpace ()
 

Detailed Description

A sequence of points equidistant in linear space. Note that std::vector destructor is not virtual, so do not destroy this class by base pointer or reference.

Definition at line 22 of file EquidistantSequence.h.

Constructor & Destructor Documentation

npstat::EquidistantInLinearSpace::EquidistantInLinearSpace ( double  minScale,
double  maxScale,
unsigned  nScales 
)

Definition at line 7 of file EquidistantSequence.cc.

References mps_fire::i.

10  : std::vector<double>() {
11  switch (nScales) {
12  case 0:
13  break;
14 
15  case 1: {
16  this->reserve(nScales);
17  const double sc = (minScale == maxScale ? minScale : (minScale + maxScale) / 2.0);
18  push_back(sc);
19  } break;
20 
21  default: {
22  this->reserve(nScales);
23  const double step = (maxScale - minScale) / (nScales - 1);
24  push_back(minScale);
25  for (unsigned i = 1; i < nScales - 1; ++i)
26  push_back(minScale + i * step);
27  push_back(maxScale);
28  } break;
29  }
30  }
step
Definition: StallMonitor.cc:94
virtual npstat::EquidistantInLinearSpace::~EquidistantInLinearSpace ( )
inlinevirtual

Definition at line 25 of file EquidistantSequence.h.

25 {}
npstat::EquidistantInLinearSpace::EquidistantInLinearSpace ( )
delete