其他运算
以下 C++ 序列方法接受各种输入序列参数,并生成结果序列或标量类型。
histogram
Sequence<uint8> histogram(T minValue, T maxValue, mco_size_t nIntervals) const
为对象的序列构建一个直方图。应指定输入序列的最小(包含)值和最大(不包含)值以及区间(直方图列)的数量。
sort
void sort(std::vector<T> const& elements, std::vector<mco_seq_no_t>& permutation, mco_seq_order_t order)
对先前操作运算使用 get()
提取的序列元素进行排序,并构建一个排列数组(位置数组),该数组可用于访问其他序列(也提取到数组中)的元素。
permutate
void permutate(Sequence<Chars>& result, std::vector<mco_seq_no_t> const& permutation) const
使用 sort() 生成的排列对序列元素进行排序。
以下这组方法通过函数指针 func 对 Sequence 或者将此对象和输入的 Sequence 分别作为 left 和 right 操作数执行特定操作。
apply
Sequence<T> apply(unary_function_t func) const
将参数func指向的一元函数应用于这个Sequence。
apply
Sequence<T> apply(Sequence<T> const& other, binary_function_t func) const;
将由参数 func 指向的二元函数应用于此 Sequence 和 other 。