diff --git a/include/ensmallen_bits/fw/atoms.hpp b/include/ensmallen_bits/fw/atoms.hpp index b77cc6f52..8a72c6c32 100644 --- a/include/ensmallen_bits/fw/atoms.hpp +++ b/include/ensmallen_bits/fw/atoms.hpp @@ -114,7 +114,7 @@ class Atoms // add an atom norm constraint, you could use projected gradient method, // see the implementaton of ProjectedGradientEnhancement(). arma::vec newCoeffs = - solve(function.MatrixA() * newAtoms, function.Vectorb()); + solve(function.MatrixA() * newAtoms, function.Vectorb(), arma::solve_opts::fast); // Evaluate the function again. double Fnew = function.Evaluate(newAtoms * newCoeffs); diff --git a/include/ensmallen_bits/fw/update_span.hpp b/include/ensmallen_bits/fw/update_span.hpp index 5862d3dc3..1c113d881 100644 --- a/include/ensmallen_bits/fw/update_span.hpp +++ b/include/ensmallen_bits/fw/update_span.hpp @@ -57,7 +57,7 @@ class UpdateSpan // Reoptimize the solution in the current space. arma::vec b = function.Vectorb(); - atoms.CurrentCoeffs() = solve(function.MatrixA() * atoms.CurrentAtoms(), b); + atoms.CurrentCoeffs() = solve(function.MatrixA() * atoms.CurrentAtoms(), b, arma::solve_opts::fast); // x has coords of only the current atoms, recover the solution // to the original size. diff --git a/include/ensmallen_bits/sdp/primal_dual_impl.hpp b/include/ensmallen_bits/sdp/primal_dual_impl.hpp index bddd6642c..88e7b1e37 100644 --- a/include/ensmallen_bits/sdp/primal_dual_impl.hpp +++ b/include/ensmallen_bits/sdp/primal_dual_impl.hpp @@ -197,8 +197,7 @@ SolveKKTSystem(const SparseConstraintType& aSparse, if (aDense.n_rows) rhs(arma::span(aSparse.n_rows, numConstraints - 1), 0) += aDense * eInvFrdRc; - // TODO(stephentu): use a more efficient method (e.g. LU decomposition) - if (!arma::solve(dy, m, rhs)) + if (!arma::solve(dy, m, rhs, arma::solve_opts::fast)) { throw std::logic_error("PrimalDualSolver::SolveKKTSystem(): Could not " "solve KKT system.");