X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=epclust%2FR%2Futils.R;fp=epclust%2FR%2Futils.R;h=8f7da383c43b818a50a85839a13a314856d4b563;hb=5c6529795907ba1b34d4552cbfd0e0cbb77cac0f;hp=0000000000000000000000000000000000000000;hpb=db6fc17ddd53fb0c64cf957296dc615ba830db56;p=epclust.git diff --git a/epclust/R/utils.R b/epclust/R/utils.R new file mode 100644 index 0000000..8f7da38 --- /dev/null +++ b/epclust/R/utils.R @@ -0,0 +1,44 @@ +toInteger <- function(x, condition) +{ + if (!is.integer(x)) + tryCatch( + {x = as.integer(x)[1]}, + error = function(e) paste("cannot convert argument",substitute(x),"to integer") + ) + if (!condition(x)) + stop(paste("argument",substitute(x),"does not verify condition",body(condition))) + x +} + +#TODO: merge these 2 next ?! +serialize = function(coeffs) +{ + #......... + #C function (from data.frame, type of IDs ??! force integers ? [yes]) + #return raw vector +} +appendBinary = function(.......) +{ + #take raw vector, append it (binary mode) to a file +} + +#finalizeSerialization = function(...) +#{ +# #write number of series, and length of each... +#} + +deserialize = function(coeffs, range) +{ + #...... + #C function (from file name) +} + +getSeries(data, rank=NULL, id=NULL) +{ + #TODO: +} + +getCoeffs(.....) #FROM BINARY FILE !!! +{ + +}