paulnorthrop / rust

Compare a980ca9 ... +3 ... 51795c7

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -162,6 +162,14 @@
Loading
162 162
  return val ;
163 163
}
164 164
165 +
// Transformation function 1
166 +
167 +
// [[Rcpp::export]]
168 +
arma::vec trans1(const arma::vec& rho, const arma::vec& psi_mode,
169 +
                 const arma::mat& rot_mat) {
170 +
  return cpp_rho_to_psi(rho, psi_mode, rot_mat) ;
171 +
}
172 +
165 173
// Case 2: Box-Cox, rotation and relocation.
166 174
167 175
// [[Rcpp::export]]
@@ -207,6 +215,28 @@
Loading
207 215
  return val ;
208 216
}
209 217
218 +
// Transformation function 2
219 +
220 +
// [[Rcpp::export]]
221 +
arma::vec trans2(const arma::vec& rho, const arma::vec& psi_mode,
222 +
                 const arma::mat& rot_mat, const Rcpp::List& tpars,
223 +
                 const SEXP& ptpfun) {
224 +
  Rcpp::NumericVector phi, psi ;
225 +
  psi = cpp_rho_to_psi(rho, psi_mode, rot_mat) ;
226 +
  // Unwrap pointer to psi_to_phi transformation function.
227 +
  typedef Rcpp::NumericVector (*ptpPtr)(const Rcpp::NumericVector& psi,
228 +
                               const Rcpp::NumericVector& lambda,
229 +
                               const Rcpp::NumericVector& gm,
230 +
                               const Rcpp::NumericVector& con) ;
231 +
  Rcpp::NumericVector lambda = tpars["lambda"] ;
232 +
  Rcpp::NumericVector gm = tpars["gm"] ;
233 +
  Rcpp::NumericVector con = tpars["con"] ;
234 +
  Rcpp::XPtr<ptpPtr> xptpfun(ptpfun) ;
235 +
  ptpPtr psi_to_phi_fun = *xptpfun ;
236 +
  phi = psi_to_phi_fun(psi, lambda, gm, con) ;
237 +
  return phi ;
238 +
}
239 +
210 240
// Case 3: Transformation to positivity, Box-Cox, rotation and relocation.
211 241
212 242
// [[Rcpp::export]]
@@ -252,6 +282,9 @@
Loading
252 282
  }
253 283
  phi = psi_to_phi_fun(psi, lambda, gm, con) ;
254 284
  theta = phi_to_theta_fun(phi, user_args) ;
285 +
  if (any_infinite(theta)) {
286 +
    return R_NegInf ;
287 +
  }
255 288
  if (any_naC(theta)) {
256 289
    return R_NegInf ;
257 290
  }
@@ -264,6 +297,33 @@
Loading
264 297
  return val ;
265 298
}
266 299
300 +
// [[Rcpp::export]]
301 +
arma::vec trans3(const arma::vec& rho, const arma::vec& psi_mode,
302 +
                 const arma::mat& rot_mat, const Rcpp::List& tpars,
303 +
                 const SEXP& ptpfun, const SEXP& phi_to_theta,
304 +
                 const Rcpp::List& user_args) {
305 +
  Rcpp::NumericVector theta, phi, psi ;
306 +
  psi = cpp_rho_to_psi(rho, psi_mode, rot_mat) ;
307 +
  // Unwrap pointer to psi_to_phi transformation function.
308 +
  typedef Rcpp::NumericVector (*ptpPtr)(const Rcpp::NumericVector& psi,
309 +
                               const Rcpp::NumericVector& lambda,
310 +
                               const Rcpp::NumericVector& gm,
311 +
                               const Rcpp::NumericVector& con) ;
312 +
  Rcpp::NumericVector lambda = tpars["lambda"] ;
313 +
  Rcpp::NumericVector gm = tpars["gm"] ;
314 +
  Rcpp::NumericVector con = tpars["con"] ;
315 +
  Rcpp::XPtr<ptpPtr> xptpfun(ptpfun) ;
316 +
  ptpPtr psi_to_phi_fun = *xptpfun ;
317 +
  phi = psi_to_phi_fun(psi, lambda, gm, con) ;
318 +
  // Unwrap pointer to phi_to_theta transformation function.
319 +
  typedef Rcpp::NumericVector (*pttPtr)(const Rcpp::NumericVector& phi,
320 +
                               const Rcpp::List& user_args) ;
321 +
  Rcpp::XPtr<pttPtr> xpttfun(phi_to_theta) ;
322 +
  pttPtr phi_to_theta_fun = *xpttfun ;
323 +
  theta = phi_to_theta_fun(phi, user_args) ;
324 +
  return theta ;
325 +
}
326 +
267 327
// Case 4: User-supplied transformation, rotation and relocation.
268 328
269 329
// [[Rcpp::export]]
@@ -303,6 +363,21 @@
Loading
303 363
  return val ;
