forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: change R_index
in class AtomPair
to type ModuleBase::vector3<int>
#4243
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DylanWRh
changed the title
Refactor
Refactor: change May 27, 2024
R_index
in AtomPair
R_index
in class AtomPair
to ModuleBase::vector3
DylanWRh
changed the title
Refactor: change
Refactor: change May 27, 2024
R_index
in class AtomPair
to ModuleBase::vector3
R_index
in class AtomPair
to type ModuleBase::vector3<int>
dyzheng
requested changes
Jun 3, 2024
source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/overlap_new.cpp
Outdated
Show resolved
Hide resolved
dyzheng
approved these changes
Jun 13, 2024
16 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reminder
What's changed?
This pull request addresses the type inconsistency of the
R_index
variable across different modules. Previously, theR_index
variable in theAtomPair
class was of typestd::vector<int>
, while in some other modules it was of typeModuleBase::Vector3<int>
. This inconsistency could potentially lead to confusion and errors. So I modify the code underAtomPair
and also other modules which use itsR_index
for code consistency and maintenance.AtomPair::R_index
is changed fromstd::vector<int>
tostd::vector<ModuleBase::Vector3<int>>
.HContainer::tmp_R_index
is changed fromstd::vector<int>
tostd::vector<ModuleBase::Vector3<int>>
.AtomPair::get_R_index
is changed fromint*
toModuleBase::Vector3<int>
.R_index
is changed fromR_index[i*3], R_index[i*3+1], R_index[i*3+2]
toR_index[i].x, R_index[i].y, R_index[i].z
. The functions of size and memory calculation is also modified. (i.e. remove some*3
and/3
operations).HContainer::tmp_R_index
is changed to fit the new return type. For example, line 87 and 88 inmodule_io/td_current_io.cpp
is changed fromImportant Notes
R_index
, the originalAtomPair::get_R_index
will returnnullptr
while the modified version will returnModuleBase::Vector3<int>(-1, -1, -1))
test_hcontainer.cpp
andtest_hcontainer_complex.cpp
is changed to fit the new return type.