# Namespace for bit64 (currently exporting (almost) everything in order to facilitate debugging)
# S3 atomic 64 bit integers for R
# (c) 2011 Jens Oehlschägel
# Licence: GPL2
# Provided 'as is', use at your own risk
# Created: 2011-12-11
# Last changed:  2012-10-07

useDynLib(bit64, .registration = TRUE, .fixes = "C_")

importFrom(methods, is)
importFrom(methods, as)
importFrom(utils, packageDescription)
importFrom(utils, strOptions)
importFrom(stats, quantile, median,cor)
importFrom(graphics, barplot, par, title)

importFrom(bit, setattr)
importFrom(bit, clone)
importFrom(bit, repeat.time)

importFrom(bit, xor)
importFrom(bit, ramsort)
importFrom(bit, shellsort)
importFrom(bit, quicksort)
importFrom(bit, mergesort)
importFrom(bit, radixsort)
importFrom(bit, keysort)
importFrom(bit, ramorder)
importFrom(bit, shellorder)
importFrom(bit, quickorder)
importFrom(bit, mergeorder)
importFrom(bit, radixorder)
importFrom(bit, keyorder)
importFrom(bit, ramsortorder)
importFrom(bit, shellsortorder)
importFrom(bit, quicksortorder)
importFrom(bit, mergesortorder)
importFrom(bit, radixsortorder)
importFrom(bit, keysortorder)

importFrom(bit, is.sorted)
importFrom(bit, na.count)
importFrom(bit, nvalid)
importFrom(bit, nunique)
importFrom(bit, nties)

