77 double matchScore(
const std::vector<size_t> &permutation,
78 const std::vector<std::vector<RGroupMatch>> &matches,
79 const std::set<int> &labels);
84 return d_saved.permutation;
91 void breakTies(
const std::vector<std::vector<RGroupMatch>> &matches,
92 const std::set<int> &labels,
93 const std::unique_ptr<CartesianProduct> &iterator,
94 const std::chrono::steady_clock::time_point &t0,
104 void restoreInitialState() { d_current = d_initial; }
107 std::vector<std::map<std::string, unsigned int>> matchSetVect;
108 std::map<std::set<int>,
size_t> linkerMatchSet;
118 void computeTieBreakingCriteria(
119 const std::vector<std::vector<RGroupMatch>> &matches,
120 const std::vector<int> &orderedLabels, std::vector<int> &heavyCounts) {
125 "permutation.size() should be <= matches.size()");
126 size_t offset = matches.size() - permutation.size();
130 for (
int label : orderedLabels) {
131 for (
size_t m = 0;
m < permutation.size(); ++
m) {
139 const auto &match = matches[
m + offset][permutation[
m]];
140 auto rg = match.rgroups.find(label);
141 if (rg != match.rgroups.end() && !rg->second->is_hydrogen) {
142 if (label < 0 && heavyCounts.at(i) == 0) {
144 }
else if (label > 0) {
145 ++numMatchedUserRGroups;
155 int numAddedRGroups = 0;
156 int numMatchedUserRGroups = 0;
157 std::map<int, int> heavyCountPerLabel;
158 std::map<int, RLabelData> labelDataMap;
159 std::vector<size_t> permutation;
161 double d_bestScore = 0.0;
169 std::deque<State> d_store;
void breakTies(const std::vector< std::vector< RGroupMatch > > &matches, const std::set< int > &labels, const std::unique_ptr< CartesianProduct > &iterator, const std::chrono::steady_clock::time_point &t0, double timeout)
find the best permutation across the tied ones that were stored
double matchScore(const std::vector< size_t > &permutation, const std::vector< std::vector< RGroupMatch > > &matches, const std::set< int > &labels)
score the passed permutation of matches