Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
gaow committed Mar 9, 2024
1 parent 078d7d5 commit e84ad9f
Show file tree
Hide file tree
Showing 2 changed files with 231 additions and 227 deletions.
42 changes: 21 additions & 21 deletions src/mr_ash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ List rcpp_mr_ash_rss(const NumericVector& bhat, const NumericVector& shat, const
const NumericVector& w0, const NumericVector& mu1_init, double tol = 1e-8,
int max_iter = 1e5, bool update_w0 = true, bool update_sigma = true,
bool compute_ELBO = true, bool standardize = false) {
// Convert input types
vec bhat_vec = as<vec>(bhat);
vec shat_vec = as<vec>(shat);
vec z_vec = as<vec>(z);
mat R_mat = as<mat>(R);
vec s0_vec = as<vec>(s0);
vec w0_vec = as<vec>(w0);
vec mu1_init_vec = as<vec>(mu1_init);
// Call the C++ function
unordered_map<string, mat> result = mr_ash_rss(bhat_vec, shat_vec, z_vec, R_mat, var_y, n, sigma2_e, s0_vec, w0_vec,
mu1_init_vec, tol, max_iter, update_w0, update_sigma, compute_ELBO,
standardize);
// Convert the result to a list
List ret;
for (const auto& item : result) {
ret[item.first] = wrap(item.second);
}
return ret;
// Convert input types
vec bhat_vec = as<vec>(bhat);
vec shat_vec = as<vec>(shat);
vec z_vec = as<vec>(z);
mat R_mat = as<mat>(R);
vec s0_vec = as<vec>(s0);
vec w0_vec = as<vec>(w0);
vec mu1_init_vec = as<vec>(mu1_init);

// Call the C++ function
unordered_map<string, mat> result = mr_ash_rss(bhat_vec, shat_vec, z_vec, R_mat, var_y, n, sigma2_e, s0_vec, w0_vec,
mu1_init_vec, tol, max_iter, update_w0, update_sigma, compute_ELBO,
standardize);

// Convert the result to a list
List ret;
for (const auto& item : result) {
ret[item.first] = wrap(item.second);
}

return ret;
}
Loading

0 comments on commit e84ad9f

Please sign in to comment.