21 template <
class DataType>
27 inline void setVector(std::vector<DataType> &input) {
41 std::vector<std::vector<int>>
table_{};
49template <
class DataType>
53template <
class DataType>
55 std::vector<DataType> &input) {
60template <
class DataType>
67 int const numberOfBlocs
68 =
static_cast<unsigned int>(log2(sizeOfArray + 1)) + 1;
71 table_.resize(sizeOfArray);
72 for(
int i = 0; i < sizeOfArray; i++) {
73 table_[i].resize(numberOfBlocs);
78 for(
int i = 0; i < sizeOfArray; i++) {
82 for(
int k = 1; ((1 << k) - 1) < sizeOfArray; k++) {
83 for(
int i = 0; (i + (1 << k) - 1) < sizeOfArray; i++) {
99template <
class DataType>
102#ifndef TTK_ENABLE_KAMIKAZE
110 int const k =
static_cast<int>(log2(j - i + 1));
115 return table_[j - (1 << k) + 1][k];
void setDebugMsgPrefix(const std::string &prefix)
int preprocess(const bool silent=false)
RangeMinimumQuery(std::vector< DataType > &input)
std::vector< std::vector< int > > table_
void setVector(std::vector< DataType > &input)
int query(int i, int j) const
TTK base package defining the standard types.
T end(std::pair< T, T > &p)
T begin(std::pair< T, T > &p)
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/| (_) |"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)