[mlpack-git] [mlpack/mlpack] Automatic bindings step 2: matrix input/output parameters (#775)
Ryan Curtin
notifications at github.com
Tue Nov 1 11:53:07 EDT 2016
rcurtin commented on this pull request.
> + // Iterate over all the program_options, looking for duplicate parameters.
+ // If we find any, remove the duplicates.
+ for (unsigned int i = 0; i < bpo.options.size(); i++)
+ {
+ for (unsigned int j = i + 1; j < bpo.options.size(); j++)
+ {
+ if (bpo.options[i].string_key == bpo.options[j].string_key)
+ {
+ // If a duplicate is found, check to see if either one has a value.
+ if (bpo.options[i].value.size() == 0 &&
+ bpo.options[j].value.size() == 0)
+ {
+ // If neither has a value, consider it a duplicate flag and remove
+ // the duplicate. It's important to not break out of this loop
+ // because there might be another duplicate later on in the vector.
+ bpo.options.erase(bpo.options.begin() + j);
Nice catch, thanks. Fixed in 139ad60.
--
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/775
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20161101/64a44660/attachment.html>
More information about the mlpack-git
mailing list