<p>In <a href="https://github.com/mlpack/mlpack/pull/683#discussion_r66458858">src/mlpack/methods/edge_boxes/feature_extraction.hpp</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,85 @@
> +/**
> + * @file feature_extraction.hpp
> + * @author Nilay Jain
> + *
> + * Feature Extraction for the edge_boxes algorithm.
> + */
> +#ifndef MLPACK_METHODS_EDGE_BOXES_STRUCTURED_TREE_HPP
> +#define MLPACK_METHODS_EDGE_BOXES_STRUCTURED_TREE_HPP
> +#define INF 999999.9999
> +#define EPS 1E-20
> +#include <mlpack/core.hpp>
</pre>
<p>a : If possible, please do not use macro/pre-processor, they have many defects.</p>
<p>1 : they do not respect scope. <br>
2 : debug message is hard to read<br>
3 : Not type safe</p>
<p>So, do we have a better choice?Yes, we have<br>
it is constexpr, this keyword tell the compiler, I know this const value at compile time<br>
so you could declare it as </p>
<pre><code>constexpr double inf = 999999.9999;
constexpr double eps = 1e-20;
</code></pre>
<p>constexpr respect scope, compiler will give you better error message rather than show you "1e-20" or "99999.99999"</p>
<p>b : If possible, could you place the eps in your class rather than put it in global namespace?</p>
<p>c : c++11 provide <a href="http://en.cppreference.com/w/cpp/types/numeric_limits/infinity">standard infinity value f</a>or us</p>
<p><code>double inf = std::numeric_limits<double>::infinity();</code></p>
<p>Very cool, right?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<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/pull/683/files/9d85b64c6c6bdff608331195351d09abf56cfc96#r66458858">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFLnANiXIvERoBxW5oSUqsn2NFKZBks5qKCvtgaJpZM4IvUrl">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFFjDbeAS9oXZZgteK5nzJBREKp_Iks5qKCvtgaJpZM4IvUrl.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/pull/683/files/9d85b64c6c6bdff608331195351d09abf56cfc96#r66458858"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>