CMS 3D CMS Logo

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

#include <EquidistantSequence.h>

Inheritance diagram for npstat::EquidistantInLinearSpace:

Public Member Functions

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

Private Member Functions

 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 i, and relval_parameters_module::step.

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

Definition at line 27 of file EquidistantSequence.h.

27 {}
npstat::EquidistantInLinearSpace::EquidistantInLinearSpace ( )
private