export(

# == this is a complete list of R functions and metadata of this package sorted by filenames, non-exported functions are commented away ==

# -- patch64.R - patch generics --
  ":"
, ":.default"
, ":.integer64"
, "is.double"
, "is.double.default"
, "is.double.integer64"
, "match"
, "match.default"
, "%in%"
, "%in%.default"
, "rank"
, "rank.default"
#, "table"
#, "table.default"
, "order"
, "order.default"


# -- integer64.R - basic vector handling --

,"binattr"
,"plusclass"
,"minusclass"

 ,"integer64"
 ,"identical.integer64"

,"is.integer64"
,"as.integer64"
 
,"as.integer64.integer64"
,"as.integer64.NULL"
,"as.integer64.character"
,"as.integer64.double"
,"as.integer64.integer"
,"as.integer64.logical"
,"as.integer64.factor"
,"NA_integer64_"

,"as.character.integer64"
,"as.double.integer64"
,"as.integer.integer64"
,"as.logical.integer64"

,"as.bitstring"
,"as.bitstring.integer64"

#inherited: ,"length.integer64"
,"length<-.integer64"

,"[.integer64"
,"[[.integer64"
,"[[<-.integer64"
,"[<-.integer64"

,"str.integer64"
,"print.integer64"
,"format.integer64"
,"is.vector.integer64"
# as.vector.integer64 removed as requested by the CRAN maintainer ,"as.vector.integer64"
,"is.na.integer64"
,"is.nan.integer64"
,"is.finite.integer64"
,"is.infinite.integer64"
,"all.integer64"
,"any.integer64"

,"!.integer64"
,"&.integer64"
,"|.integer64"
,"xor.integer64"

,"!=.integer64"
,"==.integer64"
,"<.integer64"
,"<=.integer64"
,">.integer64"
,">=.integer64"

,"+.integer64"
,"-.integer64"
,"*.integer64"
,"^.integer64"
,"/.integer64"
,"%/%.integer64"
,"%%.integer64"

,"sign.integer64"
,"abs.integer64"
,"sqrt.integer64"
,"log.integer64"
,"log2.integer64"
,"log10.integer64"
,"floor.integer64"
,"ceiling.integer64"
,"trunc.integer64"
,"round.integer64"
,"signif.integer64"
,"scale.integer64"

,"c.integer64"
,"rep.integer64"
,"seq.integer64"
,"cbind.integer64"
,"rbind.integer64"
,"as.data.frame.integer64"

,"min.integer64"
,"max.integer64"
,"range.integer64"
,"lim.integer64" # not a method
,"sum.integer64"
,"prod.integer64"

,"diff.integer64"
,"cummin.integer64"
,"cummax.integer64"
,"cumsum.integer64"
,"cumprod.integer64"



# -- sort64.R - sorting --
, sort.integer64
, order.integer64
#, ramsort
, ramsort.integer64
#, ramorder
, ramorder.integer64
#, ramsortorder
, ramsortorder.integer64
#, mergesort
, mergesort.integer64
#, mergeorder
, mergeorder.integer64
#, mergesortorder
, mergesortorder.integer64
#, shellsort
, shellsort.integer64
#, shellorder
, shellorder.integer64
#, shellsortorder
, shellsortorder.integer64
#, quicksort
, quicksort.integer64
#, quickorder
, quickorder.integer64
#, quicksortorder
, quicksortorder.integer64
#, radixsort
, radixsort.integer64
#, radixsortorder
, radixsortorder.integer64
#, radixorder
, radixorder.integer64

# -- sortmerge64.R - searching & merging --

, sortnut
, sortnut.integer64
, ordernut
, ordernut.integer64
, sortfin
, sortfin.integer64
, orderfin
, orderfin.integer64
, orderpos
, orderpos.integer64
, sortorderpos
, sortorderpos.integer64
, sortuni
, sortuni.integer64
, orderuni
, orderuni.integer64
, sortorderuni
, sortorderuni.integer64
, orderupo
, orderupo.integer64
, sortorderupo
, sortorderupo.integer64
, ordertie
, ordertie.integer64
, sortordertie
, sortordertie.integer64
, orderdup
, orderdup.integer64
, sortorderdup
, sortorderdup.integer64
, sorttab
, sorttab.integer64
, ordertab
, ordertab.integer64
, sortordertab
, sortordertab.integer64
, orderrnk
, orderrnk.integer64
, sortorderrnk
, sortorderrnk.integer64
, sortqtl
, sortqtl.integer64
, orderqtl
, orderqtl.integer64
, orderkey
, orderkey.integer64
, sortorderkey
, sortorderkey.integer64

# -- hash64.R - matching --

, hashfun
, hashfun.integer64
, hashmap
, hashmap.integer64
, hashmaptab
, hashmaptab.integer64
, hashmapuni
, hashmapuni.integer64
, hashmapupo
, hashmapupo.integer64
, hashpos
, hashpos.cache_integer64
, hashrev
, hashrev.cache_integer64
, hashfin
, hashfin.cache_integer64
, hashrin
, hashrin.cache_integer64
, hashdup
, hashdup.cache_integer64
, hashuni
, hashuni.cache_integer64
, hashupo
, hashupo.cache_integer64
, hashtab
, hashtab.cache_integer64

# -- cache.R - matching --

, still.identical
, newcache
, jamcache
, cache
, setcache
, getcache
, remcache
, print.cache
, hashcache
, sortcache
, ordercache
, sortordercache
, na.count.integer64
, nvalid.integer64
, nunique.integer64
, nties.integer64
, is.sorted.integer64


# -- highlevel64.R - matching --

, benchmark64
, optimizer64
, match.integer64
, "%in%.integer64"
, unique.integer64
, unipos
, unipos.integer64
, tiepos
, tiepos.integer64
, keypos
, keypos.integer64
, duplicated.integer64
, table.integer64
, rank.integer64
, prank
, prank.integer64
, qtile
, qtile.integer64
, quantile.integer64
, median.integer64
, mean.integer64
, summary.integer64

# -- zzz.R --

#,.Last.lib
)


# -- patch64.R - patch generics --

S3method(":", default)
S3method(":", integer64)
S3method("is.double", default)
S3method("is.double", integer64)
S3method("match", default)
S3method("%in%", default)
S3method("rank", default)
#S3method("table", default)
S3method("order", default)


# -- integer64.R - basic vector handling --

S3method("identical", integer64)

S3method("is", integer64)
S3method("as", integer64)

S3method("as.integer64", integer64)
S3method("as.integer64", NULL)
S3method("as.integer64", character)
S3method("as.integer64", double)
S3method("as.integer64", integer)
S3method("as.integer64", logical)
S3method("as.integer64", factor)

S3method("as.character", integer64)
S3method("as.double", integer64)
S3method("as.integer", integer64)
S3method("as.logical", integer64)

S3method("as", bitstring)
S3method("as.bitstring", integer64)

#inherited: S3method("length", integer64)
S3method("length<-", integer64)

S3method("[", integer64)
S3method("[[", integer64)
S3method("[[<-", integer64)
S3method("[<-", integer64)

S3method("str", integer64)
S3method("print", integer64)
S3method("format", integer64)
S3method("is.vector", integer64)
# as.vector.integer64 removed as requested by the CRAN maintainer S3method("as.vector", integer64)
S3method("is.na", integer64)
S3method("is.nan", integer64)
S3method("is.finite", integer64)
S3method("is.infinite", integer64)
S3method("all", integer64)
S3method("any", integer64)

