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

The multicomponent range code on bins. More...

#include <ibin.h>

Inheritance diagram for ibis::moins:
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::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::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.
 moins (const ibis::bin &rhs, const uint32_t nbase=2)
 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 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 index to the specified location.

Protected Member Functions

virtual double computeSum () const
 Compute the sum of values from the information in the index.

Detailed Description

The multicomponent range code on bins.

Moins is a French word for 'less'.


Constructor & Destructor Documentation

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


Member Function Documentation

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.

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::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.

virtual long ibis::moins::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.

Note:
This function only works with integers and floating-point values.

Reimplemented from ibis::bin.

virtual long ibis::moins::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.

Note:
This function only works with integers and floating-point values.

Reimplemented from ibis::bin.

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().


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