The multicomponent range code on bins. More...
#include <ibin.h>
Public Member Functions | |
virtual long | append (const char *dt, const char *df, uint32_t nnew) |
Create index for the data in df and append the result to the index in dt. | |
long | append (const ibis::moins &tail) |
long | append (const array_t< uint32_t > &ind) |
Append a list of integers representing bin numbers. | |
virtual void | estimate (const ibis::qContinuousRange &expr, ibis::bitvector &lower, ibis::bitvector &upper) const |
Provide an estimation based on the current index. | |
virtual uint32_t | estimate (const ibis::qContinuousRange &expr) const |
Compute an upper bound on the number of hits. | |
virtual long | evaluate (const ibis::qContinuousRange &expr, ibis::bitvector &hits) const |
To evaluate the exact hits. | |
virtual long | evaluate (const ibis::qDiscreteRange &expr, ibis::bitvector &hits) const |
To evaluate the exact hits. | |
virtual double | getSum () const |
Compute the approximate value of the sum from the binned index. | |
moins (const ibis::bin &rhs, const uint32_t nbase=2) | |
Constructor. | |
moins (const ibis::column *c=0, const char *f=0, const uint32_t nbase=2) | |
Constructor. Construct a bitmap index from current data. | |
moins (const ibis::column *c, ibis::fileManager::storage *st, size_t offset=8) | |
Constructor. | |
virtual const char * | name () const |
Returns the name of the index, similar to the function type , but returns a string instead. | |
virtual void | print (std::ostream &out) const |
The printing function. | |
virtual void | speedTest (std::ostream &out) const |
A simple function to test the speed of the bitvector operations. | |
virtual INDEX_TYPE | type () const |
Returns an index type identifier. | |
virtual int | write (const char *dt) const |
Write the index to the specified location. | |
Protected Member Functions | |
virtual double | computeSum () const |
Compute the sum of values from the information in the index. |
The multicomponent range code on bins.
Moins is a French word for 'less'.
ibis::moins::moins | ( | const ibis::column * | c, |
ibis::fileManager::storage * | st, | ||
size_t | start = 8 |
||
) |
Constructor.
Reconstruct an index from content of a storage object. The content of the file (following the 8-byte header) is
nrows (uint32_t) -- number of bits in a bitvector nobs (uint32_t) -- number of bins nbits (uint32_t) -- number of bitvectors bounds (double[nobs]) -- bind boundaries maxval (double[nobs]) -- the maximum value in each bin minval (double[nobs]) -- the minimum value in each bin offset ([nbits+1]) -- starting position of the bitvectors cnts (uint32_t[nobs]) -- number of records in each bin nbases (uint32_t) -- number of components (size of array bases) bases (uint32_t[nbases]) -- the bases sizes bitvectors -- the bitvectors one after another
References ibis::index::col, ibis::gVerbose, ibis::column::name(), ibis::part::name(), and print().
ibis::moins::moins | ( | const ibis::bin & | rhs, |
const uint32_t | nbase = 2 |
||
) |
Constructor.
Converts an equality encoded index to multi-component range encoding.
References ibis::egale::clear(), ibis::index::col, ibis::gVerbose, ibis::column::name(), ibis::part::name(), and print().
double ibis::moins::computeSum | ( | ) | const [protected, virtual] |
Compute the sum of values from the information in the index.
Compute the approximate sum of all values using the binned index.
Reimplemented from ibis::egale.
References ibis::bitvector::cnt().
void ibis::moins::estimate | ( | const ibis::qContinuousRange & | expr, |
ibis::bitvector & | lower, | ||
ibis::bitvector & | upper | ||
) | const [virtual] |
Provide an estimation based on the current index.
Set bits in lower are hits for certain, set bits in upper are candidates. Set bits in (upper - lower) should be checked to verifies which ones are actually hits. If the bitvector upper contain less bits than bitvector lower, the content of upper is assumed to be the same as lower.
Reimplemented from ibis::egale.
References ibis::bitvector::clear(), ibis::bitvector::flip(), and ibis::bitvector::set().
long ibis::moins::evaluate | ( | const ibis::qContinuousRange & | expr, |
ibis::bitvector & | hits | ||
) | const [virtual] |
To evaluate the exact hits.
On success, return the number of hits, otherwise a negative value is returned.
Reimplemented from ibis::egale.
References ibis::bitvector::cnt(), and ibis::bitvector::size().
virtual long ibis::moins::evaluate | ( | const ibis::qDiscreteRange & | , |
ibis::bitvector & | |||
) | const [inline, virtual] |
To evaluate the exact hits.
On success, return the number of hits, otherwise a negative value is returned.
Reimplemented from ibis::egale.
References ibis::range::evaluate().
virtual const char* ibis::moins::name | ( | ) | const [inline, virtual] |
Returns the name of the index, similar to the function type
, but returns a string instead.
Reimplemented from ibis::egale.
int ibis::moins::write | ( | const char * | dt | ) | const [virtual] |
Write the index to the specified location.
The argument to this function can be a directory or a file. The actual index file name is determined by the function indexFileName.
Reimplemented from ibis::egale.
References ibis::fileManager::flushFile(), ibis::gVerbose, ibis::fileManager::instance(), ibis::index::MOINS, UnixOpen, ibis::egale::write32(), and ibis::egale::write64().
![]() |