checkIdx Struct Reference

Static Public Member Functions

template<typename ArrType >
static int doCheck_ (ArrType e, int flags, int dummy, std::set< uint64_t > &found, std::map< uint64_t, int > const &expected)
 
static int run (std::vector< int > e, int flags, int dummy, std::set< uint64_t > &found, std::map< uint64_t, int > const &expected)
 
template<std::size_t N>
static int run (std::array< int, N > e, int flags, int dummy, std::set< uint64_t > &found, std::map< uint64_t, int > const &expected)
 

Member Function Documentation

◆ doCheck_()

template<typename ArrType >
static int checkIdx::doCheck_ ( ArrType  e,
int  flags,
int  dummy,
std::set< uint64_t > &  found,
std::map< uint64_t, int > const &  expected 
)
inlinestatic
50  {
51  // use decimal representation of value
52  uint64_t value = e[0];
53  for (std::size_t i = 1; i < e.size(); i++) value = value * 10 + e[i];
54 
55  // we want to make sure that we find each element
56  auto it = expected.find(value);
57  VERIFY((it != expected.end()));
58  VERIFY_IS_EQUAL(it->second, flags);
59 
60  // we want to make sure we only have each element once;
61  // set::insert returns true for the second part of the pair
62  // if the element was really inserted and not already there
63  auto p = found.insert(value);
64  VERIFY((p.second));
65 
66  return dummy;
67  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Array< double, 1, 3 > e(1./3., 0.5, 2.)
float * p
Definition: Tutorial_Map_using.cpp:9
#define VERIFY(a)
Definition: main.h:362
#define VERIFY_IS_EQUAL(a, b)
Definition: main.h:367
std::uint64_t uint64_t
Definition: Meta.h:42
squared absolute value
Definition: GlobalFunctions.h:87
bool found
Definition: MergeRestartFiles.py:24

References e(), MergeRestartFiles::found, i, p, Eigen::value, VERIFY, and VERIFY_IS_EQUAL.

Referenced by run().

◆ run() [1/2]

template<std::size_t N>
static int checkIdx::run ( std::array< int, N e,
int  flags,
int  dummy,
std::set< uint64_t > &  found,
std::map< uint64_t, int > const &  expected 
)
inlinestatic
76  {
77  return doCheck_(e, flags, dummy, found, expected);
78  }
static int doCheck_(ArrType e, int flags, int dummy, std::set< uint64_t > &found, std::map< uint64_t, int > const &expected)
Definition: cxx11_tensor_symmetry.cpp:49

References doCheck_(), e(), and MergeRestartFiles::found.

◆ run() [2/2]

static int checkIdx::run ( std::vector< int e,
int  flags,
int  dummy,
std::set< uint64_t > &  found,
std::map< uint64_t, int > const &  expected 
)
inlinestatic
70  {
71  return doCheck_(e, flags, dummy, found, expected);
72  }

References doCheck_(), e(), and MergeRestartFiles::found.


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