23 #ifndef EIKONALSOLVER_H_
24 #define EIKONALSOLVER_H_
34 #include <boost/concept_check.hpp>
36 #include <fast_methods/fm/solver.hpp>
37 #include <fast_methods/console/console.h>
39 template <
class gr
id_t>
50 unsigned int a = grid_t::getNDims();
53 for (
unsigned int dim = 0; dim < grid_t::getNDims(); ++dim) {
54 double minTInDim =
grid_->getMinValueInDim(idx, dim);
55 if (!isinf(minTInDim) && minTInDim < grid_->getCell(idx).getArrivalTime())
62 return std::numeric_limits<double>::infinity();
68 for (
unsigned i = 1; i <= a; ++i) {
81 (
unsigned int idx,
unsigned int dim) {
89 for (
unsigned i = 0; i < dim; ++i) {
98 double c = sumTT -
grid_->getLeafSize() *
grid_->getLeafSize() / (
grid_->getCell(idx).getVelocity()*
grid_->getCell(idx).getVelocity());
99 double quad_term = b*b - 4*a*c;
102 return std::numeric_limits<double>::infinity();
104 return (-b + sqrt(quad_term))/(2*a);
Abstract class that serves as interface for the actual EikonalSolvers implemented. It requires (at least) the computeInternal method to be implemented,.
std::array< unsigned int, 2 *grid_t::getNDims()> neighbors_
Auxiliar array which stores the neighbor of each iteration of the computeFM() function.
virtual double solveEikonal(const int &idx)
Solves nD Eikonal equation for cell idx. If heuristics are activated, it will add the estimated trave...
grid_t * grid_
Grid container.
std::vector< double > Tvalues_
Auxiliar vector with values T0,T1...Tn-1 variables in the Discretized Eikonal Equation.
Abstract class that serves as interface for the actual solvers implemented. It requires (at least) th...
static constexpr double COMP_MARGIN
When comparing doubles if(a < b), do if(a+COMP_MARGIN < b) to avoid double precission issues...
double solveEikonalNDims(unsigned int idx, unsigned int dim)
Solves the Eikonal equation assuming that Tvalues_ is sorted.