Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 27, 2024
1 parent 9627078 commit 6ba4125
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion source/api_cc/include/commonPT.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct NeighborListDataPT {
std::vector<int*> firstneigh;

public:
void copy_from_nlist(const InputNlist& inlist, unsigned long int& max_num_neighbors);
void copy_from_nlist(const InputNlist& inlist,
unsigned long int& max_num_neighbors);
};
} // namespace deepmd
3 changes: 2 additions & 1 deletion source/api_cc/src/commonPT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ void NeighborListDataPT::copy_from_nlist(const InputNlist& inlist,
ilist.resize(inum);
numneigh.resize(inum);
memcpy(&ilist[0], inlist.ilist, inum * sizeof(int));
unsigned long int* max_element = std::max_element(inlist.numneigh, inlist.numneigh + inum);
unsigned long int* max_element =
std::max_element(inlist.numneigh, inlist.numneigh + inum);
max_num_neighbors = *max_element;
jlist.resize(inum * max_num_neighbors);
memset(&jlist[0], -1, inum * max_num_neighbors * sizeof(int));
Expand Down

0 comments on commit 6ba4125

Please sign in to comment.