From d3b1c5f8b48281716a62505003cd2b8755e5c95f Mon Sep 17 00:00:00 2001 From: MarcoMultichannel <52574870+MarcoMultichannel@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:39:54 -0600 Subject: [PATCH] eigh size fix Fixed eigh() when the Matrix is too big. The first time syevd is called is to get the work size, but sometimes the size returned is less than the minimum size allowed. Adding a simple condition fixed it for me. --- include/xtensor-blas/xlapack.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/xtensor-blas/xlapack.hpp b/include/xtensor-blas/xlapack.hpp index af86971..fd433c0 100644 --- a/include/xtensor-blas/xlapack.hpp +++ b/include/xtensor-blas/xlapack.hpp @@ -609,6 +609,9 @@ namespace xt XTENSOR_THROW(std::runtime_error, "Could not find workspace size for syevd."); } + int min_size = 1 + 6*N + (2*N)*(2*N); + if(work[0]