bool bigint_kernel_1:: operator < ( const bigint_kernel_1& rhs ) const { return is_less_than(data,rhs.data); }
BOOST_SERIALIZATION_DECL bool extended_type_info::operator<(const extended_type_info &rhs) const { // short cut for a common cases if(this == & rhs) return false; if(m_type_info_key == rhs.m_type_info_key){ return is_less_than(rhs); } if(m_type_info_key < rhs.m_type_info_key) return true; return false; }
static bool is_less_than_or(Type value, bool cond) { return cond || is_less_than(value); }
match_selectt::selectiont match_selectt::select(populationt &pop) { const contestantt no_contestant=pop.end(); const is_contestant_less_thant is_less_than(no_contestant); contestantt father=no_contestant; for (size_t contestants=0; contestants < rounds / 2;) { contestantt contestant=pop.begin(); std::advance(contestant, random.rand() % pop.size()); if (father == contestant) continue; if (is_less_than(father, contestant)) father=contestant; ++contestants; } contestantt mother=no_contestant; size_t match_fitness=0u; for (size_t contestants=0; contestants < rounds / 2;) { contestantt contestant=pop.begin(); std::advance(contestant, random.rand() % pop.size()); if (mother == contestant || father == contestant) continue; if (no_contestant == mother) mother=contestant; else { const size_t new_match=get_match_fitness(test_case_data, no_contestant, father, contestant); if (match_fitness < new_match) { match_fitness=new_match; mother=contestant; } } ++contestants; } contestantt son=no_contestant; contestantt daughter=no_contestant; for (size_t contestants=0; contestants < rounds / 2;) { contestantt contestant=pop.begin(); std::advance(contestant, random.rand() % pop.size()); if (father == contestant || mother == contestant || son == contestant || daughter == contestant) continue; if (no_contestant == son) son=contestant; else if (no_contestant == daughter) daughter=contestant; else if (son->fitness > contestant->fitness) { daughter=son; son=contestant; } else if (daughter->fitness > contestant->fitness) daughter=contestant; ++contestants; } selectiont selection; selection.parents.push_back(father); assert(no_contestant != father); selection.parents.push_back(mother); assert(no_contestant != mother); selection.children.push_back(son); assert(no_contestant != son); selection.children.push_back(daughter); assert(no_contestant != daughter); return selection; }
uint operator < (const bignum &b) const throw() { return is_less_than(lenof(m),&m[0],&b.m[0]); }