[mlpack-git] [mlpack] Implementation of primal-dual interior point SDP solver (#391)

Ryan Curtin notifications at github.com
Mon Jan 26 10:31:19 EST 2015


> +      else
> +        output(idx++) = M_SQRT2 * input(i, j);
> +    }
> +  }
> +}
> +
> +void mlpack::math::Svec(const arma::sp_mat& input, arma::sp_vec& output)
> +{
> +  const size_t n = input.n_rows;
> +  const size_t n2bar = n * (n + 1) / 2;
> +
> +  output.zeros(n2bar, 1);
> +
> +  size_t idx = 0;
> +
> +  for (auto it = input.begin(); it != input.end(); ++it)

If you use `row_col_iterator` (which, of course, isn't documented on the website... I'll have to make a change and submit it...), which exists for both `mat` and `sp_mat`, it will iterate over all points in `mat` and all nonzero points in `sp_mat`.  Using that, you could condense `Svec` into one templated function, and the speed should be equal to either implementation here.

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/391/files#r23537713
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20150126/27b40b41/attachment.html>


More information about the mlpack-git mailing list