Rf <- matrix(runif(50000),nrow=100)
JWriteBin(Rf,"Rfullfloat.bin",dtype="float",dmtype="full",
comment="Full matrix of floats, 100 rows, 500 columns")
JMatInfo("Rfullfloat.bin")
CalcAndWriteDissimilarityMatrix("Rfullfloat.bin","RfullfloatDis.bin",distype="L2",
restype="float",comment="L2 distance matrix from full",nthreads=0)
JMatInfo("RfullfloatDis.bin")
JWriteBin(Rf,"Rsparsefloat.bin",dtype="float",dmtype="sparse",
comment="Sparse matrix of floats, 100 rows, 500 columns")
JMatInfo("Rsparsefloat.bin")
CalcAndWriteDissimilarityMatrix("Rsparsefloat.bin","RsparsefloatDis.bin",distype="L2",
restype="float",comment="L2 distance matrix from sparse",nthreads=0)
JMatInfo("RsparsefloatDis.bin")
Dfu<-GetJManyRows("RfullfloatDis.bin",c(1:nrow(Rf)))
Dsp<-GetJManyRows("RsparsefloatDis.bin",c(1:nrow(Rf)))
max(Dfu-Dsp)
file.remove("Rfullfloat.bin")
file.remove("Rsparsefloat.bin")
file.remove("RfullfloatDis.bin")
file.remove("RsparsefloatDis.bin")
Run the code above in your browser using DataLab