|
1 | 1 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand |
2 | 2 | # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 |
3 | 3 |
|
4 | | -#' Fast and simple linear model |
5 | | -#' @details Single precision floats are used by default since not all devices support double precision. |
6 | | -#' @param X a model matrix |
7 | | -#' @param y a vector containing the explained variable |
8 | | -#' @param useDouble use float or double internally |
9 | | -#' @return \code{fastLmPure} returns a list with three components: |
10 | | -#' \describe{ |
11 | | -#' \item{\code{coefficients}}{a vector of coefficients} |
12 | | -#' \item{\code{residuals}}{the residuals, that is response minus fitted values} |
13 | | -#' \item{\code{fitted.values}}{the fitted mean values} |
14 | | -#' \item{\code{stderr}}{a vector of the (estimated) standard errors of the coefficient estimates} |
15 | | -#' \item{\code{df.residual}}{a scalar denoting the degrees of freedom in the model} |
16 | | -#' \item{\code{intercept}}{a boolean denoting if a model with intercept was fitted} |
17 | | -#' } |
18 | | -#' @export |
19 | | -fastLmPure <- function(X, y, useDouble = FALSE) { |
20 | | - .Call(`_RcppArrayFire_fastLmPure`, X, y, useDouble) |
21 | | -} |
22 | | - |
23 | | -#' Fast runif alternative |
24 | | -#' @details Fast generation of uniformly distributed random values. The default is to use single precision, |
25 | | -#' since not all devices support calculations using double precision. |
26 | | -#' @param n number of observations |
27 | | -#' @param min lower limit of the distribution |
28 | | -#' @param max upper limit of the distribution |
29 | | -#' @param useDouble use float or double internally |
30 | | -#' @return A numeric vector of random values |
31 | | -#' @seealso \code{\link{runif}} and \url{http://arrayfire.org/docs/group__random__func__randu.htm} |
32 | | -#' @export |
33 | | -fastRunif <- function(n, min = 0, max = 1, useDouble = FALSE) { |
34 | | - .Call(`_RcppArrayFire_fastRunif`, n, min, max, useDouble) |
35 | | -} |
36 | | - |
37 | | -#' Fast rnorm alternative |
38 | | -#' @details Fast generation of normaly distributed random values. The default is to use single precision, |
39 | | -#' since not all devices support calculations using double precision. |
40 | | -#' @param n number of observations |
41 | | -#' @param mean mean value of the distribution |
42 | | -#' @param sd standard deviation of the distribution |
43 | | -#' @param useDouble use float or double internally |
44 | | -#' @return A numeric vector of random values |
45 | | -#' @seealso \code{\link{rnorm}} and \url{http://arrayfire.org/docs/group__random__func__randn.htm} |
46 | | -#' @export |
47 | | -fastRnorm <- function(n, mean = 0, sd = 1, useDouble = FALSE) { |
48 | | - .Call(`_RcppArrayFire_fastRnorm`, n, mean, sd, useDouble) |
49 | | -} |
50 | | - |
51 | 4 | #' Report the information about current device and platform |
52 | 5 | #' @details Return a list containing the information about current device and platform. |
53 | 6 | #' The list object includes device name, palatform information, toolkit information, |
@@ -142,3 +95,50 @@ arrayfire_set_backend <- function(backend = "DEFAULT") { |
142 | 95 | invisible(.Call(`_RcppArrayFire_arrayfire_set_backend`, backend)) |
143 | 96 | } |
144 | 97 |
|
| 98 | +#' Fast and simple linear model |
| 99 | +#' @details Single precision floats are used by default since not all devices support double precision. |
| 100 | +#' @param X a model matrix |
| 101 | +#' @param y a vector containing the explained variable |
| 102 | +#' @param useDouble use float or double internally |
| 103 | +#' @return \code{fastLmPure} returns a list with three components: |
| 104 | +#' \describe{ |
| 105 | +#' \item{\code{coefficients}}{a vector of coefficients} |
| 106 | +#' \item{\code{residuals}}{the residuals, that is response minus fitted values} |
| 107 | +#' \item{\code{fitted.values}}{the fitted mean values} |
| 108 | +#' \item{\code{stderr}}{a vector of the (estimated) standard errors of the coefficient estimates} |
| 109 | +#' \item{\code{df.residual}}{a scalar denoting the degrees of freedom in the model} |
| 110 | +#' \item{\code{intercept}}{a boolean denoting if a model with intercept was fitted} |
| 111 | +#' } |
| 112 | +#' @export |
| 113 | +fastLmPure <- function(X, y, useDouble = FALSE) { |
| 114 | + .Call(`_RcppArrayFire_fastLmPure`, X, y, useDouble) |
| 115 | +} |
| 116 | + |
| 117 | +#' Fast runif alternative |
| 118 | +#' @details Fast generation of uniformly distributed random values. The default is to use single precision, |
| 119 | +#' since not all devices support calculations using double precision. |
| 120 | +#' @param n number of observations |
| 121 | +#' @param min lower limit of the distribution |
| 122 | +#' @param max upper limit of the distribution |
| 123 | +#' @param useDouble use float or double internally |
| 124 | +#' @return A numeric vector of random values |
| 125 | +#' @seealso \code{\link{runif}} and \url{http://arrayfire.org/docs/group__random__func__randu.htm} |
| 126 | +#' @export |
| 127 | +fastRunif <- function(n, min = 0, max = 1, useDouble = FALSE) { |
| 128 | + .Call(`_RcppArrayFire_fastRunif`, n, min, max, useDouble) |
| 129 | +} |
| 130 | + |
| 131 | +#' Fast rnorm alternative |
| 132 | +#' @details Fast generation of normaly distributed random values. The default is to use single precision, |
| 133 | +#' since not all devices support calculations using double precision. |
| 134 | +#' @param n number of observations |
| 135 | +#' @param mean mean value of the distribution |
| 136 | +#' @param sd standard deviation of the distribution |
| 137 | +#' @param useDouble use float or double internally |
| 138 | +#' @return A numeric vector of random values |
| 139 | +#' @seealso \code{\link{rnorm}} and \url{http://arrayfire.org/docs/group__random__func__randn.htm} |
| 140 | +#' @export |
| 141 | +fastRnorm <- function(n, mean = 0, sd = 1, useDouble = FALSE) { |
| 142 | + .Call(`_RcppArrayFire_fastRnorm`, n, mean, sd, useDouble) |
| 143 | +} |
| 144 | + |
0 commit comments