1 #ifndef NPSTAT_STORABLEINTERPOLATIONFUNCTOR_HH_
2 #define NPSTAT_STORABLEINTERPOLATIONFUNCTOR_HH_
27 class Axis = UniformAxis,
28 class Converter = Same<Numeric>
32 template <
typename Num2,
typename Axis2,
typename Conv2>
53 template <
class Num2,
class Conv2>
66 const std::vector<Axis>& axes,
67 const std::vector<std::pair<bool,bool> >& interpolationType,
68 const char* functionLabel=0)
70 table_(axes, interpolationType, functionLabel) {}
73 const Axis& xAxis,
bool leftX,
bool rightX,
74 const char* functionLabel=0)
76 table_(xAxis, leftX, rightX, functionLabel) {}
79 const Axis& xAxis,
bool leftX,
bool rightX,
80 const Axis& yAxis,
bool leftY,
bool rightY,
81 const char* functionLabel=0)
83 table_(xAxis, leftX, rightX,
84 yAxis, leftY, rightY, functionLabel) {}
87 const Axis& xAxis,
bool leftX,
bool rightX,
88 const Axis& yAxis,
bool leftY,
bool rightY,
89 const Axis&
zAxis,
bool leftZ,
bool rightZ,
90 const char* functionLabel=0)
92 table_(xAxis, leftX, rightX,
94 zAxis, leftZ, rightZ, functionLabel) {}
97 const Axis& xAxis,
bool leftX,
bool rightX,
98 const Axis& yAxis,
bool leftY,
bool rightY,
99 const Axis&
zAxis,
bool leftZ,
bool rightZ,
100 const Axis& tAxis,
bool leftT,
bool rightT,
101 const char* functionLabel=0)
103 table_(xAxis, leftX, rightX,
104 yAxis, leftY, rightY,
105 zAxis, leftZ, rightZ,
106 tAxis, leftT, rightT, functionLabel) {}
109 const Axis& xAxis,
bool leftX,
bool rightX,
110 const Axis& yAxis,
bool leftY,
bool rightY,
111 const Axis&
zAxis,
bool leftZ,
bool rightZ,
112 const Axis& tAxis,
bool leftT,
bool rightT,
113 const Axis& vAxis,
bool leftV,
bool rightV,
114 const char* functionLabel=0)
116 table_(xAxis, leftX, rightX,
117 yAxis, leftY, rightY,
118 zAxis, leftZ, rightZ,
119 tAxis, leftT, rightT,
120 vAxis, leftV, rightV, functionLabel) {}
147 virtual gs::ClassId
classId()
const {
return gs::ClassId(*
this);}
148 virtual bool write(std::ostream& of)
const;
155 const gs::ClassId&
id, std::istream&
in);
176 #include "Alignment/Geners/interface/binaryIO.hh"
177 #include "Alignment/Geners/interface/CPP11_auto_ptr.hh"
178 #include "Alignment/Geners/interface/IOException.hh"
181 template <
typename Numeric,
class Axis,
class Converter>
184 static const std::string myClass(gs::template_class_name<Numeric,Axis>(
185 "npstat::StorableInterpolationFunctor"));
186 return myClass.c_str();
189 template<
typename Numeric,
class Axis,
class Converter>
191 std::ostream& of)
const
197 template<
typename Numeric,
class Axis,
class Converter>
200 const gs::ClassId&
id, std::istream&
in)
202 static const gs::ClassId current(
204 current.ensureSameId(
id);
207 gs::read_pod(in, &descr);
208 gs::ClassId tabid(in, 1);
209 if (in.fail())
throw gs::IOReadFailure(
210 "In npstat::StorableInterpolationFunctor::read: "
211 "input stream failure");
218 #endif // NPSTAT_STORABLEINTERPOLATIONFUNCTOR_HH_
StorableInterpolationFunctor(const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const Axis &zAxis, bool leftZ, bool rightZ, const Axis &tAxis, bool leftT, bool rightT, const char *functionLabel=0)
virtual ~StorableInterpolationFunctor()
StorableInterpolationFunctor(const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const Axis &zAxis, bool leftZ, bool rightZ, const char *functionLabel=0)
static HepMC::IO_HEPEVT conv
StorableInterpolationFunctor(const LinInterpolatedTableND< Num2, Axis > &table)
virtual unsigned minDim() const
void setConverter(const Converter &conv)
Interface definition for storable multivariate functors.
static unsigned version()
LinInterpolatedTableND< Numeric, Axis > Table
ArrayND< Numeric > & table()
static StorableInterpolationFunctor * read(const gs::ClassId &id, std::istream &in)
const ArrayND< Numeric > & table() const
Multilinear interpolation/extrapolation on rectangular grids.
StorableInterpolationFunctor(const std::vector< Axis > &axes, const std::vector< std::pair< bool, bool > > &interpolationType, const char *functionLabel=0)
const ArrayND< Numeric > & table() const
StorableInterpolationFunctor(const StorableInterpolationFunctor< Num2, Axis, Conv2 > &tab)
const Table & interpolator() const
virtual double operator()(const double *point, unsigned dim) const
Interface definitions and concrete simple functors for a variety of functor-based calculations...
StorableInterpolationFunctor(const LinInterpolatedTableND< Num2, Axis > &table, const std::string &descr)
StorableInterpolationFunctor(const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const char *functionLabel=0)
virtual gs::ClassId classId() const
StorableInterpolationFunctor(const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const Axis &zAxis, bool leftZ, bool rightZ, const Axis &tAxis, bool leftT, bool rightT, const Axis &vAxis, bool leftV, bool rightV, const char *functionLabel=0)
StorableInterpolationFunctor()
StorableInterpolationFunctor(const Axis &xAxis, bool leftX, bool rightX, const char *functionLabel=0)
virtual bool write(std::ostream &of) const
static const char * classname()
const std::string & description() const
virtual bool isEqual(const StorableMultivariateFunctor &other) const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point