void update(Heap *hp,Star star) { for (int i=0;i< hp->length;i++){ if (star.x == hp->arr[i].x && star.y == hp->arr[i].y) { hp->arr[i].g = star.g; hp->arr[i].h = star.h; int f = hp->arr[i].f; hp->arr[i].f = star.f; if (f < star.f){ filterDown(hp,i); }else{ filterUp(hp,i); } //break; } } }
/** * @brief Execute * @param in * @param isb * @param scale * @return */ static Image *Execute(Image *in, ImageSampler *isb, float scale) { FilterSampler3D filterUp(scale, isb); Image *out = filterUp.Process(Single(in), NULL); return out; }
void insert(Heap *hp,Star star) { int n = hp ->length; hp ->arr[n] = star; hp ->length = n + 1; filterUp(hp,n); }