
import("methods")

import("biglm")

importFrom("digest",
	"digest")

importFrom("irlba",
	"irlba")

importFrom("stats",
	"median",
	"update",
	"setNames",
	"na.omit")

import("BiocParallel")

importFrom("BiocGenerics",
	"as.data.frame",
	"as.list",
	"as.vector",
	"mean",
	"sd",
	"var",
	"colMeans",
	"colSums",
	"rowMeans",
	"rowSums",
	"t",
	"path",
	"path<-",
	"combine",
	"cbind",
	"rbind",
	"which",
	"lapply",
	"sapply")

importFrom("ProtGenerics",
	"tolerance")

importFrom("utils",
	"head",
	"tail",
	"object.size")

exportClasses(
	"drle",
	"matter",
	"matter_vec",
	"matter_mat",
	"matter_matc",
	"matter_matr",
	"matter_arr",
	"matter_list",
	"matter_str",
	"matter_fc",
	"matter_df",
	"rep_vt",
	"sparse_mat",
	"sparse_matc",
	"sparse_matr",
	"virtual_mat",
	"virtual_matc",
	"virtual_matr",
	"virtual_tbl",
	"virtual_df")

export(
	"drle",
	"is.drle")

export(
	"matter",
	"matter_vec",
	"matter_mat",
	"matter_arr",
	"matter_list",
	"matter_str",
	"matter_fc",
	"matter_df",
	"rep_vt",
	"sparse_mat",
	"is.matter",
	"as.matter",
	"is.sparse",
	"as.sparse",
	"is.virtual",
	"as.virtual",
	"virtual_mat",
	"virtual_df",
	"struct")

exportMethods(
	"as.altrep",
	"as.vector",
	"as.matrix",
	"as.array",
	"as.list",
	"as.factor",
	"as.data.frame")

exportMethods(
	"adata",
	"atomdata",
	"atomdata<-",
	"datamode",
	"datamode<-",
	"paths",
	"paths<-",
	"path",
	"path<-",
	"filemode",
	"filemode<-",
	"readonly",
	"readonly<-",
	"chunksize",
	"chunksize<-")

exportMethods("checksum")

exportMethods(
	"describe_for_display",
	"preview_for_display")

exportMethods(
	"keys",
	"keys<-",
	"tolerance",
	"tolerance<-",
	"combiner",
	"combiner<-")

exportMethods(
	"%*%",
	"[",
	"[<-",
	"$",
	"$<-",
	"c",
	"combine",
	"cbind",
	"rbind",
	"lengths",
	"length",
	"length<-",
	"dim",
	"dim<-",
	"names",
	"names<-",
	"dimnames",
	"dimnames<-",
	"levels",
	"levels<-",
	"t",
	"crossprod",
	"tcrossprod")

exportMethods(
	"Arith",
	"Compare",
	"Logic",
	"exp",
	"log",
	"log2",
	"log10")

exportMethods(
	"head",
	"tail",
	"range",
	"min",
	"max",
	"prod",
	"sum",
	"mean",
	"var",
	"sd",
	"any",
	"all",
	"colSums",
	"colMeans",
	"colVars",
	"colSds",
	"rowSums",
	"rowMeans",
	"rowVars",
	"rowSds",
	"which")

export(
	"s_range",
	"s_min",
	"s_max",
	"s_prod",
	"s_sum",
	"s_mean",
	"s_var",
	"s_sd",
	"s_any",
	"s_all",
	"stat_c")

export(
	"colstreamStats",
	"rowstreamStats")

S3method("c", "stream_stat")
S3method("print", "stream_stat")
S3method("nobs", "stream_stat")
S3method("[", "stream_stat")
S3method("[[", "stream_stat")

S3method("stat_c", "stream_range")
S3method("stat_c", "stream_min")
S3method("stat_c", "stream_max")
S3method("stat_c", "stream_prod")
S3method("stat_c", "stream_sum")
S3method("stat_c", "stream_mean")
S3method("stat_c", "stream_var")
S3method("stat_c", "stream_sd")
S3method("stat_c", "stream_any")
S3method("stat_c", "stream_all")

exportMethods(
	"colStats",
	"rowStats")

export("chunk_apply")

export("atoms")

export(
	"uuid",
	"hex2raw",
	"raw2hex")

S3method("print", "num_bytes")
S3method("format", "num_bytes")

export(
	"make_filemode",
	"common_filemode")

export(
	"sizeof",
	"make_datamode",
	"convert_datamode",
	"widest_datamode",
	"vm_used")

export(
	"binvec",
	"locmax")

exportMethods(
	"apply",
	"lapply",
	"sapply")

exportMethods("scale")

exportMethods(
	"biglm",
	"bigglm")

exportMethods("prcomp")

export("bsearch")

export(
	"mem",
	"profmem")

useDynLib("matter", .registration=TRUE)
