中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

wordpress自定義樣式什么是seo文章

wordpress自定義樣式,什么是seo文章,臨近做網(wǎng)站,贛州網(wǎng)站建設(shè)聯(lián)系方式算法庫(kù) 算法庫(kù)提供大量用途的函數(shù)(例如查找、排序、計(jì)數(shù)、操作),它們?cè)谠胤秶喜僮鳌W⒁夥秶x為 [first, last) ,其中 last 指代要查詢或修改的最后元素的后一個(gè)元素。 類似 std::accumulate,但不依序執(zhí)行 std…

算法庫(kù)

算法庫(kù)提供大量用途的函數(shù)(例如查找、排序、計(jì)數(shù)、操作),它們?cè)谠胤秶喜僮?。注意范圍定義為?[first, last)?,其中?last?指代要查詢或修改的最后元素的后一個(gè)元素。

類似 std::accumulate,但不依序執(zhí)行

std::reduce
template<class InputIt>

typename std::iterator_traits<InputIt>::value_type reduce(

? ? InputIt first, InputIt last);
(1)(C++17 起)
template<class ExecutionPolicy, class ForwardIt>

typename std::iterator_traits<ForwardIt>::value_type reduce(
? ? ExecutionPolicy&& policy,

? ? ForwardIt first, ForwardIt last);
(2)(C++17 起)

template<class InputIt, class T>
T reduce(InputIt first, InputIt last, T init);

(3)(C++17 起)
template<class ExecutionPolicy, class ForwardIt, class T>

T reduce(ExecutionPolicy&& policy,

? ? ? ? ?ForwardIt first, ForwardIt last, T init);
(4)(C++17 起)

template<class InputIt, class T, class BinaryOp>
T reduce(InputIt first, InputIt last, T init, BinaryOp binary_op);

(5)(C++17 起)
template<class ExecutionPolicy, class ForwardIt, class T, class BinaryOp>

T reduce(ExecutionPolicy&& policy,

? ? ? ? ?ForwardIt first, ForwardIt last, T init, BinaryOp binary_op);
(6)(C++17 起)

1) 同 reduce(first, last, typename std::iterator_traits<InputIt>::value_type{})

3) 同 reduce(first, last, init, std::plus<>())

5) 在 binary_op 上以初值 init 規(guī)約范圍 [first; last) ,可能以未指定方式排序聚合。

2,4,6) 同 (1,3,5) ,但按照 policy 執(zhí)行。此重載僅若std::is_execution_policy_v<std::decay_t<ExecutionPolicy>> 為 true才參與重載決議

binary_op 非結(jié)合或非交換,則行為非確定。

binary_op 修改 [first; last] 中任何元素或非法化范圍中任何迭代器,含尾迭代器,則行為未定義。

參數(shù)

first, last-要應(yīng)用算法的元素范圍
init-廣義和的初值
policy-使用的執(zhí)行策略。細(xì)節(jié)見執(zhí)行策略。
binary_op-將以未指定順序應(yīng)用于解引用輸入迭代器結(jié)果、其他 binary_op 結(jié)果及 init 上的二元函數(shù)對(duì)象 (FunctionObject) 。
類型要求
- InputIt 必須滿足遺留輸入迭代器 (LegacyInputIterator) 的要求。
- ForwardIt 必須滿足遺留向前迭代器 (LegacyForwardIterator) 的要求。
- T 必須滿足可移動(dòng)構(gòu)造 (MoveConstructible) 的要求。而且 binary_op(init, *first) 、 binary_op(*first, init) 、 binary_op(init, init)binary_op(*first, *first) 必須可轉(zhuǎn)換到 T 。

返回值

init*first 、 *(first+1) 、…… *(last-1)binary_op 上的廣義和,

其中廣義和 GSUM(op, a
1, ..., a
N) 定義如下:

  • 若 N=1 ,則為 a
    1
  • 若 N > 1 ,則為 op(GSUM(op, b
    1, ..., b
    K), GSUM(op, b
    M, ..., b
    N)) ,其中
  • b
    1, ..., b
    N 可以是任何 a1, ..., aN 的排列,且
  • 1 < K+1 = M ≤ N

換言之, reduce 表現(xiàn)類似 std::accumulate ,除了范圍中的元素可能以任意順序分組并重排。

復(fù)雜度

O(last - first) 次應(yīng)用 binary_op.

異常

擁有名為 ExecutionPolicy 的模板形參的重載按下列方式報(bào)告錯(cuò)誤:

  • 若作為算法一部分調(diào)用的函數(shù)的執(zhí)行拋出異常,且 ExecutionPolicy 為標(biāo)準(zhǔn)策略之一,則調(diào)用 std::terminate 。對(duì)于任何其他 ExecutionPolicy ,行為是實(shí)現(xiàn)定義的。
  • 若算法無法分配內(nèi)存,則拋出 std::bad_alloc 。

注意

若為空,則返回不修改的 init

調(diào)用示例

#include <iostream>
#include <string>
#include <iterator>
#include <algorithm>
#include <functional>
#include <time.h>
#include <random>
#include <vector>
#include <cassert>struct Cell
{int x;int y;Cell() = default;Cell(int a, int b): x(a), y(b) {}Cell &operator +=(const Cell &cell){x += cell.x;y += cell.y;return *this;}Cell &operator +(const Cell &cell){x += cell.x;y += cell.y;return *this;}Cell &operator *(const Cell &cell){x *= cell.x;y *= cell.y;return *this;}Cell &operator ++(){x += 1;y += 1;return *this;}bool operator <(const Cell &cell) const{if (x == cell.x){return y < cell.y;}else{return x < cell.x;}}bool operator >(const Cell &cell) const{if (x == cell.x){return y > cell.y;}else{return x > cell.x;}}bool operator ==(const Cell &cell) const{return x == cell.x && y == cell.y;}friend Cell operator+(const Cell &lcell, const Cell &rcell){Cell cell = lcell;cell.x += rcell.x;cell.y += rcell.y;return cell;}friend Cell operator-(const Cell &lcell, const Cell &rcell){Cell cell = lcell;cell.x -= rcell.x;cell.y -= rcell.y;return cell;}friend Cell operator*(const Cell &lcell, const Cell &rcell){Cell cell = lcell;cell.x *= rcell.x;cell.y *= rcell.y;return cell;}friend Cell operator/(const Cell &lcell, const Cell &rcell){Cell cell = lcell;cell.x /= rcell.x;cell.y /= rcell.y;return cell;}friend Cell operator%(const Cell &lcell, const Cell &rcell){Cell cell = lcell;cell.x %= rcell.x;cell.y %= rcell.y;return cell;}
};std::ostream &operator<<(std::ostream &os, const Cell &cell)
{os << "{" << cell.x << "," << cell.y << "}";return os;
}namespace std
{
template <typename InputIt, typename T, typename BinaryOperation>
T reduce(InputIt first, InputIt last, T init, BinaryOperation op)
{for (; first != last; ++first){init = op(std::move(init), *first);}return init;
}
}int main()
{std::cout << std::boolalpha;std::mt19937 g{std::random_device{}()};srand((unsigned)time(NULL));auto generate = [](){int n = std::rand() % 10 + 110;Cell cell{n, n};return cell;};//3) 構(gòu)造擁有 count 個(gè)有值 value 的元素的容器。std::vector<Cell> vector1(8, generate());std::generate(vector1.begin(), vector1.end(), generate);std::sort(vector1.begin(), vector1.end());std::cout << "vector1:  ";std::copy(vector1.begin(), vector1.end(), std::ostream_iterator<Cell>(std::cout, " "));std::cout << std::endl;std::vector<Cell> vector2(vector1.size(), generate());std::generate(vector2.begin(), vector2.end(), generate);std::sort(vector2.begin(), vector2.end());std::cout << "vector2:  ";std::copy(vector2.begin(), vector2.end(), std::ostream_iterator<Cell>(std::cout, " "));std::cout << std::endl;for (size_t index = 0; index < vector1.size(); ++index){std::cout << "std::reduce(vector1.begin(), " << index << ", Cell{0, 0} std::plus<Cell>() ):    ";std::cout << std::reduce(vector1.begin(), vector1.begin() + index, Cell{0, 0}, std::plus<Cell>());std::cout << std::endl;}std::cout << std::endl;for (size_t index = 0; index < vector1.size(); ++index){std::cout << "std::reduce(vector1.begin(), " << index << ", Cell{0, 0} std::minus<Cell>() ):    ";std::cout << std::reduce(vector1.begin(), vector1.begin() + index, Cell{0, 0}, std::minus<Cell>());std::cout << std::endl;}std::cout << std::endl;for (size_t index = 0; index < vector2.size(); ++index){std::cout << "std::reduce(vector2.begin(), " << index << ", Cell{1, 1} std::multiplies<Cell>() ):    ";std::cout << std::reduce(vector2.begin(), vector2.begin() + index, Cell{1, 1}, std::multiplies<Cell>());std::cout << std::endl;}std::cout << std::endl;for (size_t index = 0; index < vector2.size(); ++index){std::cout << "std::reduce(vector2.begin(), " << index << ", Cell{1024, 1024} std::divides<Cell>() ):    ";std::cout << std::reduce(vector2.begin(), vector2.begin() + index, Cell{1024, 1024}, std::divides<Cell>());std::cout << std::endl;}std::cout << std::endl;for (size_t index = 0; index < vector2.size(); ++index){std::cout << "std::reduce(vector2.begin(), " << index << ", Cell{1024, 1024} std::modulus<Cell>() ):    ";std::cout << std::reduce(vector2.begin(), vector2.begin() + index, Cell{1024, 1024}, std::modulus<Cell>());std::cout << std::endl;}std::cout << std::endl;return 0;
}

輸出

vector1:  {111,111} {112,112} {113,113} {115,115} {116,116} {116,116} {117,117} {119,119}
vector2:  {110,110} {112,112} {112,112} {114,114} {117,117} {117,117} {119,119} {119,119}
std::reduce(vector1.begin(), 0, Cell{0, 0} std::plus<Cell>() ):    {0,0}
std::reduce(vector1.begin(), 1, Cell{0, 0} std::plus<Cell>() ):    {111,111}
std::reduce(vector1.begin(), 2, Cell{0, 0} std::plus<Cell>() ):    {223,223}
std::reduce(vector1.begin(), 3, Cell{0, 0} std::plus<Cell>() ):    {336,336}
std::reduce(vector1.begin(), 4, Cell{0, 0} std::plus<Cell>() ):    {451,451}
std::reduce(vector1.begin(), 5, Cell{0, 0} std::plus<Cell>() ):    {567,567}
std::reduce(vector1.begin(), 6, Cell{0, 0} std::plus<Cell>() ):    {683,683}
std::reduce(vector1.begin(), 7, Cell{0, 0} std::plus<Cell>() ):    {800,800}std::reduce(vector1.begin(), 0, Cell{0, 0} std::minus<Cell>() ):    {0,0}
std::reduce(vector1.begin(), 1, Cell{0, 0} std::minus<Cell>() ):    {-111,-111}
std::reduce(vector1.begin(), 2, Cell{0, 0} std::minus<Cell>() ):    {-223,-223}
std::reduce(vector1.begin(), 3, Cell{0, 0} std::minus<Cell>() ):    {-336,-336}
std::reduce(vector1.begin(), 4, Cell{0, 0} std::minus<Cell>() ):    {-451,-451}
std::reduce(vector1.begin(), 5, Cell{0, 0} std::minus<Cell>() ):    {-567,-567}
std::reduce(vector1.begin(), 6, Cell{0, 0} std::minus<Cell>() ):    {-683,-683}
std::reduce(vector1.begin(), 7, Cell{0, 0} std::minus<Cell>() ):    {-800,-800}std::reduce(vector2.begin(), 0, Cell{1, 1} std::multiplies<Cell>() ):    {1,1}
std::reduce(vector2.begin(), 1, Cell{1, 1} std::multiplies<Cell>() ):    {110,110}
std::reduce(vector2.begin(), 2, Cell{1, 1} std::multiplies<Cell>() ):    {12320,12320}
std::reduce(vector2.begin(), 3, Cell{1, 1} std::multiplies<Cell>() ):    {1379840,1379840}
std::reduce(vector2.begin(), 4, Cell{1, 1} std::multiplies<Cell>() ):    {157301760,157301760}
std::reduce(vector2.begin(), 5, Cell{1, 1} std::multiplies<Cell>() ):    {1224436736,1224436736}
std::reduce(vector2.begin(), 6, Cell{1, 1} std::multiplies<Cell>() ):    {1525177344,1525177344}
std::reduce(vector2.begin(), 7, Cell{1, 1} std::multiplies<Cell>() ):    {1107477504,1107477504}std::reduce(vector2.begin(), 0, Cell{1024, 1024} std::divides<Cell>() ):    {1024,1024}
std::reduce(vector2.begin(), 1, Cell{1024, 1024} std::divides<Cell>() ):    {9,9}
std::reduce(vector2.begin(), 2, Cell{1024, 1024} std::divides<Cell>() ):    {0,0}
std::reduce(vector2.begin(), 3, Cell{1024, 1024} std::divides<Cell>() ):    {0,0}
std::reduce(vector2.begin(), 4, Cell{1024, 1024} std::divides<Cell>() ):    {0,0}
std::reduce(vector2.begin(), 5, Cell{1024, 1024} std::divides<Cell>() ):    {0,0}
std::reduce(vector2.begin(), 6, Cell{1024, 1024} std::divides<Cell>() ):    {0,0}
std::reduce(vector2.begin(), 7, Cell{1024, 1024} std::divides<Cell>() ):    {0,0}std::reduce(vector2.begin(), 0, Cell{1024, 1024} std::modulus<Cell>() ):    {1024,1024}
std::reduce(vector2.begin(), 1, Cell{1024, 1024} std::modulus<Cell>() ):    {34,34}
std::reduce(vector2.begin(), 2, Cell{1024, 1024} std::modulus<Cell>() ):    {34,34}
std::reduce(vector2.begin(), 3, Cell{1024, 1024} std::modulus<Cell>() ):    {34,34}
std::reduce(vector2.begin(), 4, Cell{1024, 1024} std::modulus<Cell>() ):    {34,34}
std::reduce(vector2.begin(), 5, Cell{1024, 1024} std::modulus<Cell>() ):    {34,34}
std::reduce(vector2.begin(), 6, Cell{1024, 1024} std::modulus<Cell>() ):    {34,34}
std::reduce(vector2.begin(), 7, Cell{1024, 1024} std::modulus<Cell>() ):    {34,34}

