1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#ifndef SINGLESAMPLEH
#define SINGLESAMPLEH
#include "Rcpp.h"
#include "sobol.h"
namespace spacefillr {
static inline std::vector<float> sobol_fast_calc_std(uint64_t i, unsigned int dim, unsigned int scramble) {
std::vector<float> vals(dim);
for(unsigned int j = 0; j < dim; j++) {
vals[j] = spacefillr::sobol_owen_single(i, j, scramble);
}
return(vals);
}
static inline Rcpp::List sobol_fast_calc_list(uint64_t i, unsigned int dim, unsigned int scramble) {
Rcpp::List vals(dim);
for(unsigned int j = 0; j < dim; j++) {
vals[j] = spacefillr::sobol_owen_single(i, j, scramble);
}
return(vals);
}
}
#endif
|