ATLAS Offline Software
Loading...
Searching...
No Matches
ArrayFunction.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "ArrayFunction.h"
6
7namespace GeoGenfun {
8
9FUNCTION_OBJECT_IMP(ArrayFunction)
10
11// Constructor
12ArrayFunction::ArrayFunction(const double *begin, const double *end) :
13 m_values(begin,end) {}
14
15// Destructor
17
18// Copy constructor
20 GeoGenfun::AbsFunction(), m_values(right.m_values) {}
21
22 // Retrieve function value
23double ArrayFunction::operator ()(double argument) const {
24 int i = int (argument+0.5);
25 if (i<0 || i>=int(m_values.size())) return 0;
26 else return m_values[i];
27}
28
29}
virtual double operator()(double argument) const override
ArrayFunction(const double *begin, const double *end)
std::vector< double > m_values