Skip to content

Commit

Permalink
Fix -Wuninitialized.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcurtin committed Dec 21, 2014
1 parent d283c82 commit f4d80ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mlpack/methods/sparse_coding/sparse_coding_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ double SparseCoding<DictionaryInitializer>::OptimizeDictionary(
codesZT = matActiveZ * trans(matActiveZ);
}

double normGradient;
double normGradient = 0;
double improvement = 0;
for (size_t t = 1; (t != maxIterations) && !converged; ++t)
{
Expand Down Expand Up @@ -356,9 +356,9 @@ std::string SparseCoding<DictionaryInitializer>::ToString() const
convert << "Sparse Coding [" << this << "]" << std::endl;
convert << " Data: " << data.n_rows << "x" ;
convert << data.n_cols << std::endl;
convert << " Atoms: " << atoms << std::endl;
convert << " Lambda 1: " << lambda1 << std::endl;
convert << " Lambda 2: " << lambda2 << std::endl;
convert << " Atoms: " << atoms << std::endl;
convert << " Lambda 1: " << lambda1 << std::endl;
convert << " Lambda 2: " << lambda2 << std::endl;
return convert.str();
}

Expand Down

0 comments on commit f4d80ec

Please sign in to comment.