From 9eca672ea74c47ad48b243554cbaaa91c47572a7 Mon Sep 17 00:00:00 2001 From: conrad Date: Tue, 22 Dec 2020 15:59:21 +1000 Subject: [PATCH] various fixes --- include/armadillo_bits/fn_eigs_gen.hpp | 6 +++--- include/armadillo_bits/sp_auxlib_meat.hpp | 11 +++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/armadillo_bits/fn_eigs_gen.hpp b/include/armadillo_bits/fn_eigs_gen.hpp index 33028566..47aa6859 100644 --- a/include/armadillo_bits/fn_eigs_gen.hpp +++ b/include/armadillo_bits/fn_eigs_gen.hpp @@ -105,7 +105,7 @@ eigs_gen // If X is real and sigma is truly complex, treat X as complex. // The reason is that we are still not able to apply truly complex shifts to real matrices - if( (is_same_type::yes) && (std::abs(std::imag(sigma)) > std::numeric_limits::epsilon()) ) + if( (is_real::yes) && (std::imag(sigma) != T(0)) ) { status = sp_auxlib::eigs_gen(eigval, eigvec, conv_to< SpMat< std::complex > >::from(X), n_eigvals, sigma, opts); } @@ -245,7 +245,7 @@ eigs_gen // If X is real and sigma is truly complex, treat X as complex. // The reason is that we are still not able to apply truly complex shifts to real matrices - if( (is_same_type::yes) && (std::abs(std::imag(sigma)) > std::numeric_limits::epsilon()) ) + if( (is_real::yes) && (std::imag(sigma) != T(0)) ) { status = sp_auxlib::eigs_gen(eigval, eigvec, conv_to< SpMat< std::complex > >::from(X), n_eigvals, sigma, opts); } @@ -388,7 +388,7 @@ eigs_gen // If X is real and sigma is truly complex, treat X as complex. // The reason is that we are still not able to apply truly complex shifts to real matrices - if( (is_same_type::yes) && (std::abs(std::imag(sigma)) > std::numeric_limits::epsilon()) ) + if( (is_real::yes) && (std::imag(sigma) != T(0)) ) { status = sp_auxlib::eigs_gen(eigval, eigvec, conv_to< SpMat< std::complex > >::from(X), n_eigvals, sigma, opts); } diff --git a/include/armadillo_bits/sp_auxlib_meat.hpp b/include/armadillo_bits/sp_auxlib_meat.hpp index 8bff738f..2e44838f 100644 --- a/include/armadillo_bits/sp_auxlib_meat.hpp +++ b/include/armadillo_bits/sp_auxlib_meat.hpp @@ -53,6 +53,7 @@ sp_auxlib::interpret_form_str(const char* form_str) +//! immediate eigendecomposition of symmetric real sparse object template inline bool @@ -85,7 +86,6 @@ sp_auxlib::eigs_sym(Col& eigval, Mat& eigvec, const SpBase& X, c { arma_ignore(eigval); arma_ignore(eigvec); - arma_ignore(X); arma_ignore(n_eigvals); arma_ignore(form_val); arma_ignore(opts); @@ -98,6 +98,7 @@ sp_auxlib::eigs_sym(Col& eigval, Mat& eigvec, const SpBase& X, c +//! immediate eigendecomposition of symmetric real sparse object template inline bool @@ -392,6 +393,7 @@ sp_auxlib::eigs_sym_arpack(Col& eigval, Mat& eigvec, const SpMat& X, arma_ignore(X); arma_ignore(n_eigvals); arma_ignore(form_val); + arma_ignore(sigma) arma_ignore(opts); return false; @@ -713,7 +715,7 @@ sp_auxlib::eigs_gen_arpack(Col< std::complex >& eigval, Mat< std::complex // WARNING!!! // We are still not able to apply truly complex shifts to real matrices, - // in which case the OP that ARPACKS wants is different (see [s/d]naupd). + // in which case the OP that ARPACK wants is different (see [s/d]naupd). // Also, if sigma contains a non-zero imaginary part, retrieving the eigenvalues // becomes utterly messy (see [s/d]eupd, remark #3). // We should never get to the point in which the imaginary part of sigma is non-zero; @@ -831,6 +833,7 @@ sp_auxlib::eigs_gen_arpack(Col< std::complex >& eigval, Mat< std::complex +//! immediate eigendecomposition of non-symmetric complex sparse object template inline bool @@ -849,6 +852,7 @@ sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigv +//! immediate eigendecomposition of non-symmetric complex sparse object template inline bool @@ -856,7 +860,7 @@ sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigv { arma_extra_debug_sigprint(); - #if (defined(ARMA_USE_APRACK) && defined(ARMA_USE_SUPERLU)) + #if (defined(ARMA_USE_ARPACK) && defined(ARMA_USE_SUPERLU)) { const unwrap_spmat U(X_expr.get_ref()); @@ -881,7 +885,6 @@ sp_auxlib::eigs_gen(Col< std::complex >& eigval, Mat< std::complex >& eigv -//! immediate eigendecomposition of non-symmetric complex sparse object template inline bool