[mlpack-git] [mlpack/mlpack] Hilbert R tree (#664)

Ryan Curtin notifications at github.com
Tue Jun 21 15:26:17 EDT 2016


> +    {
> +      localDataset = NULL;
> +      numValues = 0;
> +    }
> +  }
> +}
> +
> +template<typename TreeElemType>
> +template<typename TreeType>
> +void DiscreteHilbertValue<TreeElemType>::Copy(TreeType* dst, TreeType* src)
> +{
> +  DiscreteHilbertValue<TreeElemType> &dstVal = dst->AuxiliaryInfo().HilbertValue();
> +  DiscreteHilbertValue<TreeElemType> &srcVal = src->AuxiliaryInfo().HilbertValue();
> +
> +  dst.LocalDataset() = src.LocalDataset();
> +  dst.NumValues() = src.NumValues();

I think that there can be weird memory issues when calling this method because `ownsLocalDataset` is not considered.  I think it may be better to remove this method and replace it with a copy constructor or a move constructor (or both); the same comments apply to `HilbertRTreeAuxiliaryInformation` and `XTreeAuxiliaryInformation`.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/664/files/f9127cea62d5ce1ad8d5f59931de108a2f7cdd9b#r67935306
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160621/c7e5a103/attachment.html>


More information about the mlpack-git mailing list