From joachim.harloff at joachimharloff.de  Fri Oct  7 19:01:07 2011
From: joachim.harloff at joachimharloff.de (Joachim Harloff)
Date: Fri,  7 Oct 2011 19:01:07 +0200
Subject: [Rd] BitSet equivalent? Java code usable?
Message-ID: <r02010500-1068-F3AA0DA8F10511E097AB0017F2F04CA2@[192.168.0.5]>

Hi all,

I consider writing a R package on statistics for the sorting method as a hobby. I have written a private Java application that I could use as a basis. Therefore I'd like to ask two questions:

1) logical vectors: Bit storage (small) and capable of bit operations?
The Java application relies on BitSet(s) for efficiency reasons. Arrays of logical values cost far too much memory (in the 2nd level heap etc.) while chunks of BitSets easily fit into the first processor cache. Moreover the Bit operations or, xor, and, andnot, cardinality, clone, flip, equals, intersects are much faster done for BitSets than equivalent functions written for logical arrays. Is there any equivalent for BitSet in R? The vector type "logical" seems to be not equally powerful and I do not know its memory requirements. In BitSets a Bit requires just one Bit, no more.

2) Can Java code be used?
Can I use some Java code for a R package (without translating it first to C. This is not always simple)? Probably this sounds ugly but it would greatly simplify the task for me.

Regards,
Joachim Harloff



[Rd] BitSet equivalent? Java code usable?
Joachim Harloff