Skip to content

Commit

Permalink
MM-87 wrap long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
jdstamp committed Aug 18, 2023
1 parent ef63ff5 commit c40215a
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/MAPIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ Rcpp::List MAPITCpp(
G = compute_g_matrix(K, x_k);

auto end = steady_clock::now();
execution_t(i, 0) = duration_cast<milliseconds>(end - start).count();
execution_t(i, 0) = duration_cast<milliseconds>(
end - start).count();

#ifdef WITH_LOGGER_FINE
logger->info("Dimensions of polygenic background: {} x {}.", K.n_cols,
Expand All @@ -182,7 +183,8 @@ Rcpp::List MAPITCpp(

const arma::mat Yc = Y * M;
end = steady_clock::now();
execution_t(i, 1) = duration_cast<milliseconds>(end - start).count();
execution_t(i, 1) = duration_cast<milliseconds>(
end - start).count();

arma::mat q;
std::vector <arma::vec> phenotypes;
Expand All @@ -195,17 +197,20 @@ Rcpp::List MAPITCpp(
phenotypes = matrix_to_vector_of_rows(yc.as_row());
}
end = steady_clock::now();
execution_t(i, 2) = duration_cast<milliseconds>(end - start).count();
execution_t(i, 2) = duration_cast<milliseconds>(
end - start).count();

start = steady_clock::now();
q = compute_q_matrix(phenotypes, matrices);
end = steady_clock::now();
execution_t(i, 3) = duration_cast<milliseconds>(end - start).count();
execution_t(i, 3) = duration_cast<milliseconds>(
end - start).count();

start = steady_clock::now();
arma::mat S = compute_s_matrix(matrices);
end = steady_clock::now();
execution_t(i, 4) = duration_cast<milliseconds>(end - start).count();
execution_t(i, 4) = duration_cast<milliseconds>(
end - start).count();

// Compute delta and Sinv
const float det_S = arma::det(S);
Expand All @@ -230,7 +235,8 @@ Rcpp::List MAPITCpp(
start = steady_clock::now();
if (testMethod == "normal") {
arma::vec var_delta =
compute_variance_delta(phenotypes, Sinv, delta, matrices);
compute_variance_delta(phenotypes, Sinv, delta,
matrices);
// Save SE of the epistasis component
sigma_se.row(i) = arma::trans(sqrt(var_delta));
#ifdef WITH_LOGGER_FINE
Expand All @@ -254,7 +260,8 @@ Rcpp::List MAPITCpp(
}
}
end = ::steady_clock::now();
execution_t(i, 5) = duration_cast<milliseconds>(end - start).count();
execution_t(i, 5) = duration_cast<milliseconds>(
end - start).count();
// Compute the PVE
pve.row(i) = compute_pve(delta, 0);
#ifdef WITH_LOGGER_FINE
Expand All @@ -271,7 +278,8 @@ Rcpp::List MAPITCpp(
logger->info("Return from davies method.");
#endif
return Rcpp::List::create(
Rcpp::Named("Est") = sigma_est, Rcpp::Named("Eigenvalues") = Lambda,
Rcpp::Named("Est") = sigma_est,
Rcpp::Named("Eigenvalues") = Lambda,
Rcpp::Named("PVE") = pve, Rcpp::Named("timings") = execution_t);
} else {
#ifdef WITH_LOGGER
Expand Down

0 comments on commit c40215a

Please sign in to comment.