lisitsyn / tapkee

A flexible and efficient С++ template library for dimension reduction
http://tapkee.lisitsyn.me
BSD 3-Clause "New" or "Revised" License
231 stars 58 forks source link

Avoid raw pointers in projecting implementation #85

Closed lisitsyn closed 5 months ago

lisitsyn commented 5 months ago

Probably fixes #84

lisitsyn commented 5 months ago

hey @iglesias would you like to take a look? thanks

iglesias commented 5 months ago

Hey! I run and it fixed 2 of the errors. There's still this one (summarized):

2: ==191523==ERROR: AddressSanitizer: requested allocation size 0x2d79883d20010 (0x2d79883d21010 after adjustments for alignment, red zones etc.) exceeds maximum supported size of 0x10000000000 (thread T0)
[...]
2:     #7 0x651ab7876242 in void Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >::_init2<int, int>(long, long, Eigen::internal::enable_if<true, int>::type*) /usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:810
2:     #8 0x651ab7837f9f in Eigen::Matrix<double, -1, -1, 0, -1, -1>::Matrix<int, int>(int const&, int const&) /usr/include/eigen3/Eigen/src/Core/Matrix.h:340
2:     #9 0x651ab79b0321 in Eigen::Matrix<double, -1, -1, 0, -1, -1> tapkee::tapkee_internal::compute_distance_matrix<__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, float_distance_callback>(__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, __gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, float_distance_callback) tapkee/include/tapkee/routines/multidimensional_scaling.hpp:114
2:     #10 0x651ab7917b97 in tapkee::tapkee_internal::ImplementationBase<__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, tapkee::dummy_kernel_callback<float>, float_distance_callback, tapkee::dummy_features_callback<float> >::embedMultidimensionalScaling() tapkee/include/tapkee/methods.hpp:195
2:     #11 0x651ab78a95bb in tapkee::tapkee_internal::ImplementationBase<__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, tapkee::dummy_kernel_callback<float>, float_distance_callback, tapkee::dummy_features_callback<float> >::embedUsing(tapkee::DimensionReductionMethod) tapkee/include/tapkee/methods.hpp:104
2:     #12 0x651ab78643d2 in tapkee::TapkeeOutput tapkee::embed<__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, tapkee::dummy_kernel_callback<float>, float_distance_callback, tapkee::dummy_features_callback<float> >(__gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, __gnu_cxx::__normal_iterator<float*, std::vector<float, std::allocator<float> > >, tapkee::dummy_kernel_callback<float>, float_distance_callback, tapkee::dummy_features_callback<float>, stichwort::ParametersSet) tapkee/include/tapkee/embed.hpp:117
[...]
2: ==191523==HINT: if you don't care about these errors you may set allocator_may_return_null=1
2: SUMMARY: AddressSanitizer: allocation-size-too-big /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:69 in __interceptor_malloc

I doubt it is relevant though. It passes without the sanitizer and there's no kind of out of memory error. And the name of the test fits with it having this type of error ':-D

tapkee.log

iglesias commented 5 months ago

lgtm :ship: