Skip to content
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: remove the Psi Constructors using int* ngk_in #5745

Merged
merged 12 commits into from
Dec 24, 2024
Prev Previous commit
Next Next commit
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] authored Dec 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 665a11a876ab0f866c6f1c235ed9e9070126af5f
9 changes: 6 additions & 3 deletions source/module_hamilt_general/operator.cpp
Original file line number Diff line number Diff line change
@@ -11,7 +11,8 @@ Operator<T, Device>::Operator(){}
template<typename T, typename Device>
Operator<T, Device>::~Operator()
{
if(this->hpsi != nullptr) delete this->hpsi;
if(this->hpsi != nullptr) { delete this->hpsi;
}
Operator* last = this->next_op;
Operator* last_sub = this->next_sub_op;
while(last != nullptr || last_sub != nullptr)
@@ -103,9 +104,11 @@ void Operator<T, Device>::init(const int ik_in)
template<typename T, typename Device>
void Operator<T, Device>::add(Operator* next)
{
if(next==nullptr) return;
if(next==nullptr) { return;
}
next->is_first_node = false;
if(next->next_op != nullptr) this->add(next->next_op);
if(next->next_op != nullptr) { this->add(next->next_op);
}
Operator* last = this;
//loop to end of the chain
while(last->next_op != nullptr)