//base_marcher.h #pragma once const unsigned int MaximumDimension = 12; const char Far = 0; const char Narrow = 1; const char Frozen = 2; const char Mask = 3; #include using namespace std; #define doubleEpsilon numeric_limits::epsilon() #define maxDouble numeric_limits::max() class heap; extern "C" { class baseMarcher { public: baseMarcher(double *phi, double *dx, long long *flag, double *distance, int ndim, int *shape, bool self_test, int order, double narrow, int periodic); virtual ~baseMarcher(); void march(); int getError() const { return error_;} private: void initalizeNarrow(); void solve(); void _setIndex(int current, int coord[MaximumDimension]) { int rem = current; for (int i=0; i= shape_[dim] || newc < 0) return -1; int newa = current + dir*shift_[dim]; if (flag_[newa]==flag) return -1; return newa; } double * distance_; // return value modified in place double * phi_; double * dx_; long long * flag_; int error_; int dim_; // number of dimensions int size_; // flat size double idx2_[MaximumDimension]; }; } // extern "C"