From 49264c5844828e7ff6301f68e81ad649c28697d5 Mon Sep 17 00:00:00 2001 From: dzzz2001 Date: Wed, 12 Nov 2025 20:09:41 +0800 Subject: [PATCH 1/2] fix a bug caused by intel compiler --- source/source_base/ylm.cpp | 6 +++--- source/source_base/ylm.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/source_base/ylm.cpp b/source/source_base/ylm.cpp index a36b14c60a..4c4d9888ea 100644 --- a/source/source_base/ylm.cpp +++ b/source/source_base/ylm.cpp @@ -808,9 +808,9 @@ void Ylm::rl_sph_harm void Ylm::grad_rl_sph_harm ( const int& Lmax, //max momentum of L - const double& x, - const double& y, - const double& z, + const double x, + const double y, + const double z, double* rly, double** grly ) diff --git a/source/source_base/ylm.h b/source/source_base/ylm.h index 65adcf18f6..ce0a049571 100644 --- a/source/source_base/ylm.h +++ b/source/source_base/ylm.h @@ -124,9 +124,9 @@ class Ylm */ static void grad_rl_sph_harm( const int& Lmax, - const double& x, - const double& y, - const double& z, + const double x, + const double y, + const double z, double* rly, double** grly); From 267be9b18c4af8fa0cfaac417b267409f09d3182 Mon Sep 17 00:00:00 2001 From: dzzz2001 Date: Wed, 12 Nov 2025 22:03:45 +0800 Subject: [PATCH 2/2] change const reference to const value --- source/source_base/ylm.cpp | 42 +++++++++++++++++++------------------- source/source_base/ylm.h | 42 +++++++++++++++++++------------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/source/source_base/ylm.cpp b/source/source_base/ylm.cpp index 4c4d9888ea..aa24565f56 100644 --- a/source/source_base/ylm.cpp +++ b/source/source_base/ylm.cpp @@ -324,10 +324,10 @@ void Ylm::get_ylm_real( const int &Lmax, const ModuleBase::Vector3 &vec, * *************************/ void Ylm::rlylm ( - const int& Lmax, //max momentum of l + 1 - const double& x, - const double& y, - const double& z, + const int Lmax, //max momentum of l + 1 + const double x, + const double y, + const double z, double rly[] ) { @@ -529,10 +529,10 @@ void Ylm::rlylm //return ylm, not rlylm void Ylm::sph_harm ( - const int& Lmax, //max momentum of l - const double& xdr, - const double& ydr, - const double& zdr, + const int Lmax, //max momentum of l + const double xdr, + const double ydr, + const double zdr, std::vector &rly ) { @@ -668,10 +668,10 @@ void Ylm::sph_harm // Peize Lin change rly 2016-08-26 void Ylm::rl_sph_harm ( - const int& Lmax, //max momentum of L - const double& x, - const double& y, - const double& z, + const int Lmax, //max momentum of L + const double x, + const double y, + const double z, std::vector& rly ) { @@ -807,7 +807,7 @@ void Ylm::rl_sph_harm void Ylm::grad_rl_sph_harm ( - const int& Lmax, //max momentum of L + const int Lmax, //max momentum of L const double x, const double y, const double z, @@ -1097,10 +1097,10 @@ void Ylm::grad_rl_sph_harm void Ylm::hes_rl_sph_harm ( - const int& Lmax, //max momentum of L - const double& x, - const double& y, - const double& z, + const int Lmax, //max momentum of L + const double x, + const double y, + const double z, std::vector>& hrly ) { @@ -1394,10 +1394,10 @@ void Ylm::test2 (void) void Ylm::rlylm ( - const int& Lmax, //max momentum of l + 1 - const double& x, - const double& y, - const double& z, + const int Lmax, //max momentum of l + 1 + const double x, + const double y, + const double z, double rly[], double grly[][3] ) diff --git a/source/source_base/ylm.h b/source/source_base/ylm.h index ce0a049571..1d098bd961 100644 --- a/source/source_base/ylm.h +++ b/source/source_base/ylm.h @@ -53,10 +53,10 @@ class Ylm * @param rly [in] calculated Ylm, Y00, Y10, Y11, Y1-1, Y20, Y21, Y2-1, Y22, Y2-2... */ static void rlylm( - const int& Lmax, - const double& x, - const double& y, - const double& z, + const int Lmax, + const double x, + const double y, + const double z, double rly[]); /** @@ -70,10 +70,10 @@ class Ylm * @param grly [out] gradient of Ylm, [dY00/dx, dY00/dy, dY00/dz], [dY10/dx, dY10/dy, dY10/dz], [dY11/dx, dY11/dy, dY11/dz],... */ static void rlylm( - const int& Lmax, - const double& x, - const double& y, - const double& z, + const int Lmax, + const double x, + const double y, + const double z, double rly[], double grly[][3]); @@ -87,10 +87,10 @@ class Ylm * @param rly [in] calculated Ylm, Y00, Y10, Y11, Y1-1, Y20, Y21, Y2-1, Y22, Y2-2... */ static void sph_harm( - const int& Lmax, - const double& xdr, - const double& ydr, - const double& zdr, + const int Lmax, + const double xdr, + const double ydr, + const double zdr, std::vector &rly); /** @@ -105,10 +105,10 @@ class Ylm * @date 2016-08-26 */ static void rl_sph_harm( - const int& Lmax, - const double& x, - const double& y, - const double& z, + const int Lmax, + const double x, + const double y, + const double z, std::vector& rly); /** @@ -123,7 +123,7 @@ class Ylm * grly should be a memory-contiguous two-dimensional array for better performance. */ static void grad_rl_sph_harm( - const int& Lmax, + const int Lmax, const double x, const double y, const double z, @@ -140,10 +140,10 @@ class Ylm * @param hrly [out] hessian of Ylm, [dY00/dx2, dY00/dxy, dY00/dxz, dY00/dyy, dY00/dyz, dY00/dzz] , ... */ static void hes_rl_sph_harm( - const int& Lmax, - const double& x, - const double& y, - const double& z, + const int Lmax, + const double x, + const double y, + const double z, std::vector>& hrly); //calculate the coefficient of Ylm, ylmcoef.