S3method("!", integer64)
S3method("&", integer64)
S3method("|", integer64)
S3method("xor", integer64)

S3method("!=", integer64)
S3method("==", integer64)
S3method("<", integer64)
S3method("<=", integer64)
S3method(">", integer64)
S3method(">=", integer64)

S3method("+", integer64)
S3method("-", integer64)
S3method("*", integer64)
S3method("^", integer64)
S3method("/", integer64)
S3method("%/%", integer64)
S3method("%%", integer64)

S3method("sign", integer64)
S3method("abs", integer64)
S3method("sqrt", integer64)
S3method("log", integer64)
S3method("log2", integer64)
S3method("log10", integer64)
S3method("floor", integer64)
S3method("ceiling", integer64)
S3method("trunc", integer64)
S3method("round", integer64)
S3method("signif", integer64)
S3method("scale", integer64)

S3method("c", integer64)
S3method("rep", integer64)
S3method("seq", integer64)
#S3method(":", default)
#S3method(":", integer64)
S3method("cbind", integer64)
S3method("rbind", integer64)
S3method("as.data.frame", integer64)

S3method("min", integer64)
S3method("max", integer64)
S3method("range", integer64)
S3method("sum", integer64)
S3method("prod", integer64)

S3method("diff", integer64)
S3method("cummin", integer64)
S3method("cummax", integer64)
S3method("cumsum", integer64)
S3method("cumprod", integer64)


# -- sort64.R - sorting --

S3method("sort", integer64)
S3method("order", integer64)
S3method("ramsort", integer64)
S3method("ramorder", integer64)
S3method("ramsortorder", integer64)
S3method("shellsort", integer64)
S3method("shellorder", integer64)
S3method("shellsortorder", integer64)
S3method("mergesort", integer64)
S3method("mergeorder", integer64)
S3method("mergesortorder", integer64)
S3method("quicksort", integer64)
S3method("quickorder", integer64)
S3method("quicksortorder", integer64)
S3method("radixsort", integer64)
S3method("radixsortorder", integer64)
S3method("radixorder", integer64)


# -- sortmerge64.R - searching & merging --
S3method("sortnut", integer64)
S3method("ordernut", integer64)

S3method("sortfin", integer64)
S3method("orderfin", integer64)

S3method("orderpos", integer64)
S3method("sortorderpos", integer64)

S3method("sortuni", integer64)
S3method("orderuni", integer64)
S3method("sortorderuni", integer64)

S3method("orderupo", integer64)
S3method("sortorderupo", integer64)

S3method("ordertie", integer64)
S3method("sortordertie", integer64)

S3method("orderdup", integer64)
S3method("sortorderdup", integer64)

S3method("sorttab", integer64)
S3method("ordertab", integer64)
S3method("sortordertab", integer64)

S3method("orderkey", integer64)
S3method("sortorderkey", integer64)

S3method("orderrnk", integer64)
S3method("sortorderrnk", integer64)

S3method("sortqtl", integer64)
S3method("orderqtl", integer64)


# -- hash64.R - matching --

S3method("hashfun", integer64)
S3method("hashmap", integer64)
S3method("hashmaptab", integer64)
S3method("hashmapuni", integer64)
S3method("hashmapupo", integer64)
S3method("hashpos", cache_integer64)
S3method("hashrev", cache_integer64)
S3method("hashfin", cache_integer64)
S3method("hashrin", cache_integer64)
S3method("hashdup", cache_integer64)
S3method("hashuni", cache_integer64)
S3method("hashupo", cache_integer64)
S3method("hashtab", cache_integer64)

# -- cache.R - matching --

S3method("print", cache)
S3method("na.count", integer64)
S3method("nvalid", integer64)
S3method("nunique", integer64)
S3method("nties", integer64)
S3method("is.sorted", integer64)

# -- highlevel64.R - matching --

S3method("match", integer64)
S3method("%in%", integer64)
S3method("unique", integer64)
S3method("unipos", integer64)
S3method("tiepos", integer64)
S3method("keypos", integer64)
S3method("duplicated", integer64)
#S3method("table", integer64)
S3method("rank", integer64)
S3method("prank", integer64)
S3method("qtile", integer64)
S3method("quantile", integer64)
S3method("median", integer64)
S3method("mean", integer64)
S3method("summary", integer64)

