File: local.scan.R

package info (click to toggle)
r-cran-igraph 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,044 kB
  • sloc: ansic: 204,981; cpp: 21,711; fortran: 4,090; yacc: 1,229; lex: 519; sh: 52; makefile: 8
file content (57 lines) | stat: -rw-r--r-- 1,938 bytes parent folder | download | duplicates (6)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

time_group("local scan v1")

init   <- expression({library(igraph); set.seed(42) })
reinit <- expression({g  <- random.graph.game(1000, p=.1)
                      E(g)$weight <- sample(ecount(g))
                      gp <- random.graph.game(1000, p=.1)
                      E(gp)$weight <- sample(ecount(gp))
                    })

time_that("us, scan-0, unweighted",
          replications=10, init=init, reinit=reinit,
          { local_scan(g, k=0) })

time_that("us, scan-0, weighted",
          replications=10, init=init, reinit=reinit,
          { local_scan(g, k=0, weighted=TRUE) })

time_that("us, scan-1, unweighted",
          replications=10, init=init, reinit=reinit,
          { local_scan(g, k=1) })

time_that("us, scan-1, weighted",
          replications=10, init=init, reinit=reinit,
          { local_scan(g, k=1, weighted=TRUE) })

time_that("us, scan-2, unweighted",
          replications=10, init=init, reinit=reinit,
          { local_scan(g, k=2) })

time_that("us, scan-2, weighted",
          replications=10, init=init, reinit=reinit,
          { local_scan(g, k=2, weighted=TRUE) })

time_that("them, scan-0, unweighted",
          replications=10, init=init, reinit=reinit,
          { local_scan(g, gp, k=0) })

time_that("them, scan-0, weighted",
          replications=10, init=init, reinit=reinit,
          { local_scan(g, gp, k=0, weighted=TRUE) })

time_that("them, scan-1, unweighted",
          replications=10, init=init, reinit=reinit,
          { local_scan(g, gp, k=1)} )

time_that("them, scan-1, weighted",
          replications=10, init=init, reinit=reinit,
          { local_scan(g, gp, k=1, weighted=TRUE) })

time_that("them, scan-2, unweighted",
          replications=10, init=init, reinit=reinit,
          { local_scan(g, gp, k=2) })

time_that("them, scan-2, weigthed",
          replications=10, init=init, reinit=reinit,
          { local_scan(g, gp, k=2, weighted=TRUE) })