[mlpack-git] [mlpack/mlpack] backported ind2sub and sub2ind. (#683)

stereomatchingkiss notifications at github.com
Thu Jun 9 10:50:50 EDT 2016


> + *
> + * Implementation of feature extraction methods.
> + */
> +#ifndef MLPACK_METHODS_EDGE_BOXES_STRUCTURED_TREE_IMPL_HPP
> +#define MLPACK_METHODS_EDGE_BOXES_STRUCTURED_TREE_IMPL_HPP
> +
> +
> +#include "feature_extraction.hpp"
> +#include <map>
> +
> +namespace mlpack {
> +namespace structured_tree {
> +
> +template<typename MatType, typename CubeType>
> +StructuredForests<MatType, CubeType>::
> +StructuredForests(const std::map<std::string, int>& inMap)

Since you need to copy the inMap no matter what, maybe you could pass by value, this is more effecient([Want performance](http://stackoverflow.com/questions/21605579/how-true-is-want-speed-pass-by-value)? pass by value)

`StructuredForests(std::map<std::string, int> inMap) : options(std::move(inMap)) {}`

I use initialization list to initialize the data member.The class/struct of c++ do the initialization task at initialization list, not constructor. If you assign the inMap to options in constructor, it is "assign" but not "initialize".

---
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/683/files/9d85b64c6c6bdff608331195351d09abf56cfc96#r66455634
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160609/967c69ef/attachment.html>


More information about the mlpack-git mailing list