1 #ifndef _tst_Validatrix_h_
2 #define _tst_Validatrix_h_
5 #include <utl/TimeDistribution.h>
36 struct Type<char> {
static const char Code =
'i'; };
39 struct Type<short> {
static const char Code =
'i'; };
42 struct Type<int> {
static const char Code =
'i'; };
45 struct Type<long> {
static const char Code =
'i'; };
48 struct Type<unsigned char> {
static const char Code =
'u'; };
51 struct Type<unsigned short> {
static const char Code =
'u'; };
54 struct Type<unsigned int> {
static const char Code =
'u'; };
57 struct Type<unsigned long> {
static const char Code =
'u'; };
60 struct Type<float> {
static char const Code =
'd'; };
63 struct Type<double> {
static char const Code =
'd'; };
70 const char comp[] = {
'e',
'a',
'r' };
83 std::ostringstream os;
86 os <<
'[' << n <<
']';
89 os <<
'@' << tolerance;
91 for (std::size_t i = 0; i < n; ++i)
100 {
return Pack(1, &value, c, tolerance); }
112 {
return Pack(vec.size(), &vec.front(),
c, tolerance); }
122 for (
const auto& tv : td.SparseRange()) {
123 res.append(
Pack(tv.template get<0>(),
eEqual));
124 res.append(
Pack(tv.template get<1>(), c, tolerance));
136 inline std::string
BeEqual(
const std::size_t n,
const T*
const v)
147 inline std::string
CloseAbs(
const std::size_t n,
const T*
const v,
159 inline std::string
BeCloseRel(
const std::size_t n,
const T*
const v,
164 std::string
BeLabel(
const std::string& tag);
167 bool Compare(
const std::string& oldFilename,
const std::string& newFilename,
const bool failOnFirst =
true);
170 bool Compare(std::istream& s1, std::istream& s2,
const bool failOnFirst =
true);
std::string BeCloseRel(const T &value, const double tolerance=kDefaultTolerance)
char CompareCode(const CompareType c)
Histogram class for time distributions with suppressed empty bins.
std::string BeCloseAbs(const T &value, const double tolerance=kDefaultTolerance)
bool Compare(const string &oldFilename, const string &newFilename, const bool failOnFirst)
std::string BeLabel(const string &tag)
std::string Pack(const std::size_t n, const T *const v, const CompareType c, const double tolerance=kDefaultTolerance)
const double kDefaultTolerance
std::string BeEqual(const T &value)
Template class for a FADC data or calibrated data container. Use the typedefs (TraceD, TraceI, etc.) defined in Trace-fwd.h.
std::string CloseAbs(const std::size_t n, const T *const v, const double tolerance=kDefaultTolerance)