<p>But, the issue here is, I am not sure that <code>HRectBound::MinDistance()</code> and <code>HRectBound::MaxDistance()</code> will be correct when using the periodic boundary metric you've suggested here.  Since those two functions manually implement a distance calculation, I don't think they take into account the periodicity of the space you're writing here.</p>

<p>In the long long ago, there used to be a class called <code>PeriodicHRectBound</code>, but it was neglected, untested, and didn't work.  I can point you to the code for that if you like, but really I think the right solution to your problem here is to also write a <code>PeriodicHRectBound</code> class that implements the same functions as <code>HRectBound</code> (you can even extend from <code>HRectBound</code> if you like), and then implement specialized versions of <code>MinDistance()</code> and <code>MaxDistance()</code> that take into account the periodic condition.  If I remember right the geometry for getting those calculations right gets a bit complex, though. :(</p>

<p>If something I've said is incorrect, please comment and I'll reopen this and we can address it, but for now, since I think this isn't a bug, I'm going to go ahead and close it.  Thanks for getting in touch and pointing this out though. :)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/issues/744#issuecomment-238005869">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFDuYq7Zbg6lBQ7DsuU7195Q2hZjEks5qdBMegaJpZM4JYvK8">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFCsnbD81Vzld_7zBmrD18MyoFb45ks5qdBMegaJpZM4JYvK8.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/issues/744#issuecomment-238005869"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/mlpack/mlpack","title":"mlpack/mlpack","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/modules/aws/aws-bg.jpg","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/mlpack/mlpack"}},"updates":{"snippets":[{"icon":"PERSON","message":"@rcurtin in #744: But, the issue here is, I am not sure that `HRectBound::MinDistance()` and `HRectBound::MaxDistance()` will be correct when using the periodic boundary metric you've suggested here.  Since those two functions manually implement a distance calculation, I don't think they take into account the periodicity of the space you're writing here.\r\n\r\nIn the long long ago, there used to be a class called `PeriodicHRectBound`, but it was neglected, untested, and didn't work.  I can point you to the code for that if you like, but really I think the right solution to your problem here is to also write a `PeriodicHRectBound` class that implements the same functions as `HRectBound` (you can even extend from `HRectBound` if you like), and then implement specialized versions of `MinDistance()` and `MaxDistance()` that take into account the periodic condition.  If I remember right the geometry for getting those calculations right gets a bit complex, though. :(\r\n\r\nIf something I've said is incorrect, please comment and I'll reopen this and we can address it, but for now, since I think this isn't a bug, I'm going to go ahead and close it.  Thanks for getting in touch and pointing this out though. :)"}],"action":{"name":"View Issue","url":"https://github.com/mlpack/mlpack/issues/744#issuecomment-238005869"}}}</script>