#define USECHRONO #undef HAVE_MPI #include "eval.hpp" #include #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: Candela Mariana Avila Costa int DNI=42308360; //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> void predsplit(list &L,bool (*pred)(int), list> &LLtrue, list> &LLfalse) { while(!L.empty()){ list::iterator itL = L.begin(); listauxLLT,auxLLF; if(pred(*itL)){ //cumple con el predicado list::iterator itL2 = next(itL); while(itL2!=L.end()){ // se fija si los proximos cumplen if(pred(*itL2)){ itL2++; } else break; } auxLLT.splice(auxLLT.end(),auxLLT,itL,itL2); LLtrue.insert(LLtrue.end(),auxLLT); }else{ // no cumple list::iterator itL2 = next(itL); while(itL2!=L.end()){ //se fija si los proximos tampoco cumplen if(!pred(*itL2)){ itL2++; } else break; } auxLLF.splice(auxLLF.end(),auxLLF,itL,itL2); LLfalse.insert(LLfalse.end(),auxLLF); } } } //---:---<*>---:---<*>- FINALIZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> int main() { Eval ev; int vrbs=0,seed=123; ev.eval<1>(predsplit,vrbs); return 0; }