add InputNlist into API doc#1009
Conversation
This struct is necessary for C++ APIs.
Codecov Report
@@ Coverage Diff @@
## devel #1009 +/- ##
==========================================
+ Coverage 74.59% 82.86% +8.26%
==========================================
Files 86 119 +33
Lines 6921 10110 +3189
==========================================
+ Hits 5163 8378 +3215
+ Misses 1758 1732 -26
Continue to review full report at Codecov.
|
source/api_cc/include/common.h
Outdated
| std::vector<std::vector<int> > jlist; | ||
| /// Array stores the core region atom's neighbor atom number | ||
| std::vector<int > numneigh; | ||
| /// Array stores the core region atom's neighbor index |
There was a problem hiding this comment.
this comment is for numneigh. Place it above std::vector<int > numneigh;?
The dsame issue for ilist and jlist
There was a problem hiding this comment.
In #968, I see @denghuilu add the same comment to InputNlist::firstneigh. Isn't it the same thing as NeighborListData::firstneigh? Did I understand wrongly?
There was a problem hiding this comment.
I think jlist stores the same thing as firstneigh
There was a problem hiding this comment.
@denghuilu @njzjz jlist stores the indexes of all the neighbors. firstneigh[i] stores the location of the first neighbor of i. So the neighbors of i are stored in jlist[firstneigh[i] : firstneigh[i] + numneigh[i]
@denghuilu Please check again you code you really use the neighbor list correctly....
There was a problem hiding this comment.
@amcadmus I think you are right, so the NeighborListData is used to construct the InputNlist. From my point of view, firstneigh is a two-dimensional array that stores neighbor atom's index, even if it only refers to a series of jlist locations. I'm using the InputNlist in the custom op, so I think it's fine.
source/api_cc/include/common.h
Outdated
| std::vector<std::vector<int> > jlist; | ||
| /// Array stores the core region atom's neighbor atom number | ||
| std::vector<int > numneigh; | ||
| /// Array stores the core region atom's neighbor index |
There was a problem hiding this comment.
I think jlist stores the same thing as firstneigh
Co-authored-by: Denghui Lu <ludenghui.cs@gmail.com>
* add `InputNlist` into API doc This struct is necessary for C++ APIs. * Apply suggestions from code review Co-authored-by: Denghui Lu <ludenghui.cs@gmail.com> * update comment for `firstneigh` Co-authored-by: Denghui Lu <ludenghui.cs@gmail.com>
This struct is necessary for C++ APIs. Without document, no one can understand this struct...
@Yi-FanLi I believe you need it.
Preview below: