Skip to content

Commit

Permalink
MM-57: reset asap (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdstamp authored Apr 1, 2022
1 parent 9259191 commit 1c1a9fd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/MAPIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,11 @@ Rcpp::List MAPITCpp(
b.col(z + 1) = arma::trans(x_k);

arma::mat M = compute_projection_matrix(n, b);
b.reset();
arma::mat Kc = M * K * M;
K.reset();
arma::mat Gc = M * G * M;
G.reset();
arma::mat Cc;
std::vector<arma::mat> matrices;

Expand All @@ -184,18 +187,15 @@ Rcpp::List MAPITCpp(
} else {
matrices = {Gc, Kc, M};
}
const arma::mat Yc = Y * M;
end = steady_clock::now();
execution_t(i, 1) = duration_cast<microseconds>(end - start).count();

M.reset();
K.reset();
G.reset();
b.reset();
Kc.reset();
Gc.reset();
Cc.reset();

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

arma::mat q;
std::vector<arma::vec> phenotypes;
start = steady_clock::now();
Expand Down

0 comments on commit 1c1a9fd

Please sign in to comment.