http://m.risenshineclean.com/news/59232.html

相關(guān)文章:

  • 東莞手機(jī)網(wǎng)站制作公司鄭州網(wǎng)站顧問
  • 網(wǎng)站圖片怎么做緩存網(wǎng)店培訓(xùn)騙局
  • 金融行業(yè)網(wǎng)站制作天津百度推廣公司
  • 網(wǎng)站建設(shè)工具哪個(gè)好用營(yíng)銷型企業(yè)網(wǎng)站制作
  • 婚紗攝影行業(yè)網(wǎng)站網(wǎng)站建設(shè)制作費(fèi)用
  • 不懂的人做網(wǎng)站用織夢(mèng) 還是 cms企業(yè)網(wǎng)站seo哪里好
  • 男女做曖曖視頻免費(fèi)網(wǎng)站網(wǎng)站優(yōu)化軟件哪個(gè)好
  • vue 做雙語版網(wǎng)站千鋒教育學(xué)費(fèi)
  • wordpress 添加搜索欄搜索引擎優(yōu)化的核心及內(nèi)容
  • 博物館網(wǎng)站制作搜什么關(guān)鍵詞比較刺激
  • 網(wǎng)站模板上傳工具廣告詞
  • 諸城做網(wǎng)站找個(gè)人鏈接檢測(cè)工具
  • app開發(fā)公司認(rèn)可湖南嵐鴻推 薦整站優(yōu)化
  • 做網(wǎng)站服務(wù)器e3安徽網(wǎng)絡(luò)建站
  • 怎么通過建站來賺錢西安網(wǎng)站維護(hù)公司
  • 在哪個(gè)網(wǎng)站開發(fā)國(guó)外客戶游戲代理免費(fèi)加盟
  • 網(wǎng)站上點(diǎn)擊圖片局部放大如何做百度云搜索引擎入口百度網(wǎng)盤
  • 做網(wǎng)站要備案嗎美國(guó)最新新聞?lì)^條
  • 怎么用PS做珠寶網(wǎng)站上海seo培訓(xùn)中心
  • 蕪湖推廣公司網(wǎng)站排名軟件優(yōu)化
  • 鄭州漢獅做網(wǎng)站多少錢谷歌seo網(wǎng)站運(yùn)營(yíng)
  • 寧波新亞建設(shè)公司網(wǎng)站seo的主要工作內(nèi)容
  • 佛山網(wǎng)站建設(shè)公司怎么做網(wǎng)站文章優(yōu)化技巧
  • 做網(wǎng)站的鏡像是什么意思怎么做市場(chǎng)營(yíng)銷和推廣
  • 重慶網(wǎng)站建設(shè)哪家公司那家好杭州網(wǎng)站推廣平臺(tái)
  • 如何做一家門戶網(wǎng)站seo常規(guī)優(yōu)化
  • 網(wǎng)站建設(shè)的實(shí)訓(xùn)心得東莞seo推廣公司
  • 扁平風(fēng)格網(wǎng)站 模板臨沂做網(wǎng)站的公司
  • 互聯(lián)網(wǎng)網(wǎng)站建設(shè)制作精品成品網(wǎng)站源碼
  • 外國(guó)人做網(wǎng)站如何推廣app