Skip to content

Commit 36627f8

Browse files
committed
prepare for resubmission
1 parent 460fe74 commit 36627f8

File tree

7 files changed

+34
-24
lines changed

7 files changed

+34
-24
lines changed

cran-comments.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Ubuntu 18.04 LTS
33
R version 3.6.1
44
* Ubuntu 16.04 LTS (on travis-ci with codename: xenial)
5-
R version 3.6.0
5+
R version 3.6.1
66
* win-builder (devel and release)
77
* Local Ubuntu 18.04 with R 3.5.2 and with clang 6.0.0 with ASAN and
88
UBSAN checks
@@ -11,7 +11,11 @@
1111
## Resubmission
1212
This is a resubmission. In this version I have:
1313

14-
* Used the `FCLEN` macro in the extern declaration of `dsyr` and `FCONE`
15-
when calling `dsyr`.
16-
14+
* Used the `FCLEN` macro in the extern declaration of `dsyr` and `dchur`
15+
and `FCONE` in calls afterwards. I have fixed the error I made in the last
16+
submission by doing exactly as stated in WRE as emphasized by Tomas
17+
Kalibera on r-package-devel mailing list at the 3/9.
18+
* I cannot reproduce an error with gcc 10 which I got mail from Brian Ripley
19+
about with gcc 10.0.0 20191008, Ubuntu 16.04.6, R 3.6.1.
20+
1721
There is a note about the size on most platforms.

src/BLAS_LAPACK/R_BLAS_LAPACK.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <Rcpp.h>
22
#include "../Rconfig-wrap.h"
3-
#include <R_ext/BLAS.h>
43
#include <R_ext/Lapack.h>
54
#include "../R_BLAS_LAPACK.h"
65

@@ -26,6 +25,11 @@ namespace R_BLAS_LAPACK {
2625
int* // INFO,
2726
FCLEN FCLEN
2827
);
28+
29+
void F77_NAME(dsyr)(
30+
const char *uplo, const int *n, const double *alpha,
31+
const double *x, const int *incx,
32+
double *a, const int *lda FCLEN);
2933
}
3034

3135
void ddhazard_dchur(double *R, double *x, int n, int ldr){
@@ -207,7 +211,7 @@ namespace R_BLAS_LAPACK {
207211
double *b, const int *ldb){
208212
F77_CALL(dtrmm)(
209213
side, uplo, transa, diag, m, n, alpha, a, lda,
210-
b, ldb FCONE FCONE FCONE);
214+
b, ldb FCONE FCONE FCONE FCONE);
211215
}
212216

213217
void dtrmv(
@@ -268,4 +272,10 @@ namespace R_BLAS_LAPACK {
268272
int* ipiv, double* work, const int* lwork, int* info){
269273
F77_CALL(dgetri)(n, a, lda, ipiv, work, lwork, info);
270274
}
275+
276+
void dsyr(const char *uplo, const int *n, const double *alpha,
277+
const double *x, const int *incx,
278+
double *a, const int *lda){
279+
F77_CALL(dsyr)(uplo, n, alpha, x, incx, a, lda FCONE);
280+
}
271281
}

src/Makevars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ SOURCES_F = biglm/boundedQRf.f BLAS_LAPACK/dchur.f
77
CXX_STD = CXX11
88
OBJECTS = $(SOURCES_CPP:.cpp=.o) $(SOURCES_F:.f=.o)
99

10+
PKG_CPPFLAGS = -DUSE_FC_LEN_T
1011
# PKG_CPPFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DDDHAZ_DEBUG
1112
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
1213

src/Makevars.win

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ SOURCES_F = biglm/boundedQRf.f BLAS_LAPACK/dchur.f
77
CXX_STD = CXX11
88
OBJECTS =$(SOURCES_CPP:.cpp=.o) $(SOURCES_F:.f=.o)
99

10+
PKG_CPPFLAGS = -DUSE_FC_LEN_T
1011
PKG_CXXFLAGS = $(BLAS_LIBS) $(USE_OPEN_BLAS) $(SHLIB_OPENMP_CXXFLAGS)
1112

1213
ifeq "$(WIN)" "64"

src/PF/PF_score_n_Hess.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
#include "../thread_pool.h"
33
#include "importance_samplers.h"
44
#include "resamplers.h"
5-
#include "../Rconfig-wrap.h"
6-
7-
extern "C" {
8-
void F77_NAME(dsyr)(
9-
const char *uplo, const int *n, const double *alpha,
10-
const double *x, const int *incx,
11-
double *a, const int *lda FCLEN);
12-
}
135

146
constexpr static char C_U = 'U';
157
constexpr static int I_ONE = 1L;
@@ -220,9 +212,9 @@ derivs_output get_derivs_output
220212
if(!only_score){
221213
const double dd =
222214
dat.family->dd_log_like(dat.y[i], trunc_eta, dat.dts[i]);
223-
F77_CALL(dsyr)(
215+
R_BLAS_LAPACK::dsyr(
224216
&C_U, &dfixd, &dd, dat.X.colptr(i), &I_ONE, hess_terms.memptr(),
225-
&score_dim FCONE);
217+
&score_dim);
226218
}
227219
}
228220
}
@@ -467,9 +459,9 @@ score_n_hess_O_N_sq::score_n_hess_O_N_sq(
467459
if(!only_score){
468460
const double dd =
469461
dat.family->dd_log_like(dat.y[i], trunc_eta, dat.dts[i]);
470-
F77_CALL(dsyr)(
462+
R_BLAS_LAPACK::dsyr(
471463
&C_U, &dfixd, &dd, dat.X.colptr(i), &I_ONE, hess_terms.memptr(),
472-
&score_dim FCONE);
464+
&score_dim);
473465
}
474466
}
475467
}
@@ -531,9 +523,9 @@ score_n_hess_O_N_sq::score_n_hess_O_N_sq(
531523

532524
/* add outer product of score terms from this pair */
533525
score_terms(obs_span) += obs_score_term;
534-
F77_CALL(dsyr)(
526+
R_BLAS_LAPACK::dsyr(
535527
&C_U, &score_dim, &w_i, score_terms.memptr(), &I_ONE,
536-
hess_terms.memptr(), &score_dim FCONE);
528+
hess_terms.memptr(), &score_dim);
537529

538530
if(!is_first_it)
539531
hess_terms += w_i * old_res->get_hess_terms();
@@ -543,9 +535,9 @@ score_n_hess_O_N_sq::score_n_hess_O_N_sq(
543535

544536
if(!only_score){
545537
/* subtract outer product of score */
546-
F77_CALL(dsyr)(
538+
R_BLAS_LAPACK::dsyr(
547539
&C_U, &score_dim, &D_NEG_ONE, score.memptr(), &I_ONE, hess_terms.memptr(),
548-
&score_dim FCONE);
540+
&score_dim);
549541

550542
/* not needed as we later copy the upper part to the lower part */
551543
// hess_terms = arma::symmatu(hess_terms);

src/R_BLAS_LAPACK.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,7 @@ namespace R_BLAS_LAPACK {
6565

6666
void dgetri(const int*, double*, const int*,
6767
int*, double*, const int*, int*);
68+
69+
void dsyr(const char*, const int*, const double*, const double*,
70+
const int*,double*, const int*);
6871
}

src/Rconfig-wrap.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#ifndef RCONFIG_WRAP_H
22
#define RCONFIG_WRAP_H
3-
#define USE_FC_LEN_T
43
#include <Rconfig.h>
5-
4+
#include <R_ext/BLAS.h>
65
#ifndef FCLEN
76
#define FCLEN
87
#endif

0 commit comments

Comments
 (0)