|
2 | 2 | #include "paramEst.h" |
3 | 3 | #include "computeMatrices.h" |
4 | 4 | #include "utils.h" |
5 | | -#include "solveQP.h" |
6 | 5 | #include<RcppArmadillo.h> |
7 | 6 | #ifdef _OPENMP |
8 | 7 | #include <omp.h> |
@@ -358,8 +357,7 @@ arma::vec estHasemanElstonConstrained(const arma::mat& Z, const arma::mat& PREML |
358 | 357 | // solve by linear least squares |
359 | 358 | arma::vec _he_update(c+1); |
360 | 359 |
|
361 | | - // use RcppML NNLS (needs casting Eigen <-> arma) |
362 | | - // _he_update = solveQP(vecZ, Ybig, _he_update); |
| 360 | + // Tried RcppML NNLS but arma <> eigen cast is too expensive |
363 | 361 | _he_update = nnlsSolve(vecZ, Ybig, _he_update, Iters); |
364 | 362 |
|
365 | 363 | return _he_update; |
@@ -390,7 +388,6 @@ arma::vec estHasemanElstonConstrainedML(const arma::mat& Z, const Rcpp::List& u_ |
390 | 388 |
|
391 | 389 | // solve by linear least squares |
392 | 390 | arma::vec _he_update(c+1); |
393 | | - // _he_update = solveQP(vecZ, Ybig, _he_update); |
394 | 391 | _he_update = nnlsSolve(vecZ, Ybig, _he_update, Iters); |
395 | 392 |
|
396 | 393 | return _he_update; |
@@ -424,7 +421,6 @@ arma::vec estHasemanElstonConstrainedGenetic(const arma::mat& Z, const arma::mat |
424 | 421 | arma::mat vecZ = vectoriseZGenetic(Z, u_indices, PREML, PZ, Kin); // projection already applied |
425 | 422 |
|
426 | 423 | arma::vec _he_update(c+1); |
427 | | - // _he_update = solveQP(vecZ, Ybig, _he_update); |
428 | 424 | _he_update = nnlsSolve(vecZ, Ybig, _he_update, Iters); |
429 | 425 |
|
430 | 426 | return _he_update; |
@@ -455,11 +451,10 @@ arma::vec estHasemanElstonConstrainedGeneticML(const arma::mat& Z, |
455 | 451 | arma::mat vecZ = vectoriseZGeneticML(Z, u_indices, Kin); // projection already applied |
456 | 452 |
|
457 | 453 | arma::vec _he_update(c+1); |
458 | | - // _he_update = solveQP(vecZ, Ybig, _he_update); |
459 | 454 | _he_update = nnlsSolve(vecZ, Ybig, _he_update, Iters); |
460 | 455 |
|
461 | | - return _he_update; |
462 | | -} |
| 456 | + return _he_update;} |
| 457 | + |
463 | 458 |
|
464 | 459 |
|
465 | 460 | arma::vec nnlsSolve(const arma::mat& vecZ, const arma::vec& Y, arma::vec nnls_update, const int& Iters){ |
|
0 commit comments