]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Remove SST_DoUpdateRegression
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 6 Aug 2010 12:36:56 +0000 (14:36 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 6 Aug 2010 12:36:56 +0000 (14:36 +0200)
The function is not used anywhere and it requires weights to be stored
sourcestats.

sources.c
sourcestats.c

index f86f198fd2e58c282bd031cc9cd602e5b63e2083..094e21cedbed9a166166aae0b9950a57f307fde5 100644 (file)
--- a/sources.c
+++ b/sources.c
@@ -891,8 +891,6 @@ SRC_ReloadSources(void)
       LOG(LOGS_WARN, LOGF_Sources, "Could not open dump file %s", filename);
     } else {
       if (SST_LoadFromFile(sources[i]->stats, in)) {
-        /* We might want to use SST_DoUpdateRegression here, but we
-           need to check it has the same functionality */
         SST_DoNewRegression(sources[i]->stats);
       } else {
         LOG(LOGS_WARN, LOGF_Sources, "Problem loading from file %s", filename);
index b338d37eb71390a31858a1d5d867b238a637a66a..4268fdfe2145b9495f77b102ac7e8069329c5dd3 100644 (file)
@@ -468,43 +468,6 @@ SST_DoNewRegression(SST_Stats inst)
 
 }
 
-/* ================================================== */
-/* This function does a simple regression on what is in the register,
-   without trying to optimise the error bounds on the frequency by
-   deleting old samples */
-
-void
-SST_DoUpdateRegression(SST_Stats inst)
-{
-  double times_back[MAX_SAMPLES];
-  double freq_error_bound;
-  double est_intercept, est_slope, est_var_base, est_intercept_sd, est_slope_sd;
-
-  convert_to_intervals(inst, times_back);
-
-  if (inst->n_samples >= 3) { /* Otherwise, we're wasting our time - we
-                                 can't do a useful linear regression
-                                 with less than 3 points */
-    
-    RGR_WeightedRegression(times_back, inst->offsets, inst->weights,
-                           inst->n_samples,
-                           &est_intercept, &est_slope, &est_var_base,
-                           &est_intercept_sd, &est_slope_sd);
-
-    freq_error_bound = est_slope_sd * RGR_GetTCoef(inst->n_samples - 2);
-
-    inst->estimated_frequency = est_slope;
-    inst->skew = freq_error_bound;
-
-  } else {
-    inst->estimated_frequency = 0.0;
-    inst->skew = WORST_CASE_FREQ_BOUND;
-  }
-
-  find_best_sample_index(inst, times_back);
-
-}
-
 /* ================================================== */
 
 void