#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: Agustin Glorioso int DNI=42923252; void getsublistTrue(list &L, list::iterator itL, bool (*pred)(int), list &subl){ subl.clear(); while (pred(*itL) && itL != L.end()){ subl.push_back(*itL); itL++; } } void getsublistFalse(list &L, list::iterator itL, bool (*pred)(int), list &subl){ subl.clear(); while (!pred(*itL) && itL != L.end()){ subl.push_back(*itL); itL++; } } //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> void predsplit(list &L,bool (*pred)(int), list> &LLtrue, list> &LLfalse) { LLtrue.clear(); LLfalse.clear(); list::iterator itL = L.begin(); list tempT, tempF; while (itL != L.end()){ if (pred(*itL)){ if (!tempF.empty()){ LLfalse.push_back(tempF); tempF.clear(); } tempT.push_back(*itL); } else { if (!tempT.empty()){ LLtrue.push_back(tempT); tempT.clear(); } tempF.push_back(*itL); } itL++; } if (!tempF.empty()){ LLfalse.push_back(tempF); } if (!tempT.empty()){ LLtrue.push_back(tempT); } } //---:---<*>---:---<*>- FINALIZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> int main() { Eval ev; int vrbs=0,seed=123; ev.eval<1>(predsplit,vrbs); return 0; }