Skip to content

Commit

Permalink
Eliminate unnecessary copy, make sure it does not break things this time
Browse files Browse the repository at this point in the history
  • Loading branch information
ddemidov committed Nov 29, 2015
1 parent a2403e0 commit 2a0b050
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions amgcl/relaxation/spai0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct spai0 {

const size_t n = rows(A);

std::vector<value_type> m(n);
boost::shared_ptr< std::vector<value_type> > m = boost::make_shared< std::vector<value_type> >(n);

#pragma omp parallel for
for(ptrdiff_t i = 0; i < static_cast<ptrdiff_t>(n); ++i) {
Expand All @@ -79,7 +79,7 @@ struct spai0 {
if (a.col() == i) num += v;
}

m[i] = num / den;
(*m)[i] = num / den;
}

M = Backend::copy_vector(m, backend_prm);
Expand Down

0 comments on commit 2a0b050

Please sign in to comment.