Maps each value to a lower prevision (decimal) values and use the the low precision value as center of the bin. More...
#include <ibin.h>
Classes | |
struct | grain |
Public Types | |
typedef std::map< double, grain > | bakMap |
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::bin &tail) |
Append the tail to this index. | |
bak (const ibis::column *c, ibis::fileManager::storage *st, size_t offset=8) | |
bak (const ibis::column *c=0, const char *f=0) | |
virtual void | binBoundaries (std::vector< double > &) const |
The function binBoundaries and binWeights return bin boundaries and counts of each bin respectively. | |
virtual void | binWeights (std::vector< uint32_t > &) const |
virtual int | contractRange (ibis::qContinuousRange &rng) const |
virtual int | expandRange (ibis::qContinuousRange &rng) const |
The functions expandRange and contractRange expands or contracts the boundaries of a range condition so that the new range will have exact answers using the function estimate. | |
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 |
Prints human readable information. | |
virtual int | read (const char *idxfile) |
Read from a file named f. | |
virtual INDEX_TYPE | type () const |
Returns an index type identifier. | |
virtual int | write (const char *dt) const |
Write the index to the named directory or file. | |
Protected Member Functions | |
virtual uint32_t | locate (const double &val) const |
Find the bin containing val. | |
virtual void | locate (const ibis::qContinuousRange &expr, uint32_t &cand0, uint32_t &cand1, uint32_t &hit0, uint32_t &hit1) const |
Find the bins related to the range expression. | |
virtual void | locate (const ibis::qContinuousRange &expr, uint32_t &cand0, uint32_t &cand1) const |
Find the outer boundaries of the range expression. | |
void | mapValues (const char *f, bakMap &bmap) const |
Map the positions of each individual value. | |
void | printMap (std::ostream &out, const bakMap &bmap) const |
Maps each value to a lower prevision (decimal) values and use the the low precision value as center of the bin.
It reuses the same variables of ibis::bin, but have to interpret them differently.
Bak is a Dutch word for 'bin'.
void ibis::bak::binBoundaries | ( | std::vector< double > & | ) | const [virtual] |
The function binBoundaries and binWeights return bin boundaries and counts of each bin respectively.
Reimplemented from ibis::bin.
References ibis::util::compactValue(), and ibis::util::incrDouble().
int ibis::bak::expandRange | ( | ibis::qContinuousRange & | ) | const [virtual] |
The functions expandRange and contractRange expands or contracts the boundaries of a range condition so that the new range will have exact answers using the function estimate.
The default implementation provided does nothing since this is only meaningful for indices based on bins.
Reimplemented from ibis::bin.
References ibis::util::compactValue(), ibis::qContinuousRange::leftBound(), ibis::bin::locate(), and ibis::qContinuousRange::rightBound().
virtual void ibis::bak::locate | ( | const ibis::qContinuousRange & | expr, |
uint32_t & | cand0, | ||
uint32_t & | cand1, | ||
uint32_t & | hit0, | ||
uint32_t & | hit1 | ||
) | const [inline, protected, virtual] |
Find the bins related to the range expression.
Locate the bins for all candidates and hits.
Reimplemented from ibis::bin.
References ibis::range::locate().
virtual void ibis::bak::locate | ( | const ibis::qContinuousRange & | expr, |
uint32_t & | cand0, | ||
uint32_t & | cand1 | ||
) | const [inline, protected, virtual] |
Find the outer boundaries of the range expression.
Locate the outer reaches of a continuous range expression.
Reimplemented from ibis::bin.
References ibis::range::locate().
uint32_t ibis::bak::locate | ( | const double & | val | ) | const [protected, virtual] |
Find the bin containing val.
Find the smallest i such that bounds[i] > val.
Reimplemented from ibis::bin.
void ibis::bak::mapValues | ( | const char * | f, |
bakMap & | bmap | ||
) | const [protected] |
Map the positions of each individual value.
Map the locations of the values of one column.
Given a file containing the values of a column, this function maps the position of each individual values and stores the result in a set of bitmaps.
Reimplemented from ibis::index.
References ibis::bitvector::adjustSize(), ibis::bitvector::bitsPerLiteral(), ibis::CATEGORY, ibis::util::coarsen(), ibis::bitvector::copy(), ibis::DOUBLE, ibis::FLOAT, ibis::fileManager::getFile(), ibis::gVerbose, ibis::fileManager::instance(), ibis::INT, ibis::horometer::realTime(), ibis::bitvector::set(), ibis::bitvector::setBit(), ibis::bitvector::size(), ibis::array_t< T >::size(), ibis::horometer::start(), ibis::horometer::stop(), ibis::TEXT, and ibis::UINT.
virtual const char* ibis::bak::name | ( | ) | const [inline, virtual] |
Returns the name of the index, similar to the function type
, but returns a string instead.
Reimplemented from ibis::bin.
void ibis::bak::print | ( | std::ostream & | out | ) | const [virtual] |
Prints human readable information.
Outputs information about the index as text to the specified output stream.
Reimplemented from ibis::bin.
References ibis::gVerbose.
![]() |