#include "genlib.h" #include "log.h" #include #include #include /*cubic covariance function*/ double cubic(double h) { clock_t t = clock(); log_info("RESULT = in progress, h = %f", h); double z; if (h >= 1.) { z = 0.; } else { z = 1. - 7. * (double)(h * h) + (35. / 4.) * (double)(h * h * h) - 3.5 * (double)(h * h * h * h * h) + .75 * (double)(h * h * h * h * h * h * h); } t = clock() - t; double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time double* total_ram = malloc(sizeof(double)); getTotalVirtualMem(total_ram); double* used_ram = malloc(sizeof(double)); getVirtualMemUsed(used_ram); log_info("TOTAL VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM = %5.1f MB, USED VIRTUAL MEM BY CURRENT PROCESS = %d MB", *total_ram, *used_ram, getVirtualMemUsedByCurrentProcess()); free(total_ram); free(used_ram); log_info("RESULT = success, z = %f, ELAPSED = %f seconds", z, time_taken); return z; }