Skip to content

Commit

Permalink
Merge pull request #2133 from aabghari/master
Browse files Browse the repository at this point in the history
Removed using namespace std from pca_imp.hpp.
  • Loading branch information
zoq committed Jan 4, 2020
2 parents 594713a + 4cdac4f commit 16ee2fa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/mlpack/methods/pca/pca_impl.hpp
Expand Up @@ -20,8 +20,6 @@
#include <mlpack/core/math/lin_alg.hpp>
#include "pca.hpp"

using namespace std;

namespace mlpack {
namespace pca {

Expand Down Expand Up @@ -95,11 +93,11 @@ double PCA<DecompositionPolicy>::Apply(arma::mat& data,
// Parameter validation.
if (newDimension == 0)
Log::Fatal << "PCA::Apply(): newDimension (" << newDimension << ") cannot "
<< "be zero!" << endl;
<< "be zero!" << std::endl;
if (newDimension > data.n_rows)
Log::Fatal << "PCA::Apply(): newDimension (" << newDimension << ") cannot "
<< "be greater than the existing dimensionality of the data ("
<< data.n_rows << ")!" << endl;
<< data.n_rows << ")!" << std::endl;

arma::mat eigvec;
arma::vec eigVal;
Expand Down Expand Up @@ -146,10 +144,10 @@ double PCA<DecompositionPolicy>::Apply(arma::mat& data,
// Parameter validation.
if (varRetained < 0)
Log::Fatal << "PCA::Apply(): varRetained (" << varRetained << ") must be "
<< "greater than or equal to 0." << endl;
<< "greater than or equal to 0." << std::endl;
if (varRetained > 1)
Log::Fatal << "PCA::Apply(): varRetained (" << varRetained << ") should be "
<< "less than or equal to 1." << endl;
<< "less than or equal to 1." << std::endl;

arma::mat eigvec;
arma::vec eigVal;
Expand Down

0 comments on commit 16ee2fa

Please sign in to comment.