File: modules.R

package info (click to toggle)
rcpp 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,480 kB
  • sloc: cpp: 27,436; ansic: 7,778; sh: 53; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 391 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
library(testRcppModule)

v <- new(vec)
data <- 1:10
v$assign(data)
v[[3]] <- v[[3]] + 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))

## properties (at one stage this seqfaulted, so beware)
nn <- new(RcppModuleNum)
nn$x <- pi
stopifnot(all.equal(nn$x, pi))