Skip to content

Commit

Permalink
fix issue with vignettes that are not included
Browse files Browse the repository at this point in the history
try to solve issue with Solaris on the CRAN checks results.
  • Loading branch information
boennecd committed Jan 11, 2019
1 parent a58f91d commit e8cdb88
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 19 deletions.
7 changes: 2 additions & 5 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
^CRAN-RELEASE$
^.*\.Rproj$
^\.Rproj\.user$
\.log$
Expand All @@ -12,14 +13,11 @@ dynamichazard\.dll$
^\.travis\.yml$
release_questions\.R$
cran-comments\.md$

src/pf/est_params_generic.cpp

^README
^README_cache
^examples

^vignettes/[^/]*\.(?!(Rnw|bib|pdf\.asis|pdf|Rmd|csl)).*$
^vignettes/[^\./]*\.(?!(Rnw|bib|pdf\.asis|pdf|Rmd|csl))
vignettes/ddhazard\.pdf
vignettes/fig
vignettes/tex2pdf
Expand All @@ -28,7 +26,6 @@ vignettes/Diagnostics/data_prep\.R
vignettes/Diagnostics/Rossi_ex\.html
vignettes/Diagnostics/Rossi_source\.url
vignettes/Diagnostics/Rossi\.txt

^\.sandbox
^speedtest
tests/testthat/previous_results/local_tests
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: dynamichazard
Type: Package
Title: Dynamic Hazard Models using State Space Models
Version: 0.6.2
Version: 0.6.3
Authors@R: c(person("Benjamin", "Christoffersen",
email = "[email protected]",
role = c("cre", "aut")),
Expand Down
7 changes: 7 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ I still get this error with the UBSAN check: https://github.com/RcppCore/Rcpp/is

Though, it does not seem to trigger on CRAN and Dirk Eddelbuettel and Kevin
Ushey indicate that it may not be a problem.

## Resubmission
This is a resubmission. In this version I have:

* Added vignettes which are currently not included due to an error in
`.Rbuildignore`.
* Tried to fix the error on Solaris in the CRAN check results.
25 changes: 15 additions & 10 deletions src/BLAS_LAPACK/R_BLAS_LAPACK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ namespace R_BLAS_LAPACK {
void square_tri_inv(double *out, int n, int ldr){
int info;

F77_CALL(dtrtri)("L", "N", &n, out, &ldr, &info);
char c1 = 'L', c2 = 'N';
F77_CALL(dtrtri)(&c1, &c2, &n, out, &ldr, &info);

if(info != 0){
std::stringstream str;
Expand All @@ -75,7 +76,8 @@ namespace R_BLAS_LAPACK {
void symmetric_mat_chol(double *out, int n, int lda){
int info;

F77_CALL(dpotrf)("L", &n, out, &lda, &info);
char c1 = 'L';
F77_CALL(dpotrf)(&c1, &n, out, &lda, &info);

if(info != 0){
std::stringstream str;
Expand All @@ -92,7 +94,9 @@ namespace R_BLAS_LAPACK {
// ( 1 + ( n - 1 )*abs( INCX ) ).

int incx = 1;
F77_CALL(dtrmv)("L", is_transpose ? "T" : "N", "N", &n, A, &lda, x, &incx);
char c1 = 'L', c2 = is_transpose ? 'T' : 'N', c3 = 'N';
F77_CALL(dtrmv)(
&c1, &c2, &c3, &n, A, &lda, x, &incx);
}

void sym_mat_rank_one_update(
Expand All @@ -104,13 +108,14 @@ namespace R_BLAS_LAPACK {
// See http://www.netlib.org/lapack/explore-html/d7/d15/group__double__blas__level2_ga35ca25bb135cd7bfdd5d6190b1aa4d07.html#ga35ca25bb135cd7bfdd5d6190b1aa4d07

int inx = 1;
char c1 = 'U';

//F77_CALL(dger)(const int *m, const int *n, const double *alpha,
// const double *x, const int *incx,
// const double *y, const int *incy,
// double *a, const int *lda);
F77_CALL(dsyr)(
"U", n, alpha,
&c1, n, alpha,
x, &inx,
A, n);
}
Expand All @@ -132,9 +137,10 @@ namespace R_BLAS_LAPACK {

const double dum_d = 1.0;
const int dum_i = 1L;
char c1 = 'U';

F77_CALL(dsymv)(
"U", n,
&c1, n,
&dum_d, A, n,
x, &dum_i, &dum_d,
y, &dum_i);
Expand All @@ -160,9 +166,10 @@ namespace R_BLAS_LAPACK {
// Notice that we set UPLO to U so only the upper part is updated

const double dum_d = 1.0;
char c1 = 'U', c2 = 'N';

F77_CALL(dsyrk)(
"U", "N",
&c1, &c2,
n, k, &dum_d,
A, n,
&dum_d, C, n);
Expand All @@ -181,12 +188,10 @@ namespace R_BLAS_LAPACK {
*/

int info;
char uplo[2] = { is_upper ? 'U' : 'L' }, tra[2] = { trans ? 'T' : 'N' };
char c1 = is_upper ? 'U' : 'L', c2 = trans ? 'T' : 'N', c3 = 'N';

F77_CALL(dtrtrs)(
uplo,
tra,
"N",
&c1, &c2, &c3,
&n, &nrhs,
A, &n,
B, &n,
Expand Down
6 changes: 4 additions & 2 deletions src/PF/dmvnrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ double dmvnrm_log(

// z = sigma_chol_inv.t() * z;
int incx = 1;
char uplo = 'U', trans = 'T', diag = 'N';
R_BLAS_LAPACK::dtrmv(
"U" /* UPLO */, "T" /* TRANS */, "N" /* diag */,
&uplo, &trans, &diag,
&xdim /* N */, sigma_chol_inv.memptr() /* A */,
&xdim /* LDA */, z.memptr() /* X */, &incx /* INCX */);

Expand All @@ -36,8 +37,9 @@ double dmvtrm_log(

/* z = sigma_chol_inv.t() * z; */
int incx = 1;
char uplo = 'U', trans = 'T', diag = 'N';
R_BLAS_LAPACK::dtrmv(
"U" /* UPLO */, "T" /* TRANS */, "N" /* diag */,
&uplo, &trans, &diag,
&xdim /* N */, sigma_chol_inv.memptr() /* A */,
&xdim /* LDA */, z.memptr() /* X */, &incx /* INCX */);

Expand Down
3 changes: 2 additions & 1 deletion src/sample_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ arma::mat mvrnorm(const int m, const arma::mat &sigma_chol){

// Y <-- Y * chol(Sigma)
const double alpha = 1.;
char side = 'R', uplo = 'U', transa = 'N', diag = 'N';
R_BLAS_LAPACK::dtrmm(
"R" /* side */, "U" /* UPLO */, "N" /* TRANSA */, "N" /* DIAG */,
&side, &uplo, &transa, &diag,
&m /* M */, &n /* N */, &alpha /* ALPHA */,
sigma_chol.memptr() /* A */, &n /* LDA */,
Y.memptr() /* B */, &m /* LDB */);
Expand Down

0 comments on commit e8cdb88

Please sign in to comment.