Skip to content

Commit

Permalink
fix compile failure w/o arpack
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed Jul 26, 2011
1 parent c9e1279 commit 2387fee
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/shogun/preprocessor/LocallyLinearEmbedding.cpp
Expand Up @@ -196,20 +196,22 @@ SGMatrix<float64_t> CLocallyLinearEmbedding::find_null_space(SGMatrix<float64_t>
int eigenproblem_status = 0;

bool arpack = false;
#ifdef HAVE_ARPACK
arpack = true;
#endif
#ifdef HAVE_ARPACK
arpack = true;
#endif
if (force_lapack) arpack = false;

float64_t* eigenvalues_vector;

#ifdef HAVE_ARPACK
if (arpack)
{
// using ARPACK (faster)
eigenvalues_vector = new float64_t[dimension+1];
arpack_dsaupd(matrix.matrix,N,dimension+1,"LA",3,-1e-3,false,eigenvalues_vector,matrix.matrix,eigenproblem_status);
}
else
#endif //HAVE_ARPACK
{
// using LAPACK (slower)
eigenvalues_vector = new float64_t[N];
Expand All @@ -223,6 +225,7 @@ SGMatrix<float64_t> CLocallyLinearEmbedding::find_null_space(SGMatrix<float64_t>
// allocate null space feature matrix
float64_t* null_space_features = new float64_t[N*dimension];

#ifdef HAVE_ARPACK
// construct embedding w.r.t to used solver (prefer ARPACK if available)
if (arpack)
{
Expand All @@ -234,6 +237,7 @@ SGMatrix<float64_t> CLocallyLinearEmbedding::find_null_space(SGMatrix<float64_t>
}
}
else
#endif //HAVE_ARPACK
{
// LAPACKed eigenvectors
for (i=0; i<dimension; i++)
Expand Down

0 comments on commit 2387fee

Please sign in to comment.