-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
76 lines (76 loc) · 2.73 KB
/
.Rhistory
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
library(Rnanoflann)
library(Rnanoflann)
Rcpp::compileAttributes
Rcpp::compileAttributes()
Rcpp::compileAttributes()
library(Rnanoflann)
Rcpp::compileAttributes()
Rcpp::compileAttributes()
library(Rnanoflann)
Rcpp::sourceCpp("src/knn.cpp")
Rcpp::sourceCpp("src/knn.cpp")
Rcpp::sourceCpp("src/knn.cpp")
Rcpp::sourceCpp("src/knn.cpp")
Rcpp::sourceCpp("src/knn.cpp")
Rcpp::sourceCpp("src/knn.cpp")
Rcpp::sourceCpp("src/knn.cpp")
Rcpp::sourceCpp("src/knn.cpp")
Rcpp::sourceCpp("src/knn.cpp")
x=Rfast::matrnorm(1000,1000)
points=Rfast::matrnorm(1000,1000)
Rfast2::benchmark(knn(x,points,k=5),RANN::nn2(x,points,k=5),times = 5)
Rfast2::benchmark(knn(t(x),t(points),k=5),RANN::nn2(x,points,k=5),times = 5)
Rfast2::benchmark(Rnanoflan = a<-knn(t(x),t(points),k=5),RANN = b<-RANN::nn2(x,points,k=5),times = 5)
all.equal(t(a$indices)+1,b$nn.idx)
Rfast2::benchmark(Rnanoflan = a<-knn(t(x),t(points),method = "radius",radius=0.2,k=5),RANN = b<-RANN::nn2(x,points,searchtype = "radius",radius=0.2,k=5),times = 5)
all.equal(t(a$indices)+1,b$nn.idx)
dim(a$indices)
dim(b$nn.idx)
a$indices[,1]
a
b
x
Rfast2::benchmark(Rnanoflan = a<-knn(t(x),t(points),method = "radius",radius=0.2,k=5),RANN = b<-RANN::nn2(x,points,searchtype = "radius",radius=0.2,k=5),times = 5)
Rfast2::benchmark(Rnanoflan = a<-knn(t(x),t(points),method = "radius",radius=0.5,k=5),RANN = b<-RANN::nn2(x,points,searchtype = "radius",radius=0.5,k=5),times = 5)
a
b
b$nn.idx
library(Rnanoflann)
library(Rnanoflann)
Rnanoflann:::`_Rnanoflann_RcppExport_registerCCallable`
library(Rnanoflann)
library(Rnanoflann)
Rfast2::benchmark(Rnanoflan = a<-Rnanoflann::knn(x,points,k=5),RANN = b<-RANN::nn2(x,points,k=5),times = 5)
RANN::nn2
library(Rnanoflann)
Rfast2::benchmark(Rnanoflan = a<-Rnanoflann::knn(x,points,k=5),RANN = b<-RANN::nn2(x,points,k=5),times = 5)
library(Rnanoflann)
Rfast2::benchmark(Rnanoflan = a<-Rnanoflann::knn(x,points,k=5),RANN = b<-RANN::nn2(x,points,k=5),times = 5)
library(Rnanoflann)
Rfast2::benchmark(Rnanoflan = a<-Rnanoflann::knn(x,points,k=5),RANN = b<-RANN::nn2(x,points,k=5),times = 5)
a<-Rnanoflann::knn(x,points,search = "standard",k=5)
a<-Rnanoflann::knn(x,points,search = "radius",k=5)
library(Rnanoflann)
Rfast2::benchmark(Rnanoflan = a<-Rnanoflann::knn(x,points,k=5),RANN = b<-RANN::nn2(x,points,k=5),times = 5)
all.equal(t(a$indices)+1,b$nn.idx)
all.equal(t(a$indices),b$nn.idx)
library(Rnanoflann)
dim(data)
data = Rfast::matrnorm(10000, 10)
points=Rfast::matrnorm(100,10)
k=20
save.image()
savehistory()
dim(data)
dim(points)
b=RANN::nn2(data,points,k=20)
savehistory()
dim(b$nn.idx)
library(Rnanoflann)
b=Rnanoflann::knn(data,points,k=20)
a=RANN::nn2(data,points,k=20)
all.equal(a$nn.idx,b$indices)
install.packages("QUALYPSO")
install.packages("cauchypca")
install.packages("QUALYPSO")
library(QUALYPSO)