#ifndef SPLIT_H_ #define SPLIT_H_ #include "common.h" #include "Utils.h" #include struct seg{//theta0+theta1*x int start; int end; double theta0; double theta1; int totalbyte; int tmpbit ; int* delta; void caltheta(double x[], double y[], int m){ double * real_x = new double[m]; for(int i=0;imax_error){ max_error = abs(tmp); } } int tmp_bit = 0; if(max_error > 0.01){ tmp_bit = ceil(log2(max_error))+2; } else{ tmp_bit = 2; } if(tmp_bit>=32){ tmp_bit =32; } tmpbit=tmp_bit; totalbyte = 4+4+8+8+1+ceil(((double)tmp_bit*(double)m)/8.); } }; #endif