fastmatch - Fast match() function replacement
Package R docs
NEWS for fastmatch
o don't call XLENGTH() on NULL objects
o if compiled with -DCHECKHASH fastmatch will re-compute
the hash table every time and compare it to the existing
table to verify its consistency. This can be used to
detect incorrect use of fastmatch, i.e., cases where
the object is modified and the hash table is not removed.
o minor change for compatibility with R-devel
o fix protection bug in case when fmatch() falls back to
R's match() because of unsupported types (thanks to
o add fmatch.hash() which will create a hash table that can
be used later with fmatch(). This can be used in cases where
attaching the hash to the table implicitly is not reliable.
o added ctapply() - a fast version of tapply()
o added coalesce() - fast way of grouping unique values into
contiguous groups (in linear time).
o added - a fast version of
o fastmatch now supports long vectors. Note that the hash
function is the same as in R and thus it uses at most 32-bits,
hence long vectors can be used, but they must have less than
2^32 (~4e9) unique values.
o bugfix: matching reals against a table that contains NA or NaNs
would not match the position of those but return NA instead.
o bugfix: fix crash when a newly unserialized hash table is
used (since the table hash is not stored during serialization).
o some R functions (such as subset assignment like x <- 2)
can create a new object (with possibly modified content) and
copy all attributes including the hash cache. If the original
object was used as a table in fmatch(), the hash cache will be
copied into the modified object and thus its cache will be
possibly out of sync with the object. fmatch() will now
identify such cases and discard the hash to prevent errorneous
o match() coerces POSIXlt objects into characters, but so far
fmatch() performed the match on the actual objects.
Now fmatch() coerces POSIXlt object into characters just like
match(), but note that you will lose the ability to perform
fast lookups if the table is a POSIXlt object -- please use
POSIXct objects (much more efficient) or use as.character() on
the POSIXlt object to create a table that you want to re-use.
o bugfix: nomatch was ignored in the fastmatch implementation
(thanks to Enrico Schumann for reporting)
o minor cleanups
o initial release