The multicomponent interval 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::entre &tail) |
long | append (const array_t< uint32_t > &ind) |
Append a list of integers representing bin numbers. | |
entre (const ibis::column *c=0, const char *f=0, const uint32_t nbase=2) | |
entre (const ibis::column *c, ibis::fileManager::storage *st, size_t offset=8) | |
Reconstruct an index from the content of a storage object. | |
entre (const ibis::bin &rhs, const uint32_t nbase=2) | |
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. | |
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 long | select (const ibis::qContinuousRange &, void *) const |
Select the rows that satisfy the range condition. | |
virtual long | select (const ibis::qContinuousRange &, void *, ibis::bitvector &) const |
Select the rows that satisfy the range condition. | |
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 content of index to a specified location. | |
Protected Member Functions | |
virtual double | computeSum () const |
Compute the sum of values from the information in the index. |
The multicomponent interval code on bins.
Entre is a French word for 'in between'.
ibis::entre::entre | ( | const ibis::column * | c, |
ibis::fileManager::storage * | st, | ||
size_t | start = 8 |
||
) |
Reconstruct an index from the content of a storage object.
The content of the file (following the 8-byte header) is
nrows (uint32_t) -- number of bits in each bitvector nobs (uint32_t) -- number of bins nbits (uint32_t) -- number of bitvectors padding to ensure bounds starts on multiple of 8. 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::part::name(), ibis::column::name(), and print().
double ibis::entre::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::entre::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::entre::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::entre::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::entre::name | ( | ) | const [inline, virtual] |
Returns the name of the index, similar to the function type
, but returns a string instead.
Reimplemented from ibis::egale.
virtual long ibis::entre::select | ( | const ibis::qContinuousRange & | cmp, |
void * | vals | ||
) | const [inline, virtual] |
Select the rows that satisfy the range condition.
Output the values in vals. The values are in unspecified order to reduce the amount of processing needed in this function -- this follows the spirit of SQL standard.
Reimplemented from ibis::bin.
virtual long ibis::entre::select | ( | const ibis::qContinuousRange & | cmp, |
void * | vals, | ||
ibis::bitvector & | hits | ||
) | const [inline, virtual] |
Select the rows that satisfy the range condition.
Output the rows in the bit vector hits and the corresponding values in vals.
Reimplemented from ibis::bin.
int ibis::entre::write | ( | const char * | dt | ) | const [virtual] |
Write the content of index to a specified location.
The argument can be the name of the directory or the name of the file.
Reimplemented from ibis::egale.
References ibis::index::ENTRE, ibis::fileManager::flushFile(), ibis::gVerbose, ibis::fileManager::instance(), UnixOpen, ibis::egale::write32(), and ibis::egale::write64().
![]() |