ddemidov / mba

Scattered data interpolation with multilevel B-Splines
MIT License
74 stars 23 forks source link

Assertion failed #24

Closed juhi24 closed 1 year ago

juhi24 commented 1 year ago

Running using python bindings on Fedora 37, I get an assertion failure:

/usr/include/c++/12/bits/stl_vector.h:1142: std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = double; _Alloc = std::allocator<double>; const_reference = const double&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.

I'm no C++ expert, but I believe the assertion failure means an invalid vector element was accessed.

The same python script runs fine on Ubuntu 22.04.

ddemidov commented 1 year ago

Make sure that your grid boundaries cover all of your data and query points with some margin. See also https://github.com/ddemidov/mba/issues/21, https://github.com/ddemidov/mba/issues/12

juhi24 commented 1 year ago

Thank you. Adding margins resolves this issue for me.