Skip to content

Commit 1d60dfa

Browse files
update to C-software, using a compiler define for column major
1 parent 177ab78 commit 1d60dfa

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

selectiveInference/src/Makevars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PKG_CFLAGS= -I.
2-
PKG_CPPFLAGS= -I.
1+
PKG_CFLAGS= -I. -DCOLUMN_MAJOR_ORDER
2+
PKG_CPPFLAGS= -I. -DCOLUMN_MAJOR_ORDER
33
PKG_LIBS=-L.
44

55
$(SHLIB): Rcpp Rcpp-matrixcomps.o Rcpp-debias.o RcppExports.o quadratic_program.o quadratic_program_wide.o

selectiveInference/src/Rcpp-debias.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ Rcpp::List solve_QP_wide(Rcpp::NumericMatrix X,
101101
int param_stop
102102
) {
103103

104-
int column_major = 1; // R has matrices in column major order
105104
int ncase = X.nrow(); // number of cases
106105
int nfeature = X.ncol(); // number of features
107106

@@ -140,7 +139,6 @@ Rcpp::List solve_QP_wide(Rcpp::NumericMatrix X,
140139
(int *) nactive.begin(),
141140
ncase,
142141
nfeature,
143-
column_major,
144142
(double *) bound.begin(),
145143
ridge_term,
146144
(double *) theta.begin(),
@@ -164,7 +162,6 @@ Rcpp::List solve_QP_wide(Rcpp::NumericMatrix X,
164162
(int *) need_update.begin(),
165163
nfeature,
166164
ncase,
167-
column_major,
168165
(double *) bound.begin(),
169166
ridge_term,
170167
kkt_tol);
@@ -179,8 +176,7 @@ Rcpp::List solve_QP_wide(Rcpp::NumericMatrix X,
179176
(double *) linear_func.begin(),
180177
(int *) need_update.begin(),
181178
nfeature,
182-
ncase,
183-
column_major);
179+
ncase);
184180

185181
return(Rcpp::List::create(Rcpp::Named("soln") = theta,
186182
Rcpp::Named("gradient") = gradient,

0 commit comments

Comments
 (0)