void measure(const struct t0 *t0, struct info *i) { struct t0 t1; int rc; E(clock_gettime(CLOCK_MONOTONIC_RAW, &t1.ts)); E(getrusage(RUSAGE_SELF, &t1.ru)); i->wall_s = delta2_s(&t0->ts, &t1.ts); i->cpu_user_s = delta_s(&t0->ru.ru_utime, &t1.ru.ru_utime); i->cpu_sys_s = delta_s(&t0->ru.ru_stime, &t1.ru.ru_stime); i->iops_r = t1.ru.ru_inblock - t0->ru.ru_inblock; i->iops_w = t1.ru.ru_oublock - t0->ru.ru_oublock; i->iops_pf = t1.ru.ru_majflt - t0->ru.ru_majflt + t1.ru.ru_minflt - t0->ru.ru_minflt; }
virtual double eval_jac_int_s( const double s ) { double d = delta_s(s); return -2. * d; // d' is 1 }
virtual double eval_g_int_s( const double s ) { const double d = delta_s(s); return 1. - d * d; }