ATLAS Offline Software
Loading...
Searching...
No Matches
ArgStrToDouble Class Reference

#include <ArgStrToDouble.h>

Collaboration diagram for ArgStrToDouble:

Public Member Functions

double operator() (const std::string &s)

Private Attributes

std::vector< std::string > m_posinf {"inf", "+inf", "pinf", "INF"}
std::vector< std::string > m_neginf {"-inf", "ninf", "-INF"}

Detailed Description

Definition at line 13 of file ArgStrToDouble.h.

Member Function Documentation

◆ operator()()

double ArgStrToDouble::operator() ( const std::string & s)
inline

Definition at line 16 of file ArgStrToDouble.h.

16 {
17
18 double val{0};
19 if(std::find(m_posinf.begin(), m_posinf.end(), s) != m_posinf.end()){
20 val = std::numeric_limits<double>::max();}
21 else if (std::find(m_neginf.begin(), m_neginf.end(), s) != m_neginf.end()){
22 val = std::numeric_limits<double>::lowest();}
23 else {
24 val = std::stod(s);
25 }
26
27 return val;
28 }
std::vector< std::string > m_neginf
std::vector< std::string > m_posinf

Member Data Documentation

◆ m_neginf

std::vector<std::string> ArgStrToDouble::m_neginf {"-inf", "ninf", "-INF"}
private

Definition at line 33 of file ArgStrToDouble.h.

33{"-inf", "ninf", "-INF"};

◆ m_posinf

std::vector<std::string> ArgStrToDouble::m_posinf {"inf", "+inf", "pinf", "INF"}
private

Definition at line 32 of file ArgStrToDouble.h.

32{"inf", "+inf", "pinf", "INF"};

The documentation for this class was generated from the following file: