Skip to content

Commit cae5e2d

Browse files
committed
r/src/Rmoocore.c (R_read_datasets): Call read_double_data() to make the type clear.
1 parent 8153408 commit cae5e2d

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

r/src/Rmoocore.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,20 +260,19 @@ R_read_datasets(SEXP FILENAME)
260260
{
261261
SEXP_2_STRING(FILENAME, filename);
262262
/* Rprintf ("filename: %s\n", filename); */
263-
objective_t * data = NULL;
263+
double * data = NULL;
264264
int * cumsizes = NULL;
265265
int nobj = 0, nruns = 0;
266-
read_objective_t_data (filename, &data, &nobj, &cumsizes, &nruns);
266+
read_double_data(filename, &data, &nobj, &cumsizes, &nruns);
267267

268268
const int ntotal = cumsizes[nruns - 1];
269269
/* FIXME: Is this the fastest way to transfer a matrix from C to R ? */
270270
SEXP DATA = PROTECT(Rf_allocMatrix(REALSXP, ntotal, nobj + 1));
271-
double *rdata = REAL(DATA);
271+
double * rdata = REAL(DATA);
272272
matrix_transpose_double (rdata, data, ntotal, nobj);
273273

274-
int k, j;
275274
size_t pos = ntotal * nobj;
276-
for (k = 0, j = 0; k < ntotal; k++, pos++) {
275+
for (int k = 0, j = 0; k < ntotal; k++, pos++) {
277276
if (k == cumsizes[j]) j++;
278277
rdata[pos] = j + 1;
279278
}

0 commit comments

Comments
 (0)