[mlpack-git] [mlpack] add a wrapper for the matrix completion SDP (#374)

Stephen Tu notifications at github.com
Fri Jan 9 16:57:04 EST 2015


> +
> +MatrixCompletion::MatrixCompletion(const size_t m,
> +                                   const size_t n,
> +                                   const arma::umat& indices,
> +                                   const arma::vec& values)
> +  : m(m), n(n), indices(indices), values(values),
> +    sdp(indices.n_cols, 0, CreateInitialPoint(m, n, DefaultRank(m, n, indices.n_cols)))
> +{
> +  checkValues();
> +  initSdp();
> +}
> +
> +void MatrixCompletion::checkValues()
> +{
> +  if (indices.n_rows != 2)
> +    Log::Fatal << "indices.n_rows != 2" << std::endl;

Sure. Alternatively, I wonder if arma has a particular type where the # of rows is set to 2 (let the type system enforce this!). 

I fully support `Log::Fatal` returning backtraces. I think it's not too bad if you compile with `-fno-omit-frame-pointer`. 

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


More information about the mlpack-git mailing list