File: single_sample.h

package info (click to toggle)
r-cran-spacefillr 0.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,472 kB
  • sloc: ansic: 32,867; cpp: 5,657; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 636 bytes parent folder | download
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