diff --git a/exputil/EmpCylSL.cc b/exputil/EmpCylSL.cc index 79f6970ad..2e0c9514b 100644 --- a/exputil/EmpCylSL.cc +++ b/exputil/EmpCylSL.cc @@ -3336,6 +3336,20 @@ void EmpCylSL::eigen_problem(int request_id, int M, Timer& timer) efE = esE.eigenvectors().real(); efO = esO.eigenvectors().real(); + // Choose sign conventions for the ef table + // + int nfid = std::min(4, efE.rows()) - 1; + + // Even case + for (int j=0; j(4, efE.rows()) - 1; + for (int j=0; j(4, efE.rows()) - 1; + + // Even case + // + for (int j=0; j(4, efE.rows()) - 1; + for (int j=0; jevalJK = es.eigenvalues().real(); (*pb)[mm]->evecJK = es.eigenvectors().real(); + + // Sign convention + // + int nfid = std::min(4, efE.rows()) - 1; + for (int j=0; j<(*pb)[mm]->evecJK.cols(); j++) { + if ((*pb)[mm]->evecJK(nfid, j) < 0.0) (*pb)[mm]->evecJK.col(j) *= -1; + } + } // Transformation output @@ -4479,6 +4532,14 @@ void EmpCylSL::pca_hall(bool compute, bool subsamp) evalVar = es.eigenvalues().real(); evecVar = es.eigenvectors().real(); + // Sign convention for eigenvectors + // + int nfid = std::min(4, evecVar.rows()) - 1; + for (int j=0; jef.resize(N, numr); + // Choose sign conventions for the ef table + // + int nfid = std::min(nevsign, N) - 1; + Eigen::VectorXi sgn = Eigen::VectorXi::Ones(N); + for (int j=0; jef(j, i) = ef[j*NUM+i]; + table->ef(j, i) = ef[j*NUM+i] * sgn(j); } table->l = l; @@ -2862,15 +2870,24 @@ void SLGridSph::compute_table_worker(void) } } } - // Load table + // Load table + // table.ev.resize(N); for (int i=0; i(nevsign, N) - 1; + Eigen::VectorXi sgn = Eigen::VectorXi::Ones(N); + for (int j=0; j #include +#include +using namespace __EXP__; + #if HAVE_LIBCUDA==1 #include #include diff --git a/include/libvars.H b/include/libvars.H index 3440e8324..ee9e4f2f3 100644 --- a/include/libvars.H +++ b/include/libvars.H @@ -36,6 +36,9 @@ namespace __EXP__ //! Control flag for source/line debug info extern bool sourceline; + //! Sign convention element rank for eigenfunctions and eigenvectors + extern int nevsign; + }; #endif // END _LIBVARS_H diff --git a/src/expand.cc b/src/expand.cc index 6c506f94a..393426e8d 100644 --- a/src/expand.cc +++ b/src/expand.cc @@ -636,12 +636,9 @@ main(int argc, char** argv) // Initialize slurm api //===================== #ifdef HAVE_LIBSLURM - { - int rc = slurm_init(0); - if (rc != SLURM_SUCCESS) - std::cerr << "EXP [" << myid << "]: error initializing Slurm API: " - << slurm_strerror(rc) << std::endl; - } +#if SLURM_VERSION_NUMBER > SLURM_VERSION_NUM(21,10,0) + slurm_init(0); +#endif #endif //============================================== @@ -795,7 +792,9 @@ main(int argc, char** argv) //====================== #ifdef HAVE_LIBSLURM +#if SLURM_VERSION_NUMBER > SLURM_VERSION_NUM(21,10,0) slurm_fini(); +#endif #endif //=================