Resolving some problem with numerical stability.

This commit is contained in:
Dongryeol Lee
2010-10-28 15:55:08 +00:00
parent 42d313f0c9
commit f47b18cc44
2 changed files with 8 additions and 2 deletions
@@ -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;
@@ -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] *