Xmipp  v3.23.11-Nereus
Public Member Functions | List of all members
cif::row_comparator Class Reference

Public Member Functions

 row_comparator (category &cat)
 
int operator() (const row *a, const row *b) const
 
int operator() (const row_initializer &a, const row *b) const
 

Detailed Description

Definition at line 46 of file category.cpp.

Constructor & Destructor Documentation

◆ row_comparator()

cif::row_comparator::row_comparator ( category &  cat)
inline

Definition at line 49 of file category.cpp.

50  : m_category(cat)
51  {
52  auto cv = cat.get_cat_validator();
53 
54  for (auto k : cv->m_keys)
55  {
56  uint16_t ix = cat.add_column(k);
57 
58  auto iv = cv->get_validator_for_item(k);
59  if (iv == nullptr)
60  throw std::runtime_error("Incomplete dictionary, no Item Validator for Key " + k);
61 
62  auto tv = iv->m_type;
63  if (tv == nullptr)
64  throw std::runtime_error("Incomplete dictionary, no type Validator for Item " + k);
65 
66  using namespace std::placeholders;
67 
68  m_comparator.emplace_back(ix, std::bind(&type_validator::compare, tv, _1, _2));
69  }
70  }
void compare(Image< double > &op1, const Image< double > &op2)
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac

Member Function Documentation

◆ operator()() [1/2]

int cif::row_comparator::operator() ( const row *  a,
const row *  b 
) const
inline

Definition at line 72 of file category.cpp.

73  {
74  assert(a);
75  assert(b);
76 
77  row_handle rha(m_category, *a);
78  row_handle rhb(m_category, *b);
79 
80  int d = 0;
81  for (auto &c : m_comparator)
82  {
83  uint16_t k;
84  compareFunc f;
85 
86  std::tie(k, f) = c;
87 
88  std::string_view ka = rha[k].text();
89  std::string_view kb = rhb[k].text();
90 
91  d = f(ka, kb);
92 
93  if (d != 0)
94  break;
95  }
96 
97  return d;
98  }
doublereal * c
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
doublereal * d
doublereal * b
double * f
doublereal * a

◆ operator()() [2/2]

int cif::row_comparator::operator() ( const row_initializer &  a,
const row *  b 
) const
inline

Definition at line 100 of file category.cpp.

101  {
102  assert(b);
103 
104  row_handle rhb(m_category, *b);
105 
106  int d = 0, i = 0;
107  for (auto &c : m_comparator)
108  {
109  uint16_t k;
110  compareFunc f;
111 
112  std::tie(k, f) = c;
113 
114  std::string_view ka = a[i++].value();
115  std::string_view kb = rhb[k].text();
116 
117  d = f(ka, kb);
118 
119  if (d != 0)
120  break;
121  }
122 
123  return d;
124  }
doublereal * c
#define i
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
doublereal * d
doublereal * b
double * f
doublereal * a

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