Public Member Functions | Protected Member Functions
ibis::entre Class Reference

The multicomponent interval code on bins. More...

#include <ibin.h>

Inheritance diagram for ibis::entre:
ibis::egale ibis::bin ibis::index

List of all members.

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::bin &rhs, const uint32_t nbase=2)
 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.
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 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.

Detailed Description

The multicomponent interval code on bins.

Entre is a French word for 'in between'.


Constructor & Destructor Documentation

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::column::name(), ibis::part::name(), and print().


Member Function Documentation

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.

Note:
This function will not do anything if the estimated cost is high.

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.

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::gVerbose, UnixOpen, ibis::egale::write32(), and ibis::egale::write64().


The documentation for this class was generated from the following files:

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive