Skip to content

Commit 4e9acb6

Browse files
committed
delete vector
1 parent e03877c commit 4e9acb6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

source/module_cell/check_atomic_stru.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void Check_Atomic_Stru::check_atomic_stru(UnitCell& ucell, const double& factor)
4949
std::cout << mess.str();
5050
}
5151
}
52-
double* latvec = new double[9];
52+
std::vector<double> latvec (9);
5353
latvec[0] = ucell.a1.x;
5454
latvec[1] = ucell.a2.x;
5555
latvec[2] = ucell.a3.x;
@@ -59,7 +59,7 @@ void Check_Atomic_Stru::check_atomic_stru(UnitCell& ucell, const double& factor)
5959
latvec[6] = ucell.a1.z;
6060
latvec[7] = ucell.a2.z;
6161
latvec[8] = ucell.a3.z;
62-
double* A = new double[27 * 3];
62+
std::vector<double> A(27);
6363
std::vector<std::string> cell(27);
6464
std::vector<std::string> label(ntype);
6565
for (int i = 0; i < 27; i++)
@@ -133,13 +133,11 @@ void Check_Atomic_Stru::check_atomic_stru(UnitCell& ucell, const double& factor)
133133
<< sqrt_bon << " Bohr (" << sqrt_bon * bohr_to_a << " Angstrom)\n";
134134
}
135135
}
136-
} // ia2
137-
} // it2
138-
} // iat
139-
}
136+
}
137+
} // ia2
138+
} // it2
139+
} // iat
140140
}
141-
delete[] latvec;
142-
delete[] A;
143141
ModuleBase::timer::tick("Check_Atomic_Stru", "Check_Atomic_Stru");
144142
}
145143
if (!all_pass || !no_warning)

0 commit comments

Comments
 (0)