#include #include #include typedef std::vector vec; void rand_vector(vec& v){ generate(v.begin(),v.end(), [](){return rand()/((double)RAND_MAX);}); } int vector_chop(vec& v, const double lim){ int count = 0; for_each(v.begin(),v.end(), [&count,lim](double& x){if(x