Skip to content

Commit 3d1ad16

Browse files
initial the file : source/module_ri/RI_2D_Comm.cpp and ABF_Construct (#3898)
* initial the file source/module_ri/RI_2D_Comm.cpp * the second initialization of module_ri/RI_2D_Comm.cpp * initialize the file ABFS-Construct-PCA * initialize the file ABF_Costruct_ * initialize the file ABFs_Construct-PCA.cpp --------- Co-authored-by: Mohan Chen <[email protected]>
1 parent 2065971 commit 3d1ad16

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

source/module_ri/ABFs_Construct-PCA.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace ABFs_Construct::PCA
2121
const int nr = a.shape[0];
2222
const int nc = a.shape[1];
2323

24-
double work_tmp;
24+
double work_tmp=0.0;
2525
constexpr int minus_one = -1;
2626
dsyev_(&jobz, &uplo, &nr, a.ptr(), &nc, w, &work_tmp, &minus_one, &info); // get best lwork
2727

@@ -117,7 +117,7 @@ namespace ABFs_Construct::PCA
117117
RI::Tensor<double> mm = A_sub.transpose() * A_sub;
118118
std::vector<double> eig_value(mm.shape[0]);
119119

120-
int info;
120+
int info=1;
121121

122122
tensor_dsyev('V', 'L', mm, eig_value.data(), info);
123123

@@ -150,4 +150,4 @@ namespace ABFs_Construct::PCA
150150
return eig;
151151
}
152152

153-
} // namespace ABFs_Construct::PCA
153+
} // namespace ABFs_Construct::PCA

source/module_ri/RI_2D_Comm.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ auto RI_2D_Comm::get_2D_judge(const Parallel_Orbitals &pv)
2222
for (int iwt0_2D = 0; iwt0_2D < pv.nrow; ++iwt0_2D)
2323
{
2424
const int iwt0 = pv.local2global_row(iwt0_2D);
25-
int iat0, iw0_b, is0_b;
25+
int iat0=0;int iw0_b=0;int is0_b=0;
2626
std::tie(iat0,iw0_b,is0_b) = RI_2D_Comm::get_iat_iw_is_block(iwt0);
2727
iat0_list[is0_b].insert(iat0);
2828
}
@@ -31,7 +31,7 @@ auto RI_2D_Comm::get_2D_judge(const Parallel_Orbitals &pv)
3131
for (int iwt1_2D = 0; iwt1_2D < pv.ncol; ++iwt1_2D)
3232
{
3333
const int iwt1 = pv.local2global_col(iwt1_2D);
34-
int iat1, iw1_b, is1_b;
34+
int iat1=0;int iw1_b=0;int is1_b=0;
3535
std::tie(iat1,iw1_b,is1_b) = RI_2D_Comm::get_iat_iw_is_block(iwt1);
3636
iat1_list[is1_b].insert(iat1);
3737
}
@@ -68,4 +68,5 @@ RI_2D_Comm::get_ik_list(const K_Vectors &kv, const int is_k)
6868
if(kv.isk[ik]==is_k)
6969
ik_list.push_back(ik);
7070
return ik_list;
71-
}
71+
}
72+

0 commit comments

Comments
 (0)