[mlpack-git] [mlpack] WIP: Refactor LRSDP to support more general linear constraints (#580)

Ryan Curtin notifications at github.com
Thu Mar 17 09:28:23 EDT 2016


> + */
> +#ifndef __MLPACK_CORE_OPTIMIZERS_SDP_LINEAR_CONSTRAINT_IMPL_HPP
> +#define __MLPACK_CORE_OPTIMIZERS_SDP_LINEAR_CONSTRAINT_IMPL_HPP
> +
> +#include "linear_constraint.hpp"
> +
> +namespace mlpack {
> +namespace optimization {
> +
> +// MatrixConstraint implementation
> +
> +template <typename MatrixType>
> +arma::vec MatrixConstraint<MatrixType>::Evaluate(const arma::mat& x)
> +{
> +  const size_t m = _a.size();
> +  arma::vec vals = arma::vec(m);

You can just do `arma::vec vals(m);` or even `arma::vec vals(_a.size());` here.

---
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/580/files/1de2fb1ed30fe9007ecb6c7de4d2b91f7184b9f6#r56502688
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160317/32961a67/attachment.html>


More information about the mlpack-git mailing list