304 364
}
305 365
366 +
// [[Rcpp::export]]
367 +
arma::vec trans4(const arma::vec& rho, const arma::vec& psi_mode,
368 +
                 const arma::mat& rot_mat, const SEXP& ptpfun,
369 +
                 const SEXP& phi_to_theta, const Rcpp::List& user_args) {
370 +
  Rcpp::NumericVector theta, phi, psi ;
371 +
  phi = cpp_rho_to_psi(rho, psi_mode, rot_mat) ;
372 +
  // Unwrap pointer to phi_to_theta transformation function.
373 +
  typedef Rcpp::NumericVector (*pttPtr)(const Rcpp::NumericVector& phi,
374 +
                               const Rcpp::List& user_args) ;
375 +
  Rcpp::XPtr<pttPtr> xpttfun(phi_to_theta) ;
376 +
  pttPtr phi_to_theta_fun = *xpttfun ;
377 +
  theta = phi_to_theta_fun(phi, user_args) ;
378 +
  return theta ;
379 +
}
380 +
306 381
// Function to vectorize cpp_logf_rho_4() for use in find_lambda_rcpp()
307 382
// and find_lambda_one_d_rcpp().
308 383

@@ -361,6 +361,27 @@
Loading
361 361
        return Rcpp::as<double >(rcpp_result_gen);
362 362
    }
363 363
364 +
    inline arma::vec trans1(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat) {
365 +
        typedef SEXP(*Ptr_trans1)(SEXP,SEXP,SEXP);
366 +
        static Ptr_trans1 p_trans1 = NULL;
367 +
        if (p_trans1 == NULL) {
368 +
            validateSignature("arma::vec(*trans1)(const arma::vec&,const arma::vec&,const arma::mat&)");
369 +
            p_trans1 = (Ptr_trans1)R_GetCCallable("rust", "_rust_trans1");
370 +
        }
371 +
        RObject rcpp_result_gen;
372 +
        {
373 +
            RNGScope RCPP_rngScope_gen;
374 +
            rcpp_result_gen = p_trans1(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)));
375 +
        }
376 +
        if (rcpp_result_gen.inherits("interrupted-error"))
377 +
            throw Rcpp::internal::InterruptedException();
378 +
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
379 +
            throw Rcpp::LongjumpException(rcpp_result_gen);
380 +
        if (rcpp_result_gen.inherits("try-error"))
381 +
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
382 +
        return Rcpp::as<arma::vec >(rcpp_result_gen);
383 +
    }
384 +
364 385
    inline double cpp_logf_rho_2(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const Rcpp::List& pars, const Rcpp::List& tpars, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
365 386
        typedef SEXP(*Ptr_cpp_logf_rho_2)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
366 387
        static Ptr_cpp_logf_rho_2 p_cpp_logf_rho_2 = NULL;
@@ -382,6 +403,27 @@
Loading
382 403
        return Rcpp::as<double >(rcpp_result_gen);
383 404
    }
384 405
406 +
    inline arma::vec trans2(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat, const Rcpp::List& tpars, const SEXP& ptpfun) {
407 +
        typedef SEXP(*Ptr_trans2)(SEXP,SEXP,SEXP,SEXP,SEXP);
408 +
        static Ptr_trans2 p_trans2 = NULL;
409 +
        if (p_trans2 == NULL) {
410 +
            validateSignature("arma::vec(*trans2)(const arma::vec&,const arma::vec&,const arma::mat&,const Rcpp::List&,const SEXP&)");
411 +
            p_trans2 = (Ptr_trans2)R_GetCCallable("rust", "_rust_trans2");
412 +
        }
413 +
        RObject rcpp_result_gen;
414 +
        {
415 +
            RNGScope RCPP_rngScope_gen;
416 +
            rcpp_result_gen = p_trans2(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(ptpfun)));
417 +
        }
