File: classes.R

package info (click to toggle)
rcpp 0.11.3-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 9,948 kB
  • ctags: 16,427
  • sloc: ansic: 42,692; cpp: 34,078; makefile: 32; sh: 21
file content (25 lines) | stat: -rw-r--r-- 462 bytes parent folder | download | duplicates (9)
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
library(testRcppClass)

v <- stdNumeric$new()
data <- 1:10
v$assign(data)
v$set(3L, v$at(3L) + 1)

data[[4]] <- data[[4]] +1

stopifnot(identical(all.equal(v$as.vector(), data), TRUE))

## a few function calls

stopifnot(all.equal(bar(2), 4))
stopifnot(all.equal(foo(2,3), 6))

## Uncomment this when a C++Class can be found w/o extracting from module
## as in commented code in R/load.R

## nn <- new("NumEx")
## nn$x <- pi
## stopifnot(all.equal(nn$x, pi))