[mlpack-git] [mlpack/mlpack] Use Enum Type to define different possible search modes, in neighbor search class. (#750)

MarcosPividori notifications at github.com
Thu Aug 4 16:19:02 EDT 2016


About the implementation of NeighborSearch class, I think we should define a enum type like:

```
enum SearchMode
{
    NAIVE_MODE,
    SINGLE_MODE,
    DUAL_MODE
};
```

This way, constructors will be clearer, instead of using combinations of boolean values.

For example, we could have:

```
 NeighborSearch(const MatType& referenceSet, SearchMode mode, double epsilon, MetricType metric);
```

Instead of:

```
 NeighborSearch(const MatType& referenceSet, bool naive, bool singleMode, double epsilon, MetricType metric);
```

Also, the implementation will be clearer, because we could use `switch` statement when analysing the 3 possible situations.

---
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/issues/750
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160804/15686112/attachment-0001.html>


More information about the mlpack-git mailing list