1 #ifndef NPSTAT_LININTERPOLATEDTABLEND_HH_
2 #define NPSTAT_LININTERPOLATEDTABLEND_HH_
18 #include "Alignment/Geners/interface/CPP11_auto_ptr.hh"
30 template <
class Numeric,
class Axis = UniformAxis>
32 template <
typename Num2,
typename Axis2>
54 const std::vector<std::pair<bool, bool> >& extrapolationType,
118 template <
class Num2>
133 Numeric
operator()(
const double& x0,
const double& x1)
const;
134 Numeric
operator()(
const double& x0,
const double& x1,
const double& x2)
const;
135 Numeric
operator()(
const double& x0,
const double& x1,
const double& x2,
const double& x3)
const;
136 Numeric
operator()(
const double& x0,
const double& x1,
const double& x2,
const double& x3,
const double& x4)
const;
142 inline const std::vector<Axis>&
axes()
const {
return axes_; }
143 inline const Axis&
axis(
const unsigned i)
const {
return axes_.at(i); }
158 void getCoords(
unsigned long linearIndex,
double* coords,
unsigned coordsBufferSize)
const;
181 template <
typename ConvertibleToUn
signed>
182 CPP11_auto_ptr<LinInterpolatedTableND>
invertWRTAxis(ConvertibleToUnsigned axisNumber,
183 const Axis& replacementAxis,
184 bool newAxisLeftLinear,
185 bool newAxisRightLinear,
210 template <
class Functor1,
class Functor2>
212 const Axis& replacementAxis,
213 bool newAxisLeftLinear,
214 bool newAxisRightLinear,
227 inline gs::ClassId
classId()
const {
return gs::ClassId(*
this); }
228 bool write(std::ostream&
of)
const;
232 static inline unsigned version() {
return 1; }
237 const std::vector<Axis>&
axes,
238 const char* leftInterpolation,
239 const char* rightInterpolation,
252 template <
class Functor1>
255 template <
class Functor1>
257 const Axis& fromAxis,
273 #include <functional>
275 #include "Alignment/Geners/interface/binaryIO.hh"
282 template <
class Axis>
284 const unsigned n = axes.size();
287 for (
unsigned i = 0;
i <
n; ++
i)
288 result.push_back(axes[
i].nCoords());
292 template <
class Axis>
296 result.push_back(xAxis.nCoords());
300 template <
class Axis>
304 result.push_back(xAxis.nCoords());
305 result.push_back(yAxis.nCoords());
309 template <
class Axis>
313 result.push_back(xAxis.nCoords());
314 result.push_back(yAxis.nCoords());
315 result.push_back(zAxis.nCoords());
319 template <
class Axis>
323 result.push_back(xAxis.nCoords());
324 result.push_back(yAxis.nCoords());
325 result.push_back(zAxis.nCoords());
326 result.push_back(tAxis.nCoords());
330 template <
class Axis>
332 const Axis& xAxis,
const Axis& yAxis,
const Axis&
zAxis,
const Axis& tAxis,
const Axis& vAxis) {
335 result.push_back(xAxis.nCoords());
336 result.push_back(yAxis.nCoords());
337 result.push_back(zAxis.nCoords());
338 result.push_back(tAxis.nCoords());
339 result.push_back(vAxis.nCoords());
344 const double x0,
const double x1,
const double y0,
const double y1,
const double x) {
345 return y0 + (y1 - y0) * ((x - x0) / (x1 - x0));
348 template <
typename Numeric,
class Axis>
350 const Axis& fromAxis,
352 const bool leftLinear,
353 const bool rightLinear,
359 const Numeric* fromData = fromSlice.
data();
360 const unsigned fromLen = fromSlice.
length();
362 assert(fromLen == fromAxis.nCoords());
363 const Numeric* fromDataEnd = fromData + fromLen;
366 "In npstat::Private::lind_invert1DSlice: "
367 "slice data is not monotonous and can not be inverted");
369 const Numeric yfirst = fromData[0];
370 const Numeric ylast = fromData[fromLen - 1U];
371 const bool increasing = yfirst < ylast;
373 Numeric* toD =
const_cast<Numeric*
>(toSlice->
data());
374 const unsigned nAxisPoints = toAxis.nCoords();
377 for (
unsigned ipt = 0; ipt < nAxisPoints; ++ipt) {
378 const Numeric y =
static_cast<Numeric
>(toAxis.coordinate(ipt));
383 yfirst, fromData[1], fromAxis.coordinate(0), fromAxis.coordinate(1), y);
385 toD[ipt] = fromAxis.coordinate(0);
386 }
else if (y >= ylast) {
389 fromData[fromLen - 2U],
390 fromAxis.coordinate(fromLen - 1U),
391 fromAxis.coordinate(fromLen - 2U),
394 toD[ipt] = fromAxis.coordinate(fromLen - 1U);
398 fromData[i - 1U], fromData[i], fromAxis.coordinate(i - 1U), fromAxis.coordinate(i), y);
406 fromData[fromLen - 2U],
407 fromAxis.coordinate(fromLen - 1U),
408 fromAxis.coordinate(fromLen - 2U),
411 toD[ipt] = fromAxis.coordinate(fromLen - 1U);
412 }
else if (y >= yfirst) {
415 yfirst, fromData[1], fromAxis.coordinate(0), fromAxis.coordinate(1), y);
417 toD[ipt] = fromAxis.coordinate(0);
419 const unsigned i =
std::lower_bound(fromData, fromDataEnd, y, std::greater<Numeric>()) - fromData;
421 fromData[i - 1U], fromData[i], fromAxis.coordinate(i - 1U), fromAxis.coordinate(i), y);
428 template <
class Numeric,
class Axis>
430 for (
unsigned i = 0;
i < dim_; ++
i)
431 if (leftInterpolationLinear_[
i] || rightInterpolationLinear_[
i])
436 template <
class Numeric,
class Axis>
440 for (
unsigned i = 0;
i < dim_; ++
i) {
449 template <
typename Numeric,
class Axis>
451 static const std::string myClass(gs::template_class_name<Numeric, Axis>(
"npstat::LinInterpolatedTableND"));
452 return myClass.c_str();
455 template <
typename Numeric,
class Axis>
457 const bool status = data_.classId().write(of) && data_.write(of) && gs::write_obj_vector(of, axes_);
459 gs::write_pod_array(of, leftInterpolationLinear_, dim_);
460 gs::write_pod_array(of, rightInterpolationLinear_, dim_);
461 gs::write_pod(of, functionLabel_);
463 return status && !of.fail();
466 template <
typename Numeric,
class Axis>
470 current.ensureSameId(
id);
472 gs::ClassId ida(in, 1);
475 std::vector<Axis> axes;
476 gs::read_heap_obj_vector_as_placed(in, &axes);
477 const unsigned dim = axes.size();
478 if (dim > CHAR_BIT *
sizeof(
unsigned long) || data.
rank() != dim)
479 throw gs::IOInvalidData(
480 "In npstat::LinInterpolatedTableND::read: "
481 "read back invalid dimensionality");
482 char leftInterpolation[CHAR_BIT *
sizeof(
unsigned long)];
483 gs::read_pod_array(in, leftInterpolation, dim);
484 char rightInterpolation[CHAR_BIT *
sizeof(
unsigned long)];
485 gs::read_pod_array(in, rightInterpolation, dim);
487 gs::read_pod(in, &label);
489 throw gs::IOReadFailure(
"In npstat::LinInterpolatedTableND::read: input stream failure");
493 template <
typename Numeric,
class Axis>
497 "In npstat::LinInterpolatedTableND::leftInterpolationLinear: "
498 "index out of range");
499 return leftInterpolationLinear_[
i];
502 template <
typename Numeric,
class Axis>
506 "In npstat::LinInterpolatedTableND::rightInterpolationLinear: "
507 "index out of range");
508 return rightInterpolationLinear_[
i];
511 template <
typename Numeric,
class Axis>
513 for (
unsigned i = 0;
i < dim_; ++
i)
514 if (!axes_[
i].isUniform())
519 template <
typename Numeric,
class Axis>
521 std::vector<std::pair<bool, bool> > vec;
523 for (
unsigned i = 0;
i < dim_; ++
i)
524 vec.push_back(std::pair<bool, bool>(leftInterpolationLinear_[
i], rightInterpolationLinear_[i]));
528 template <
typename Numeric,
class Axis>
530 const std::vector<Axis>& axes,
const std::vector<std::pair<bool, bool> >& interpolationType,
const char*
label)
531 : data_(Private::
makeTableShape(axes)), axes_(axes), functionLabel_(label ? label :
""), dim_(axes.
size()) {
532 if (
dim_ == 0 ||
dim_ >= CHAR_BIT *
sizeof(
unsigned long))
534 "In npstat::LinInterpolatedTableND constructor: requested "
535 "table dimensionality is not supported");
538 "In npstat::LinInterpolatedTableND constructor: "
539 "incompatible number of interpolation specifications");
540 for (
unsigned i = 0;
i <
dim_; ++
i) {
549 template <
typename Numeric,
class Axis>
550 template <
class Num2>
554 functionLabel_(r.functionLabel_),
556 allConstInterpolated_(r.allConstInterpolated_) {
557 for (
unsigned i = 0;
i <
dim_; ++
i) {
563 template <
typename Numeric,
class Axis>
565 const std::vector<Axis>& axes,
566 const char* leftInterpolation,
567 const char* rightInterpolation,
569 : data_(data), axes_(axes), functionLabel_(label), dim_(data.rank()) {
570 for (
unsigned i = 0;
i <
dim_; ++
i) {
577 template <
typename Numeric,
class Axis>
594 : data_(Private::
makeTableShape(xAxis, yAxis, zAxis, tAxis, vAxis)),
595 functionLabel_(label ? label :
""),
598 axes_.push_back(xAxis);
599 axes_.push_back(yAxis);
600 axes_.push_back(zAxis);
601 axes_.push_back(tAxis);
602 axes_.push_back(vAxis);
620 template <
typename Numeric,
class Axis>
634 : data_(Private::
makeTableShape(xAxis, yAxis, zAxis, tAxis)), functionLabel_(label ? label :
""), dim_(4U) {
636 axes_.push_back(xAxis);
637 axes_.push_back(yAxis);
638 axes_.push_back(zAxis);
639 axes_.push_back(tAxis);
655 template <
typename Numeric,
class Axis>
666 : data_(Private::
makeTableShape(xAxis, yAxis, zAxis)), functionLabel_(label ? label :
""), dim_(3U) {
668 axes_.push_back(xAxis);
669 axes_.push_back(yAxis);
670 axes_.push_back(zAxis);
684 template <
typename Numeric,
class Axis>
686 const Axis& xAxis,
bool leftX,
bool rightX,
const Axis& yAxis,
bool leftY,
bool rightY,
const char*
label)
687 : data_(Private::
makeTableShape(xAxis, yAxis)), functionLabel_(label ? label :
""), dim_(2U) {
689 axes_.push_back(xAxis);
690 axes_.push_back(yAxis);
702 template <
typename Numeric,
class Axis>
707 : data_(Private::
makeTableShape(xAxis)), functionLabel_(label ? label :
""), dim_(1U) {
709 axes_.push_back(xAxis);
717 template <
typename Numeric,
class Axis>
718 template <
typename ConvertibleToUn
signed>
720 const ConvertibleToUnsigned axisNumC,
721 const Axis& replacementAxis,
722 const bool leftLinear,
723 const bool rightLinear,
724 const char* functionLabel)
const {
725 const unsigned axisNumber =
static_cast<unsigned>(axisNumC);
727 if (axisNumber >= dim_)
729 "In npstat::LinInterpolatedTableND::invertAxis: "
730 "axis number is out of range");
733 std::vector<Axis> newAxes(axes_);
734 newAxes[axisNumber] = replacementAxis;
736 std::vector<std::pair<bool, bool> > iType(interpolationType());
737 iType[axisNumber] = std::pair<bool, bool>(leftLinear, rightLinear);
744 unsigned sliceIndex[CHAR_BIT *
sizeof(
unsigned long)];
745 unsigned fixedIndices[CHAR_BIT *
sizeof(
unsigned long)];
747 for (
unsigned i = 0;
i < dim_; ++
i)
748 if (
i != axisNumber) {
749 sliceIndex[
count] = data_.span(
i);
750 fixedIndices[count++] =
i;
757 scan.getIndex(sliceIndex, count);
758 data_.exportSlice(&parentSlice, fixedIndices, sliceIndex, count);
760 parentSlice, axes_[axisNumber], replacementAxis, leftLinear, rightLinear, &dauSlice);
761 pTable->data_.importSlice(dauSlice, fixedIndices, sliceIndex, count);
768 template <
typename Numeric,
class Axis>
769 template <
class Functor1,
class Functor2>
771 const unsigned axisNumber,
772 const Axis& replacementAxis,
773 const bool leftLinear,
774 const bool rightLinear,
777 const char* functionLabel)
const {
778 if (axisNumber >= dim_)
780 "In npstat::LinInterpolatedTableND::invertRatioResponse: "
781 "axis number is out of range");
784 std::vector<Axis> newAxes(axes_);
785 newAxes[axisNumber] = replacementAxis;
787 std::vector<std::pair<bool, bool> > iType(interpolationType());
788 iType[axisNumber] = std::pair<bool, bool>(leftLinear, rightLinear);
791 const Axis& oldAxis(axes_[axisNumber]);
792 std::vector<double> rawx;
793 const unsigned nCoords = oldAxis.nCoords();
794 rawx.reserve(nCoords);
795 for (
unsigned i = 0;
i < nCoords; ++
i) {
796 const double x = invg(oldAxis.coordinate(
i));
799 "In npstat::LinInterpolatedTableND::invertRatioResponse: "
800 "invalid original axis definition (negative transformed "
806 std::vector<double> rawf;
807 const unsigned nFuncs = replacementAxis.nCoords();
808 rawf.reserve(nFuncs);
809 for (
unsigned i = 0;
i < nFuncs; ++
i) {
810 const double f = invh(replacementAxis.coordinate(
i));
813 "In npstat::LinInterpolatedTableND::invertRatioResponse: "
814 "invalid new axis definition (negative transformed "
820 std::vector<double> workspace(nCoords);
827 unsigned sliceIndex[CHAR_BIT *
sizeof(
unsigned long)];
828 unsigned fixedIndices[CHAR_BIT *
sizeof(
unsigned long)];
830 for (
unsigned i = 0;
i < dim_; ++
i)
831 if (
i != axisNumber) {
832 sliceIndex[
count] = data_.span(
i);
833 fixedIndices[count++] =
i;
840 scan.getIndex(sliceIndex, count);
841 data_.exportSlice(&parentSlice, fixedIndices, sliceIndex, count);
842 invert1DResponse(parentSlice,
852 pTable->data_.importSlice(dauSlice, fixedIndices, sliceIndex, count);
855 invert1DResponse(data_,
868 template <
typename Numeric,
class Axis>
871 const unsigned coordsBufferSize)
const {
872 if (coordsBufferSize < dim_)
874 "In LinInterpolatedTableND::getCoords: "
875 "insufficient buffer size");
877 unsigned index[CHAR_BIT *
sizeof(
unsigned long)];
878 data_.convertLinearIndex(linearIndex,
index, dim_);
879 for (
unsigned i = 0;
i < dim_; ++
i)
883 template <
typename Numeric,
class Axis>
887 "In npstat::LinInterpolatedTableND::isWithinLimits: "
888 "incompatible point dimensionality");
891 for (
unsigned i = 0;
i < dim_; ++
i)
892 if (point[
i] < axes_[
i].
min() || point[
i] > axes_[
i].
max())
897 template <
typename Numeric,
class Axis>
903 "In npstat::LinInterpolatedTableND::operator(): "
904 "incompatible point dimensionality");
907 bool interpolateArray =
true;
908 if (!allConstInterpolated_)
909 for (
unsigned i = 0;
i < dim_; ++
i)
910 if ((leftInterpolationLinear_[
i] && point[
i] < axes_[
i].
min()) ||
911 (rightInterpolationLinear_[
i] && point[
i] > axes_[
i].
max())) {
912 interpolateArray =
false;
916 if (interpolateArray) {
919 double buf[CHAR_BIT *
sizeof(
unsigned long)];
920 for (
unsigned i = 0;
i < dim_; ++
i) {
921 const std::pair<unsigned, double>& pair = axes_[
i].getInterval(point[
i]);
922 buf[
i] = pair.first + 1U - pair.second;
924 return data_.interpolate1(
buf, dim_);
926 unsigned ix[CHAR_BIT *
sizeof(
unsigned long)];
927 double weight[CHAR_BIT *
sizeof(
unsigned long)];
928 for (
unsigned i = 0;
i < dim_; ++
i) {
929 const bool linear = (leftInterpolationLinear_[
i] && point[
i] < axes_[
i].min()) ||
930 (rightInterpolationLinear_[
i] && point[
i] > axes_[
i].
max());
931 const std::pair<unsigned, double>& pair =
932 linear ? axes_[
i].linearInterval(point[
i]) : axes_[
i].getInterval(point[i]);
937 Numeric sum = Numeric();
938 const unsigned long maxcycle = 1UL << dim_;
939 const unsigned long* strides = data_.strides();
940 const Numeric*
dat = data_.data();
941 for (
unsigned long icycle = 0UL; icycle < maxcycle; ++icycle) {
943 unsigned long icell = 0UL;
944 for (
unsigned i = 0;
i < dim_; ++
i) {
945 if (icycle & (1UL <<
i)) {
947 icell += strides[
i] * (ix[
i] + 1U);
950 icell += strides[
i] * ix[
i];
953 sum += dat[icell] *
static_cast<proper_double
>(
w);
959 template <
typename Numeric,
class Axis>
961 const unsigned nArgs = 1U;
964 "In npstat::LinInterpolatedTableND::operator(): number of "
965 "arguments, 1, is incompatible with the interpolator dimensionality");
968 return operator()(tmp, nArgs);
971 template <
typename Numeric,
class Axis>
973 const unsigned nArgs = 2U;
976 "In npstat::LinInterpolatedTableND::operator(): number of "
977 "arguments, 2, is incompatible with the interpolator dimensionality");
981 return operator()(tmp, nArgs);
984 template <
typename Numeric,
class Axis>
987 const double& x2)
const {
988 const unsigned nArgs = 3U;
991 "In npstat::LinInterpolatedTableND::operator(): number of "
992 "arguments, 3, is incompatible with the interpolator dimensionality");
997 return operator()(tmp, nArgs);
1000 template <
typename Numeric,
class Axis>
1004 const double& x3)
const {
1005 const unsigned nArgs = 4U;
1008 "In npstat::LinInterpolatedTableND::operator(): number of "
1009 "arguments, 4, is incompatible with the interpolator dimensionality");
1015 return operator()(tmp, nArgs);
1018 template <
typename Numeric,
class Axis>
1020 const double& x0,
const double& x1,
const double& x2,
const double& x3,
const double& x4)
const {
1021 const unsigned nArgs = 5U;
1024 "In npstat::LinInterpolatedTableND::operator(): number of "
1025 "arguments, 5, is incompatible with the interpolator dimensionality");
1032 return operator()(tmp, nArgs);
1035 template <
typename Numeric,
class Axis>
1036 template <
class Functor1>
1038 const double xmin,
const double xmax,
const double rmin,
const double rmax,
const double fval,
Functor1 invg) {
1042 double fmin = invg(xmin) * rmin;
1043 double fmax = invg(xmax) * rmax;
1048 unsigned stepcount = 0;
1049 const unsigned maxSteps = 1000U;
1050 for (
double stepfactor = 1.0; (fval < fmin || fval > fmax) && stepcount < maxSteps; stepfactor *= 2.0, ++stepcount)
1054 x0 -= stepfactor *
step;
1059 x1 += stepfactor *
step;
1062 if (stepcount == maxSteps)
1064 "In LinInterpolatedTableND::solveForRatioArg: "
1065 "faled to bracket the root");
1068 while ((x1 - x0) / (
std::abs(x1) +
std::abs(x0) + DBL_EPSILON) > 4.0 * DBL_EPSILON) {
1069 const double xhalf = (x1 + x0) / 2.0;
1079 return (x1 + x0) / 2.0;
1082 template <
typename Numeric,
class Axis>
1083 template <
class Functor1>
1085 const Axis& fromAxis,
1087 const bool newLeftLinear,
1088 const bool newRightLinear,
1098 const Numeric
zero = Numeric();
1099 const Numeric* fromData = fromSlice.
data();
1100 const unsigned fromLen = fromSlice.
length();
1102 assert(fromLen == fromAxis.nCoords());
1103 Numeric* toD =
const_cast<Numeric*
>(toSlice->
data());
1104 const unsigned nAxisPoints = toAxis.nCoords();
1107 for (
unsigned i = 0;
i < fromLen; ++
i) {
1108 if (fromData[
i] <= zero)
1110 "In LinInterpolatedTableND::invert1DResponse: "
1111 "non-positive response found. This ratio "
1112 "response table is not invertible.");
1113 workspace[
i] = rawx[
i] * fromData[
i];
1116 const double yfirst = workspace[0];
1117 const double ylast = workspace[fromLen - 1U];
1119 bool adjustZero =
false;
1120 unsigned nBelow = 0;
1121 for (
unsigned ipt = 0; ipt < nAxisPoints; ++ipt) {
1122 const double y = rawf[ipt];
1129 }
else if (y <= yfirst) {
1131 solve = newLeftLinear;
1132 }
else if (y >= ylast) {
1133 solve = newRightLinear;
1134 i0 = solve ? fromLen - 2 : fromLen - 1;
1137 i0 =
static_cast<unsigned>(
std::lower_bound(workspace, workspace + fromLen, y) - workspace) - 1U;
1140 const double x = solveForRatioArg(
1141 fromAxis.coordinate(i0), fromAxis.coordinate(i0 + 1), fromData[i0], fromData[i0 + 1], y, invg);
1142 toD[ipt] = invg(x) / y;
1144 toD[ipt] = 1.0 / fromData[i0];
1146 if (adjustZero && nBelow)
1151 #endif // NPSTAT_LININTERPOLATEDTABLEND_HH_
bool rightInterpolationLinear(unsigned i) const
std::unique_ptr< LinInterpolatedTableND > invertRatioResponse(unsigned axisNumber, const Axis &replacementAxis, bool newAxisLeftLinear, bool newAxisRightLinear, Functor1 invg, Functor2 invh, const char *functionLabel=nullptr) const
static void invert1DResponse(const ArrayND< Numeric > &fromSlice, const Axis &fromAxis, const Axis &toAxis, bool newLeftLinear, bool newRightLinear, Functor1 invg, const double *rawx, const double *rawf, double *workspace, ArrayND< Numeric > *toSlice)
bool allConstInterpolated_
void getCoords(unsigned long linearIndex, double *coords, unsigned coordsBufferSize) const
std::vector< unsigned > ArrayShape
unsigned long length() const
std::string functionLabel_
const ArrayND< Numeric > & table() const
static double solveForRatioArg(double xmin, double xmax, double rmin, double rmax, double fval, Functor1 invg)
Numeric operator()(const double *point, unsigned dim) const
unsigned long length() const
bool write(std::ostream &of) const
A few simple template functions for checking monotonicity of container values.
bool operator==(const LinInterpolatedTableND &) const
LinInterpolatedTableND()=delete
std::vector< std::pair< bool, bool > > interpolationType() const
const std::vector< Axis > & axes() const
static LinInterpolatedTableND * read(const gs::ClassId &id, std::istream &in)
bool operator!=(const LinInterpolatedTableND &r) const
std::vector< Axis > axes_
Abs< T >::type abs(const T &t)
const Numeric * data() const
void setFunctionLabel(const char *newlabel)
char rightInterpolationLinear_[CHAR_BIT *sizeof(unsigned long)]
static unsigned version()
bool isUniformlyBinned() const
char leftInterpolationLinear_[CHAR_BIT *sizeof(unsigned long)]
bool leftInterpolationLinear(unsigned i) const
double lind_interpolateSimple(const double x0, const double x1, const double y0, const double y1, const double x)
ArrayND< Numeric > & table()
bool isStrictlyMonotonous(Iter const begin, Iter const end)
static void restore(const gs::ClassId &id, std::istream &in, ArrayND *array)
bool allConstInterpolated() const
static std::vector< std::string > checklist dat
std::unique_ptr< LinInterpolatedTableND > invertWRTAxis(ConvertibleToUnsigned axisNumber, const Axis &replacementAxis, bool newAxisLeftLinear, bool newAxisRightLinear, const char *functionLabel=nullptr) const
ArrayShape makeTableShape(const std::vector< Axis > &axes)
void lind_invert1DSlice(const ArrayND< Numeric > &fromSlice, const Axis &fromAxis, const Axis &toAxis, const bool leftLinear, const bool rightLinear, ArrayND< Numeric > *toSlice)
bool isWithinLimits(const double *point, unsigned dim) const
char data[epos_bytes_allocation]
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
const Axis & axis(const unsigned i) const
const std::string & functionLabel() const
Iteration over indices of a multidimensional array.
static const char * classname()
tuple size
Write out results.
gs::ClassId classId() const
Arbitrary-dimensional array template.
*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