diff --git a/fastlib2/contrib/dongryel/regression/krylov_lpr_setup_impl.h b/fastlib2/contrib/dongryel/regression/krylov_lpr_setup_impl.h index 62d2ff8ec2..9f5033bd39 100644 --- a/fastlib2/contrib/dongryel/regression/krylov_lpr_setup_impl.h +++ b/fastlib2/contrib/dongryel/regression/krylov_lpr_setup_impl.h @@ -24,16 +24,16 @@ void KrylovLpr::InitializeQueryTree_(QueryTree *qnode) { template void KrylovLpr::InitializeReferenceStatistics_ (ReferenceTree *rnode, int column_index, const Vector &weights) { - + + // Clear the sum statistics before accumulating. + rnode->stat().Reset(); + if(rnode->is_leaf()) { // Temporary vector for computing the reference point expansion. Vector reference_point_expansion; reference_point_expansion.Init(row_length_); - // Clear the sum statistics before accumulating. - rnode->stat().Reset(); - // For a leaf reference node, iterate over each reference point // and compute the weighted vector and tally these up for the // sum statistics owned by the reference node.