#define USECHRONO #undef HAVE_MPI #include "eval.hpp" #include #include #include #include using namespace aed; using namespace std; bool even(int x) { return x%2==0; } bool odd(int x) { return x%2; } bool ge7(int x) { return x>=7; } bool le3(int x) { return x<=3; } bool div4(int x) { return x%4==0; } bool isprime(int x) { return is_prime(abs(x)); } bool isnotprime(int x) { return !is_prime(abs(x)); } //---:---<*>---:---<*>- COMIENZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> // COMPLETAR DNI y NOMBRE AQUI: // Nombre: Felipe Repetto int DNI=39950635; //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> void predsplit(list &L,bool (*pred)(int), list> &LLtrue, list> &LLfalse) { if(L.empty()) return; list L_true, L_false; list::iterator it = L.begin(); while(true) { if((*pred)(*it)) { if(!L_false.empty()) { LLfalse.push_back(L_false); L_false.clear(); } L_true.push_back(*it); } else { if(!L_true.empty()) { LLtrue.push_back(L_true); L_true.clear(); } L_false.push_back(*it); } it++; if(it == L.end()) { if(!L_true.empty()) LLtrue.push_back(L_true); else LLfalse.push_back(L_false); return; } } } //---:---<*>---:---<*>- FINALIZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> int main() { Eval ev; int vrbs=0,seed=123; ev.eval<1>(predsplit,vrbs); return 0; }