From f47b18cc4433131b8f1eb39f3f0eaaa3bbd513dd Mon Sep 17 00:00:00 2001 From: Dongryeol Lee Date: Thu, 28 Oct 2010 15:55:08 +0000 Subject: [PATCH] Resolving some problem with numerical stability. --- .../physpack/nbody_simulator/nbody_simulator_dev.h | 4 ++-- .../physpack/nbody_simulator/nbody_simulator_tripletree.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fastlib/trunk/contrib/dongryel/thesis_research/physpack/nbody_simulator/nbody_simulator_dev.h b/fastlib/trunk/contrib/dongryel/thesis_research/physpack/nbody_simulator/nbody_simulator_dev.h index aa1ed7f559..c977fc398b 100644 --- a/fastlib/trunk/contrib/dongryel/thesis_research/physpack/nbody_simulator/nbody_simulator_dev.h +++ b/fastlib/trunk/contrib/dongryel/thesis_research/physpack/nbody_simulator/nbody_simulator_dev.h @@ -6,7 +6,7 @@ #ifndef PHYSPACK_NBODY_SIMULATOR_NBODY_SIMULATOR_DEV_H #define PHYSPACK_NBODY_SIMULATOR_NBODY_SIMULATOR_DEV_H -#include "modified_lmetric.h" +#include "core/metric_kernels/lmetric.h" #include "core/gnp/tripletree_dfs_dev.h" #include "nbody_simulator.h" @@ -124,7 +124,7 @@ void physpack::nbody_simulator::NbodySimulator::ParseArguments( physpack::nbody_simulator::NbodySimulatorArguments *arguments_out) { // A L2 metric to index the table to use. - arguments_out->metric_ = new physpack::nbody_simulator::ModifiedLMetric<2>(); + arguments_out->metric_ = new core::metric_kernels::LMetric<2>(); // Construct the Boost variable map. boost::program_options::variables_map vm; diff --git a/fastlib/trunk/contrib/dongryel/thesis_research/physpack/nbody_simulator/nbody_simulator_tripletree.h b/fastlib/trunk/contrib/dongryel/thesis_research/physpack/nbody_simulator/nbody_simulator_tripletree.h index c2dd835317..98c1b0fd61 100644 --- a/fastlib/trunk/contrib/dongryel/thesis_research/physpack/nbody_simulator/nbody_simulator_tripletree.h +++ b/fastlib/trunk/contrib/dongryel/thesis_research/physpack/nbody_simulator/nbody_simulator_tripletree.h @@ -607,6 +607,12 @@ class NbodySimulatorSummary { const core::gnp::TripleRangeDistanceSq &triple_range_distance_sq_in, int node_index, ResultType *query_results) const { + if(triple_range_distance_sq_in.min_distance_sq().at(0, 1) == 0 || + triple_range_distance_sq_in.min_distance_sq().at(0, 2) == 0 || + triple_range_distance_sq_in.min_distance_sq().at(1, 2) == 0) { + return false; + } + double left_hand_side = delta.used_error_[node_index]; double right_hand_side = delta.pruned_[node_index] *