418 +
        if (rcpp_result_gen.inherits("interrupted-error"))
419 +
            throw Rcpp::internal::InterruptedException();
420 +
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
421 +
            throw Rcpp::LongjumpException(rcpp_result_gen);
422 +
        if (rcpp_result_gen.inherits("try-error"))
423 +
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
424 +
        return Rcpp::as<arma::vec >(rcpp_result_gen);
425 +
    }
426 +
385 427
    inline double cpp_logf_rho_3(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const Rcpp::List& pars, const Rcpp::List& tpars, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
386 428
        typedef SEXP(*Ptr_cpp_logf_rho_3)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
387 429
        static Ptr_cpp_logf_rho_3 p_cpp_logf_rho_3 = NULL;
@@ -403,6 +445,27 @@
Loading
403 445
        return Rcpp::as<double >(rcpp_result_gen);
404 446
    }
405 447
448 +
    inline arma::vec trans3(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat, const Rcpp::List& tpars, const SEXP& ptpfun, const SEXP& phi_to_theta, const Rcpp::List& user_args) {
449 +
        typedef SEXP(*Ptr_trans3)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
450 +
        static Ptr_trans3 p_trans3 = NULL;
451 +
        if (p_trans3 == NULL) {
452 +
            validateSignature("arma::vec(*trans3)(const arma::vec&,const arma::vec&,const arma::mat&,const Rcpp::List&,const SEXP&,const SEXP&,const Rcpp::List&)");
453 +
            p_trans3 = (Ptr_trans3)R_GetCCallable("rust", "_rust_trans3");
454 +
        }
455 +
        RObject rcpp_result_gen;
456 +
        {
457 +
            RNGScope RCPP_rngScope_gen;
458 +
            rcpp_result_gen = p_trans3(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(user_args)));
459 +
        }
460 +
        if (rcpp_result_gen.inherits("interrupted-error"))
461 +
            throw Rcpp::internal::InterruptedException();
462 +
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
463 +
            throw Rcpp::LongjumpException(rcpp_result_gen);
464 +
        if (rcpp_result_gen.inherits("try-error"))
465 +
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
466 +
        return Rcpp::as<arma::vec >(rcpp_result_gen);
467 +
    }
468 +
406 469
    inline double cpp_logf_rho_4(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const Rcpp::List& pars, const Rcpp::List& tpars, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
407 470
        typedef SEXP(*Ptr_cpp_logf_rho_4)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
408 471
        static Ptr_cpp_logf_rho_4 p_cpp_logf_rho_4 = NULL;
@@ -424,6 +487,27 @@
Loading
424 487
        return Rcpp::as<double >(rcpp_result_gen);
425 488
    }
426 489
490 +
    inline arma::vec trans4(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat, const SEXP& ptpfun, const SEXP& phi_to_theta, const Rcpp::List& user_args) {
491 +
        typedef SEXP(*Ptr_trans4)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
492 +
        static Ptr_trans4 p_trans4 = NULL;
493 +
        if (p_trans4 == NULL) {
494 +
            validateSignature("arma::vec(*trans4)(const arma::vec&,const arma::vec&,const arma::mat&,const SEXP&,const SEXP&,const Rcpp::List&)");
495 +
            p_trans4 = (Ptr_trans4)R_GetCCallable("rust", "_rust_trans4");
496 +
        }
497 +
        RObject rcpp_result_gen;
498 +
        {
499 +
            RNGScope RCPP_rngScope_gen;
500 +
            rcpp_result_gen = p_trans4(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(user_args)));
501 +
        }
502 +
        if (rcpp_result_gen.inherits("interrupted-error"))
503 +
            throw Rcpp::internal::InterruptedException();
504 +
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
505 +
            throw Rcpp::LongjumpException(rcpp_result_gen);
506 +
        if (rcpp_result_gen.inherits("try-error"))
507 +
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
508 +
        return Rcpp::as<arma::vec >(rcpp_result_gen);
509 +
    }
