You could pass the vector attribute of SGVector but that may mess around with the memory if Shogun thinks that there is no reference on it and nanoflann is still using it internally, so keep it this way.