A variation on ibis::bak, it splits each bin of ibis::bak in two, one for entries less than the mapped value and one for the entries that greater and equal to the mapped value. More...
#include <ibin.h>
Classes | |
struct | grain |
A simple structure to record the position of the values mapped to the same low-precision target value. More... | |
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. | |
bak2 (const ibis::column *c=0, const char *f=0) | |
bak2 (const ibis::column *c, ibis::fileManager::storage *st, size_t offset=8) | |
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) const |
Find the outer boundaries of the range expression. | |
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. | |
void | mapValues (const char *f, bakMap &bmap) const |
Reads all values and records positions in bmap . | |
void | printMap (std::ostream &out, const bakMap &bmap) const |
A variation on ibis::bak, it splits each bin of ibis::bak in two, one for entries less than the mapped value and one for the entries that greater and equal to the mapped value.
This way, the index can be used to answer question involving ranges exactly on the mapped values. All internal variables are processed same as a regular ibis::bin index.
void ibis::bak2::binBoundaries | ( | std::vector< double > & | ) | const [virtual] |
The function binBoundaries and binWeights return bin boundaries and counts of each bin respectively.
Reimplemented from ibis::bin.
int ibis::bak2::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().
uint32_t ibis::bak2::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.
virtual void ibis::bak2::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().
virtual void ibis::bak2::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 const char* ibis::bak2::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::bak2::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.
![]() |