All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
SpacePointTestUtils.cxx File Reference

Utilities for tests based on space points (implementation file) More...

#include "SpacePointTestUtils.h"
#include <utility>
#include <cmath>
#include <array>

Go to the source code of this file.

Functions

std::pair< int, int > ComputeRangeIndices (double min, double max, double stepSize)
 

Detailed Description

Utilities for tests based on space points (implementation file)

Author
Gianluca Petrillo (petri.nosp@m.llo@.nosp@m.fnal..nosp@m.gov)
Date
June 3, 2016
See Also
SpacePointTestUtils.h

Definition in file SpacePointTestUtils.cxx.

Function Documentation

std::pair< int, int > ComputeRangeIndices ( double  min,
double  max,
double  stepSize 
)

Definition at line 81 of file SpacePointTestUtils.cxx.

82 {
83  if (min >= max) return { 0, 0 };
84 
85  double const center = (min + max) / 2.;
86  return { -int((center - min) / stepSize), int((max - center) / stepSize) };
87 
88 } // ::ComputeRangeIndices()