[mlpack-git] master: Revert "older versions of arma do not support unary minus on sparse matrices" (ea795f1)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 22:15:34 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

>---------------------------------------------------------------

commit ea795f1deef3638ef28addb066d1ecce5de8272e
Author: Ryan Curtin <ryan at ratml.org>
Date:   Fri Feb 6 15:56:05 2015 -0500

    Revert "older versions of arma do not support unary minus on sparse matrices"
    
    This reverts commit a8ecf093989cbe3d58c36c4e21e772c99d7856e4.


>---------------------------------------------------------------

ea795f1deef3638ef28addb066d1ecce5de8272e
 src/mlpack/tests/sdp_primal_dual_test.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/mlpack/tests/sdp_primal_dual_test.cpp b/src/mlpack/tests/sdp_primal_dual_test.cpp
index 1136fd9..35651fb 100644
--- a/src/mlpack/tests/sdp_primal_dual_test.cpp
+++ b/src/mlpack/tests/sdp_primal_dual_test.cpp
@@ -157,9 +157,7 @@ ConstructMaxCutSDPFromLaplacian(const std::string& laplacianFilename)
   if (laplacian.n_rows != laplacian.n_cols)
     Log::Fatal << "laplacian not square" << std::endl;
   SDP<arma::sp_mat> sdp(laplacian.n_rows, laplacian.n_rows, 0);
-  // operator- not supported on older versions of arma
-  sdp.C() = arma::sp_mat(laplacian);
-  sdp.C() *= -1.;
+  sdp.C() = -arma::sp_mat(laplacian);
   for (size_t i = 0; i < laplacian.n_rows; i++)
   {
     sdp.SparseA()[i].zeros(laplacian.n_rows, laplacian.n_rows);



More information about the mlpack-git mailing list