本文整理汇总了C++中Column::SetTuple方法的典型用法代码示例。如果您正苦于以下问题:C++ Column::SetTuple方法的具体用法?C++ Column::SetTuple怎么用?C++ Column::SetTuple使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Column
的用法示例。
在下文中一共展示了Column::SetTuple方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[]){
arg_t arg;
parse_arg(arg, argc, argv);
std::cout << "[INFO ] Creating column ..." << std::endl;
Column* column = new Column(arg.coltype, arg.nbits, arg.size);
std::cout << "[INFO ] Creating bit vector ..." << std::endl;
BitVector* bitvector = new BitVector(column);
std::cout << "[INFO ] Populating column with random values ..." << std::endl;
auto dice = std::bind(std::uniform_int_distribution<WordUnit>(
std::numeric_limits<WordUnit>::min(),
std::numeric_limits<WordUnit>::max()),
std::default_random_engine(std::time(0)));
WordUnit mask = (1ULL << arg.nbits) - 1;
for(size_t i=0; i < arg.size; i++){
column->SetTuple(i, dice() & mask);
}
std::cout << "[INFO ] omp_max_threads = " << omp_get_max_threads() << std::endl;
std::cout << "[INFO ] Executing scan ..." << std::endl;
HybridTimer t1;
t1.Start();
for(size_t r = 0; r < arg.repeat; r++){
column->Scan(Comparator::kLess,
static_cast<WordUnit>(mask*arg.selectivity),
bitvector,
Bitwise::kSet);
}
t1.Stop();
std::cout << "Wall time (sec), CPU cost (cycle/value)" << std::endl;
std::cout << t1.GetSeconds()/arg.repeat << ", "
<< double(t1.GetNumCycles()/arg.repeat)/arg.size
<< std::endl;
std::cout << "[INFO ] Releasing memory ..." << std::endl;
delete column;
delete bitvector;
}