Skip to content

Commit 7baaab1

Browse files
authored
Fix: fix a bug caused by intel compiler (#6703)
* fix a bug caused by intel compiler * change const reference to const value
1 parent 5a7a30a commit 7baaab1

File tree

2 files changed

+48
-48
lines changed

2 files changed

+48
-48
lines changed

source/source_base/ylm.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,10 @@ void Ylm::get_ylm_real( const int &Lmax, const ModuleBase::Vector3<double> &vec,
324324
* *************************/
325325
void Ylm::rlylm
326326
(
327-
const int& Lmax, //max momentum of l + 1
328-
const double& x,
329-
const double& y,
330-
const double& z,
327+
const int Lmax, //max momentum of l + 1
328+
const double x,
329+
const double y,
330+
const double z,
331331
double rly[]
332332
)
333333
{
@@ -529,10 +529,10 @@ void Ylm::rlylm
529529
//return ylm, not rlylm
530530
void Ylm::sph_harm
531531
(
532-
const int& Lmax, //max momentum of l
533-
const double& xdr,
534-
const double& ydr,
535-
const double& zdr,
532+
const int Lmax, //max momentum of l
533+
const double xdr,
534+
const double ydr,
535+
const double zdr,
536536
std::vector<double> &rly
537537
)
538538
{
@@ -668,10 +668,10 @@ void Ylm::sph_harm
668668
// Peize Lin change rly 2016-08-26
669669
void Ylm::rl_sph_harm
670670
(
671-
const int& Lmax, //max momentum of L
672-
const double& x,
673-
const double& y,
674-
const double& z,
671+
const int Lmax, //max momentum of L
672+
const double x,
673+
const double y,
674+
const double z,
675675
std::vector<double>& rly
676676
)
677677
{
@@ -807,10 +807,10 @@ void Ylm::rl_sph_harm
807807

808808
void Ylm::grad_rl_sph_harm
809809
(
810-
const int& Lmax, //max momentum of L
811-
const double& x,
812-
const double& y,
813-
const double& z,
810+
const int Lmax, //max momentum of L
811+
const double x,
812+
const double y,
813+
const double z,
814814
double* rly,
815815
double** grly
816816
)
@@ -1097,10 +1097,10 @@ void Ylm::grad_rl_sph_harm
10971097

10981098
void Ylm::hes_rl_sph_harm
10991099
(
1100-
const int& Lmax, //max momentum of L
1101-
const double& x,
1102-
const double& y,
1103-
const double& z,
1100+
const int Lmax, //max momentum of L
1101+
const double x,
1102+
const double y,
1103+
const double z,
11041104
std::vector<std::vector<double>>& hrly
11051105
)
11061106
{
@@ -1394,10 +1394,10 @@ void Ylm::test2 (void)
13941394

13951395
void Ylm::rlylm
13961396
(
1397-
const int& Lmax, //max momentum of l + 1
1398-
const double& x,
1399-
const double& y,
1400-
const double& z,
1397+
const int Lmax, //max momentum of l + 1
1398+
const double x,
1399+
const double y,
1400+
const double z,
14011401
double rly[],
14021402
double grly[][3]
14031403
)

source/source_base/ylm.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ class Ylm
5353
* @param rly [in] calculated Ylm, Y00, Y10, Y11, Y1-1, Y20, Y21, Y2-1, Y22, Y2-2...
5454
*/
5555
static void rlylm(
56-
const int& Lmax,
57-
const double& x,
58-
const double& y,
59-
const double& z,
56+
const int Lmax,
57+
const double x,
58+
const double y,
59+
const double z,
6060
double rly[]);
6161

6262
/**
@@ -70,10 +70,10 @@ class Ylm
7070
* @param grly [out] gradient of Ylm, [dY00/dx, dY00/dy, dY00/dz], [dY10/dx, dY10/dy, dY10/dz], [dY11/dx, dY11/dy, dY11/dz],...
7171
*/
7272
static void rlylm(
73-
const int& Lmax,
74-
const double& x,
75-
const double& y,
76-
const double& z,
73+
const int Lmax,
74+
const double x,
75+
const double y,
76+
const double z,
7777
double rly[],
7878
double grly[][3]);
7979

@@ -87,10 +87,10 @@ class Ylm
8787
* @param rly [in] calculated Ylm, Y00, Y10, Y11, Y1-1, Y20, Y21, Y2-1, Y22, Y2-2...
8888
*/
8989
static void sph_harm(
90-
const int& Lmax,
91-
const double& xdr,
92-
const double& ydr,
93-
const double& zdr,
90+
const int Lmax,
91+
const double xdr,
92+
const double ydr,
93+
const double zdr,
9494
std::vector<double> &rly);
9595

9696
/**
@@ -105,10 +105,10 @@ class Ylm
105105
* @date 2016-08-26
106106
*/
107107
static void rl_sph_harm(
108-
const int& Lmax,
109-
const double& x,
110-
const double& y,
111-
const double& z,
108+
const int Lmax,
109+
const double x,
110+
const double y,
111+
const double z,
112112
std::vector<double>& rly);
113113

114114
/**
@@ -123,10 +123,10 @@ class Ylm
123123
* grly should be a memory-contiguous two-dimensional array for better performance.
124124
*/
125125
static void grad_rl_sph_harm(
126-
const int& Lmax,
127-
const double& x,
128-
const double& y,
129-
const double& z,
126+
const int Lmax,
127+
const double x,
128+
const double y,
129+
const double z,
130130
double* rly,
131131
double** grly);
132132

@@ -140,10 +140,10 @@ class Ylm
140140
* @param hrly [out] hessian of Ylm, [dY00/dx2, dY00/dxy, dY00/dxz, dY00/dyy, dY00/dyz, dY00/dzz] , ...
141141
*/
142142
static void hes_rl_sph_harm(
143-
const int& Lmax,
144-
const double& x,
145-
const double& y,
146-
const double& z,
143+
const int Lmax,
144+
const double x,
145+
const double y,
146+
const double z,
147147
std::vector<std::vector<double>>& hrly);
148148

149149
//calculate the coefficient of Ylm, ylmcoef.

0 commit comments

Comments
 (0)