Skip to content

Commit

Permalink
Fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed May 15, 2024
1 parent 6aaef74 commit 8d0d00b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
1 change: 1 addition & 0 deletions inst/include/dust2/cpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class dust_cpu {
std::swap(state_, state_next_);
}

template <typename Iter>
void set_state(Iter iter) {
std::copy_n(iter, state_.size(), state_.begin());
}
Expand Down
21 changes: 0 additions & 21 deletions inst/include/dust2/r/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,26 +244,5 @@ std::vector<typename T::data_type> check_data(cpp11::list r_data,
return data;
}

template <typename T>
void update_pars(dust_cpu<T>& obj, cpp11::list r_pars, bool grouped) {
if (grouped) {
const auto n_groups = obj.n_groups();
if (r_pars.size() != static_cast<int>(n_groups)) {
cpp11::stop("Expected 'pars' to have length %d to match 'n_groups'",
static_cast<int>(n_groups));
}
for (size_t i = 0; i < n_groups; ++i) {
cpp11::list r_pars_i = r_pars[i];
obj.update_shared(i, [&] (auto& shared) {
T::update_shared(r_pars_i, shared);
});
}
} else {
obj.update_shared(0, [&] (auto& shared) {
T::update_shared(r_pars, shared);
});
}
}

}
}

0 comments on commit 8d0d00b

Please sign in to comment.