diff --git a/src/shogun/mathematics/linalg/ratapprox/logdet/LogDetEstimator.cpp b/src/shogun/mathematics/linalg/ratapprox/logdet/LogDetEstimator.cpp index 831703388e3..d627d80e75b 100644 --- a/src/shogun/mathematics/linalg/ratapprox/logdet/LogDetEstimator.cpp +++ b/src/shogun/mathematics/linalg/ratapprox/logdet/LogDetEstimator.cpp @@ -36,6 +36,7 @@ CLogDetEstimator::CLogDetEstimator() init(); } +#ifdef HAVE_LAPACK #ifdef HAVE_EIGEN3 CLogDetEstimator::CLogDetEstimator(SGSparseMatrix sparse_mat) : CSGObject() @@ -70,6 +71,7 @@ CLogDetEstimator::CLogDetEstimator(SGSparseMatrix sparse_mat) m_trace_sampler->get_name()); } #endif //HAVE_EIGEN3 +#endif //HAVE_LAPACK CLogDetEstimator::CLogDetEstimator(CTraceSampler* trace_sampler, COperatorFunction* operator_log, diff --git a/src/shogun/mathematics/linalg/ratapprox/logdet/LogDetEstimator.h b/src/shogun/mathematics/linalg/ratapprox/logdet/LogDetEstimator.h index 9898dc2e5e7..466330ca7c2 100644 --- a/src/shogun/mathematics/linalg/ratapprox/logdet/LogDetEstimator.h +++ b/src/shogun/mathematics/linalg/ratapprox/logdet/LogDetEstimator.h @@ -46,7 +46,11 @@ class CLogDetEstimator : public CSGObject * * @param sparse_mat the input Sparse matrix */ + #ifdef HAVE_EIGEN3 + #ifdef HAVE_LAPACK CLogDetEstimator(SGSparseMatrix sparse_mat); + #endif //HAVE_LAPACK + #endif //HAVE_EIGEN3 /** * constructor diff --git a/tests/unit/mathematics/linalg/LogDetEstimator_unittest.cc b/tests/unit/mathematics/linalg/LogDetEstimator_unittest.cc index 842b958ad3a..038f4074aab 100644 --- a/tests/unit/mathematics/linalg/LogDetEstimator_unittest.cc +++ b/tests/unit/mathematics/linalg/LogDetEstimator_unittest.cc @@ -75,6 +75,7 @@ TEST(LogDetEstimator, sample) SG_UNREF(e); } +#ifdef HAVE_LAPACK TEST(LogDetEstimator, Sparse_sample_constructor) { const index_t size=16; @@ -105,6 +106,7 @@ TEST(LogDetEstimator, Sparse_sample_constructor) SG_UNREF(op); SG_UNREF(e); } +#endif //HAVE_LAPACK #endif // EIGEN_VERSION_AT_LEAST(3,1,0) TEST(LogDetEstimator, sample_ratapp_dense)