510 +
427 511
    inline Rcpp::NumericVector rcpp_apply(const Rcpp::NumericMatrix& x, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const Rcpp::List& pars, const Rcpp::List& tpars, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
428 512
        typedef SEXP(*Ptr_rcpp_apply)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
429 513
        static Ptr_rcpp_apply p_rcpp_apply = NULL;

@@ -3,14 +3,15 @@
Loading
3 3
#include <stdlib.h> // for NULL
4 4
#include <R_ext/Rdynload.h>
5 5
6 -
/* FIXME: 
6 +
/* FIXME:
7 7
   Check these declarations against the C/Fortran source code.
8 8
*/
9 9
10 10
/* .Call calls */
11 11
extern SEXP _rust_all_pos(SEXP);
12 12
extern SEXP _rust_any_col_nonneg(SEXP);
13 13
extern SEXP _rust_any_col_nonpos(SEXP);
14 +
extern SEXP _rust_any_infinite(SEXP);
14 15
extern SEXP _rust_any_naC(SEXP);
15 16
extern SEXP _rust_any_neg(SEXP);
16 17
extern SEXP _rust_any_nonpos(SEXP);
@@ -62,13 +63,18 @@
Loading
62 63
extern SEXP _rust_ru_cpp_2(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
63 64
extern SEXP _rust_ru_cpp_3(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
64 65
extern SEXP _rust_ru_cpp_4(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
66 +
extern SEXP _rust_trans1(SEXP, SEXP, SEXP);
67 +
extern SEXP _rust_trans2(SEXP, SEXP, SEXP, SEXP, SEXP);
68 +
extern SEXP _rust_trans3(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
69 +
extern SEXP _rust_trans4(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
65 70
extern SEXP _rust_vecpow(SEXP, SEXP);
66 71
extern SEXP _rust_vecpower(SEXP, SEXP);
67 72
68 73
static const R_CallMethodDef CallEntries[] = {
69 74
    {"_rust_all_pos",                      (DL_FUNC) &_rust_all_pos,                       1},
70 75
    {"_rust_any_col_nonneg",               (DL_FUNC) &_rust_any_col_nonneg,                1},
71 76
    {"_rust_any_col_nonpos",               (DL_FUNC) &_rust_any_col_nonpos,                1},
77 +
    {"_rust_any_infinite",                 (DL_FUNC) &_rust_any_infinite,                       1},
72 78
    {"_rust_any_naC",                      (DL_FUNC) &_rust_any_naC,                       1},
73 79
    {"_rust_any_neg",                      (DL_FUNC) &_rust_any_neg,                       1},
74 80
    {"_rust_any_nonpos",                   (DL_FUNC) &_rust_any_nonpos,                    1},
@@ -120,6 +126,10 @@
Loading
120 126
    {"_rust_ru_cpp_2",                     (DL_FUNC) &_rust_ru_cpp_2,                     16},
121 127
    {"_rust_ru_cpp_3",                     (DL_FUNC) &_rust_ru_cpp_3,                     16},
122 128
    {"_rust_ru_cpp_4",                     (DL_FUNC) &_rust_ru_cpp_4,                     16},
129 +
    {"_rust_trans1",                       (DL_FUNC) &_rust_trans1,                        3},
130 +
    {"_rust_trans2",                       (DL_FUNC) &_rust_trans2,                        5},
131 +
    {"_rust_trans3",                       (DL_FUNC) &_rust_trans3,                        7},
132 +
    {"_rust_trans4",                       (DL_FUNC) &_rust_trans4,                        6},
123 133
    {"_rust_vecpow",                       (DL_FUNC) &_rust_vecpow,                        2},
124 134
    {"_rust_vecpower",                     (DL_FUNC) &_rust_vecpower,                      2},
125 135
    {NULL, NULL, 0}

@@ -228,7 +228,7 @@
Loading
228 228
229 229
// [[Rcpp::export]]
230 230
Rcpp::NumericVector exptrans(const Rcpp::NumericVector& phi,
231 -
                                const Rcpp::List& user_args) {
231 +
                             const Rcpp::List& user_args) {
232 232
  return exp(phi);
233 233
}
234 234

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R 62.90%
src -5.17% 77.20%
inst/include/rust_RcppExports.h 0.00%
Project Totals (12 files) 66.55%
Loading