26 const char* name()
const {
return "roster list";}
28 uint32_t size()
const;
30 int read(
const char* idxfile);
34 void print(std::ostream& out)
const;
36 int write(
const char* dt)
const;
56 std::vector<uint32_t>& positions)
const;
64 int locate(
const std::vector<T>& vals,
69 int locate(
const std::vector<T>& vals,
70 std::vector<uint32_t>& positions)
const;
75 static long mergeBlock2(
const char *dsrc,
const char *dout,
98 uint32_t
locate(
const double& val)
const;
100 template <
typename T>
int
101 icSearch(
const std::vector<T>& vals, std::vector<uint32_t>& pos)
const;
102 template <
typename T>
int
103 oocSearch(
const std::vector<T>& vals, std::vector<uint32_t>& pos)
const;
104 template <
typename inT,
typename myT>
int
105 locate2(
const std::vector<inT>&, std::vector<uint32_t>&)
const;
106 template <
typename T>
int
108 template <
typename T>
int
110 template <
typename inT,
typename myT>
int
120 void clear() {ind.
clear();
if (inddes>=0) UnixClose(inddes);};
121 int write(FILE* fptr)
const;
124 void icSort(
const char* f = 0);
126 void oocSort(
const char* f = 0);
128 long oocSortBlocks(
const char *src,
const char *dest,
129 const char *ind,
const uint32_t mblock,
133 long oocMergeBlocks(
const char *dsrc,
const char *dout,
134 const char *isrc,
const char *iout,
135 const uint32_t mblock,
const uint32_t stride,
154 uint32_t tmp = UINT_MAX;
155 if (i < ind.
size()) {
158 else if (inddes >= 0) {
159 if (static_cast<off_t>(i*
sizeof(uint32_t)) !=
160 UnixSeek(inddes, i*
sizeof(uint32_t), SEEK_SET))
162 if (
sizeof(uint32_t) != UnixRead(inddes, &tmp,
sizeof(uint32_t)))
166 LOGGER(ibis::gVerbose > 0)
167 <<
"Warning -- roster(ind[" << ind.
size() <<
"], inddes="
168 << inddes <<
")::operator[]: index i (" << i
169 <<
") is out of range";
173 #endif // IBIS_ROSTER_H
size_t size() const
Definition: array_t.h:69
int locate(const ibis::array_t< T > &vals, ibis::bitvector &positions) const
Locate the values and set their positions in the bitvector.
Definition: iroster.cpp:3112
void clear()
Reset the size to zero.
Definition: array_t.h:171
The storage class treats all memory as char*.
Definition: fileManager.h:237
void print(std::ostream &out) const
Output a minimal information about the roster list.
Definition: iroster.cpp:2102
A roster is a list of values in ascending order plus their original positions.
Definition: iroster.h:19
The current implementation of FastBit is code named IBIS; most data structures and functions are in t...
Definition: bord.h:16
The class to represent a column of a data partition.
Definition: column.h:65
int icSearch(const std::vector< T > &vals, std::vector< uint32_t > &pos) const
In-core searching function.
Definition: iroster.cpp:2646
int write(const char *dt) const
Write two files, .ind for indices and .srt to the sorted values.
Definition: iroster.cpp:66
Defines minor utility functions and common classes used by FastBit.
int locate2(const std::vector< inT > &, std::vector< uint32_t > &) const
Cast the incoming values into the type of the column (myT) and then locate the positions of the recor...
Definition: iroster.cpp:3285
int writeSorted(const char *dt) const
Write the sorted version of the attribute values to a .srt file.
Definition: iroster.cpp:139
static long mergeBlock2(const char *dsrc, const char *dout, const uint32_t segment, array_t< T > &buf1, array_t< T > &buf2, array_t< T > &buf3)
A two-way merge algorithm.
Definition: iroster.cpp:1919
int oocSearch(const std::vector< T > &vals, std::vector< uint32_t > &pos) const
Out-of-core search function.
Definition: iroster.cpp:2762
A data structure to represent a sequence of bits.
Definition: bitvector.h:62
uint32_t operator[](uint32_t i) const
Return the row number of the ith smallest value.
Definition: iroster.h:153