Skip to content

Commit

Permalink
Merge branch 'feature/pt2' of github.com:wavefunction91/MACIS into fe…
Browse files Browse the repository at this point in the history
…ature/pt2
  • Loading branch information
wavefunction91 committed Nov 9, 2023
2 parents 7514991 + 3e586dc commit da4030b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/macis/hamiltonian_generator/sorted_double_loop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class SortedDoubleLoopHamiltonianGenerator
// size_t skip2 = 0;

auto fast_insert = [](auto& old_vec, auto&& new_vec) {
if(old_vec.size() == 0) old_vec = std::move(new_vec);
if(old_vec.size() == 0)
old_vec = std::move(new_vec);
else {
old_vec.reserve(old_vec.size() + new_vec.size());
old_vec.insert(old_vec.end(), new_vec.begin(), new_vec.end());
Expand Down Expand Up @@ -212,7 +213,7 @@ class SortedDoubleLoopHamiltonianGenerator
#else
fast_insert(row_ind, row_ind_loc);
fast_insert(col_ind, col_ind_loc);
fast_insert(nz_val, nz_val_loc );
fast_insert(nz_val, nz_val_loc);
#endif
}

Expand Down

0 comments on commit da4030b

Please sign in to comment.