亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? reduce.h

?? A C++ class library for scientific computing
?? H
字號:
// -*- C++ -*-/*************************************************************************** * blitz/array/reduce.h   Reductions of an array (or array expression) in a  *                        single rank: sum, mean, min, minIndex, max, maxIndex, *                        product, count, any, all * * Copyright (C) 1997-2001 Todd Veldhuizen <tveldhui@oonumerics.org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * Suggestions:          blitz-dev@oonumerics.org * Bugs:                 blitz-bugs@oonumerics.org * * For more information, please see the Blitz++ Home Page: *    http://oonumerics.org/blitz/ * ****************************************************************************/#ifndef BZ_ARRAYREDUCE_H#define BZ_ARRAYREDUCE_H#ifndef BZ_ARRAYEXPR_H #error <blitz/array/reduce.h> must be included after <blitz/array/expr.h>#endif#include <blitz/reduce.h>BZ_NAMESPACE(blitz)template<typename T_expr, int N_index, typename T_reduction>class _bz_ArrayExprReduce {public:       typedef _bz_typename T_reduction::T_numtype T_numtype;    typedef T_expr      T_ctorArg1;    typedef T_reduction T_ctorArg2;    static const int         numArrayOperands = T_expr::numArrayOperands,        numIndexPlaceholders = T_expr::numIndexPlaceholders + 1,        rank = T_expr::rank - 1;    _bz_ArrayExprReduce(const _bz_ArrayExprReduce<T_expr,N_index,T_reduction>&        reduce)        : reduce_(reduce.reduce_), iter_(reduce.iter_), ordering_(reduce.ordering_)    {    }    _bz_ArrayExprReduce(T_expr expr)        : iter_(expr)    { computeOrdering(); }    _bz_ArrayExprReduce(T_expr expr, T_reduction reduce)        : iter_(expr), reduce_(reduce)    { computeOrdering(); }    int ascending(int r)    { return iter_.ascending(r); }    int ordering(int r)    { return ordering_[r]; }    int lbound(int r)    { return iter_.lbound(r); }    int ubound(int r)    { return iter_.ubound(r); }    template<int N_destRank>    T_numtype operator()(const TinyVector<int, N_destRank>& destIndex)    {        BZPRECHECK(N_destRank == N_index,              "Array reduction performed over rank " << N_index             << " to produce a rank " << N_destRank << " expression." << endl            << "You must reduce over rank " << N_destRank << " instead.");        TinyVector<int, N_destRank + 1> index;        // This metaprogram copies elements 0..N-1 of destIndex into index        _bz_meta_vecAssign<N_index, 0>::assign(index, destIndex,             _bz_update<int,int>());        int lbound = iter_.lbound(N_index);        int ubound = iter_.ubound(N_index);        // NEEDS_WORK: replace with tiny(int()) and huge(int()) once        // <limits> widely available        BZPRECHECK((lbound != INT_MIN) && (ubound != INT_MAX),           "Array reduction performed over rank " << N_index           << " is unbounded." << endl            << "There must be an array object in the expression being reduced"           << endl << "which provides a bound in rank " << N_index << ".");        reduce_.reset();        for (index[N_index] = iter_.lbound(N_index);            index[N_index] <= ubound; ++index[N_index])        {            if (!reduce_(iter_(index), index[N_index]))                break;        }        return reduce_.result(ubound-lbound+1);    }    // If you have a precondition failure on this routine, it means    // you are trying to use stack iteration mode on an expression    // which contains an index placeholder.  You must use index    // iteration mode instead.    int operator*()    {        BZPRECONDITION(0);        return 0;    }    // See operator*() note    void push(int)    {        BZPRECONDITION(0);    }    // See operator*() note    void pop(int)    {        BZPRECONDITION(0);    }    // See operator*() note    void advance()    {        BZPRECONDITION(0);    }    // See operator*() note    void advance(int)    {        BZPRECONDITION(0);    }    // See operator*() note    void loadStride(int)    {        BZPRECONDITION(0);    }    bool isUnitStride(int) const    {        BZPRECONDITION(0);        return false;    }    void advanceUnitStride()    {        BZPRECONDITION(0);    }    bool canCollapse(int,int) const    {   BZPRECONDITION(0); return false; }    T_numtype operator[](int)    {        BZPRECONDITION(0);        return T_numtype();    }    T_numtype fastRead(int)    {        BZPRECONDITION(0);        return T_numtype();    }    int suggestStride(int) const    {        BZPRECONDITION(0);        return 0;    }    bool isStride(int,int) const    {        BZPRECONDITION(0);        return true;    }    template<int N_rank>    void moveTo(const TinyVector<int,N_rank>&)    {        BZPRECONDITION(0);        return;    }    void prettyPrint(BZ_STD_SCOPE(string) &str,         prettyPrintFormat& format) const    {        // NEEDS_WORK-- do real formatting for reductions        str += "reduce[NEEDS_WORK](";        iter_.prettyPrint(str,format);        str += ")";    }    template<typename T_shape>    bool shapeCheck(const T_shape&) const    {         // NEEDS_WORK-- do a real shape check (tricky)        return true;     }private:     _bz_ArrayExprReduce() { }// method for properly initializing the ordering values    void computeOrdering()    {        TinyVector<bool,rank> in_ordering;        in_ordering = false;        int j = 0;        for (int i=0; i<rank; ++i)        {            int orderingj = iter_.ordering(i);            if (orderingj != INT_MIN && orderingj < rank &&                !in_ordering(orderingj)) { // unique value in ordering array                in_ordering(orderingj) = true;                ordering_(j++) = orderingj;            }        }        // It is possible that ordering is not a permutation of 0,...,rank-1.        // In that case j will be less than rank. We fill in ordering with        // the unused values in decreasing order.        for (int i = rank-1; j < rank; ++j) {            while (in_ordering(i))                --i;            ordering_(j) = i--;        }    }    T_reduction reduce_;    T_expr iter_;    TinyVector<int,rank> ordering_;};#define BZ_DECL_ARRAY_PARTIAL_REDUCE(fn,reduction)                      \template<typename T_expr, int N_index>                                  \inline                                                                  \_bz_ArrayExpr<_bz_ArrayExprReduce<_bz_ArrayExpr<T_expr>, N_index,       \    reduction<_bz_typename T_expr::T_numtype> > >                       \fn(_bz_ArrayExpr<T_expr> expr, const IndexPlaceholder<N_index>&)        \{                                                                       \    return _bz_ArrayExprReduce<_bz_ArrayExpr<T_expr>, N_index,          \        reduction<_bz_typename T_expr::T_numtype> >(expr);              \}                                                                       \                                                                        \template<typename T_numtype, int N_rank, int N_index>                   \inline                                                                  \_bz_ArrayExpr<_bz_ArrayExprReduce<FastArrayIterator<T_numtype,N_rank>,  \    N_index, reduction<T_numtype> > >                                   \fn(const Array<T_numtype, N_rank>& array,                               \    const IndexPlaceholder<N_index>&)                                   \{                                                                       \    return _bz_ArrayExprReduce<FastArrayIterator<T_numtype,N_rank>,     \        N_index, reduction<T_numtype> > (array.beginFast());            \}                        BZ_DECL_ARRAY_PARTIAL_REDUCE(sum,      ReduceSum)BZ_DECL_ARRAY_PARTIAL_REDUCE(mean,     ReduceMean)BZ_DECL_ARRAY_PARTIAL_REDUCE(min,      ReduceMin)BZ_DECL_ARRAY_PARTIAL_REDUCE(minIndex, ReduceMinIndex)BZ_DECL_ARRAY_PARTIAL_REDUCE(max,      ReduceMax)BZ_DECL_ARRAY_PARTIAL_REDUCE(maxIndex, ReduceMaxIndex)BZ_DECL_ARRAY_PARTIAL_REDUCE(product,  ReduceProduct)BZ_DECL_ARRAY_PARTIAL_REDUCE(count,    ReduceCount)BZ_DECL_ARRAY_PARTIAL_REDUCE(any,      ReduceAny)BZ_DECL_ARRAY_PARTIAL_REDUCE(all,      ReduceAll)BZ_DECL_ARRAY_PARTIAL_REDUCE(first,    ReduceFirst)BZ_DECL_ARRAY_PARTIAL_REDUCE(last,     ReduceLast)/* * Complete reductions */// Prototype of reduction functiontemplate<typename T_expr, typename T_reduction>_bz_typename T_reduction::T_resulttype_bz_ArrayExprFullReduce(T_expr expr, T_reduction reduction);#define BZ_DECL_ARRAY_FULL_REDUCE(fn,reduction)                         \template<typename T_expr>                                               \inline                                                                  \_bz_typename reduction<_bz_typename T_expr::T_numtype>::T_resulttype    \fn(_bz_ArrayExpr<T_expr> expr)                                          \{                                                                       \    return _bz_ArrayExprFullReduce(expr,                                \        reduction<_bz_typename T_expr::T_numtype>());                   \}                                                                       \                                                                        \template<typename T_numtype, int N_rank>                                \inline                                                                  \_bz_typename reduction<T_numtype>::T_resulttype                         \fn(const Array<T_numtype, N_rank>& array)                               \{                                                                       \    return _bz_ArrayExprFullReduce(array.beginFast(),                   \        reduction<T_numtype>());                                        \}                                                                     BZ_DECL_ARRAY_FULL_REDUCE(sum,      ReduceSum)BZ_DECL_ARRAY_FULL_REDUCE(mean,     ReduceMean)BZ_DECL_ARRAY_FULL_REDUCE(min,      ReduceMin)BZ_DECL_ARRAY_FULL_REDUCE(max,      ReduceMax)BZ_DECL_ARRAY_FULL_REDUCE(product,  ReduceProduct)BZ_DECL_ARRAY_FULL_REDUCE(count,    ReduceCount)BZ_DECL_ARRAY_FULL_REDUCE(any,      ReduceAny)BZ_DECL_ARRAY_FULL_REDUCE(all,      ReduceAll)BZ_DECL_ARRAY_FULL_REDUCE(first,    ReduceFirst)BZ_DECL_ARRAY_FULL_REDUCE(last,     ReduceLast)// Special versions of complete reductions: minIndex and// maxIndex#define BZ_DECL_ARRAY_FULL_REDUCE_INDEXVECTOR(fn,reduction)             \template<typename T_expr>                                               \inline                                                                  \_bz_typename reduction<_bz_typename T_expr::T_numtype,                  \    T_expr::rank>::T_resulttype                                         \fn(_bz_ArrayExpr<T_expr> expr)                                          \{                                                                       \    return _bz_reduceWithIndexVectorTraversal(expr,                     \        reduction<_bz_typename T_expr::T_numtype, T_expr::rank>());     \}                                                                       \                                                                        \template<typename T_numtype, int N_rank>                                \inline                                                                  \_bz_typename reduction<T_numtype,N_rank>::T_resulttype                  \fn(const Array<T_numtype, N_rank>& array)                               \{                                                                       \    return _bz_reduceWithIndexVectorTraversal( array.beginFast(),       \        reduction<T_numtype,N_rank>());                                 \}BZ_DECL_ARRAY_FULL_REDUCE_INDEXVECTOR(minIndex, ReduceMinIndexVector)BZ_DECL_ARRAY_FULL_REDUCE_INDEXVECTOR(maxIndex, ReduceMaxIndexVector)BZ_NAMESPACE_END#include <blitz/array/reduce.cc>#endif // BZ_ARRAYREDUCE_H

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美麻豆精品久久久久久| 91在线无精精品入口| 欧美日韩亚洲综合一区| 夜夜嗨av一区二区三区网页 | 亚洲妇女屁股眼交7| 欧美色图天堂网| 亚洲综合久久久久| 日韩三区在线观看| 国模套图日韩精品一区二区| 久久精品夜色噜噜亚洲a∨ | 粉嫩av一区二区三区在线播放| 久久精品在这里| 色天使色偷偷av一区二区| 亚洲在线观看免费| 日韩精品资源二区在线| 国产精品99久久久久久宅男| 亚洲欧洲99久久| 欧美视频一二三区| 狠狠色丁香婷婷综合| 国产精品伦理一区二区| 在线视频一区二区三| 日韩电影在线一区二区| 国产亚洲女人久久久久毛片| 91高清视频在线| 极品尤物av久久免费看| 国产精品久久久久久久裸模| 欧美日精品一区视频| 紧缚奴在线一区二区三区| 亚洲精品国产视频| 欧美成人a∨高清免费观看| 不卡在线观看av| 蜜桃视频免费观看一区| 一色屋精品亚洲香蕉网站| 555www色欧美视频| 成人久久视频在线观看| 天天av天天翘天天综合网色鬼国产| 久久香蕉国产线看观看99| 在线亚洲精品福利网址导航| 国产一级精品在线| 午夜视黄欧洲亚洲| 中文字幕av一区二区三区| 欧美日韩国产经典色站一区二区三区| 精品一二三四区| 一区二区三区四区视频精品免费| 精品播放一区二区| 欧美在线三级电影| 成人免费视频视频在线观看免费| 调教+趴+乳夹+国产+精品| 亚洲国产高清不卡| 久久综合九色综合欧美亚洲| 欧美最新大片在线看| 成人亚洲一区二区一| 日本中文字幕一区| 亚洲综合区在线| 亚洲欧美在线视频观看| 欧美精品一区二区不卡| 欧美日本在线视频| 91精彩视频在线观看| 成人黄色av网站在线| 国产一区视频在线看| 日韩av电影免费观看高清完整版 | 欧美mv日韩mv国产网站app| 欧美性三三影院| 91色综合久久久久婷婷| 国产激情精品久久久第一区二区| 秋霞电影网一区二区| 午夜精品一区在线观看| 亚洲一区二区三区美女| 中文字幕一区在线| 国产精品美女一区二区在线观看| 久久综合色之久久综合| 亚洲精品在线观| 欧美videos中文字幕| 91精品国产色综合久久不卡电影| 欧美体内she精高潮| 欧洲国内综合视频| 欧美影院午夜播放| 欧洲中文字幕精品| 日本精品免费观看高清观看| 91亚洲精华国产精华精华液| 不卡的av电影| 91麻豆.com| 色噜噜狠狠色综合欧洲selulu| 91在线一区二区| 在线精品视频免费播放| 在线免费观看成人短视频| 欧美体内she精视频| 91精品国产91久久久久久最新毛片| 51精品国自产在线| 日韩一区二区影院| 欧美xxxxx裸体时装秀| 久久久www成人免费无遮挡大片| 久久免费偷拍视频| 国产精品不卡在线观看| 亚洲人成在线播放网站岛国| 夜夜夜精品看看| 肉肉av福利一精品导航| 极品少妇一区二区三区精品视频| 国产激情视频一区二区三区欧美| 99精品视频一区二区三区| 色婷婷国产精品综合在线观看| 欧美日韩国产免费一区二区| 日韩一级欧美一级| 欧美激情在线一区二区三区| 亚洲日本一区二区三区| 亚洲电影激情视频网站| 麻豆久久久久久久| 国产不卡在线一区| 欧美午夜免费电影| 亚洲精品一区在线观看| 国产精品久久久久久久久免费丝袜 | 偷拍与自拍一区| 韩国精品免费视频| 99精品久久99久久久久| 91麻豆精品国产91久久久资源速度 | 国产日韩v精品一区二区| 中文字幕一区二区日韩精品绯色| 亚洲成a人v欧美综合天堂| 国内一区二区视频| 91一区二区在线观看| 欧美成人高清电影在线| 亚洲免费在线视频| 麻豆精品国产91久久久久久| 91视频www| 欧美v日韩v国产v| 一区二区激情视频| 久久er99热精品一区二区| 91免费版在线看| 久久尤物电影视频在线观看| 一区二区三区精品| 黄色资源网久久资源365| 在线精品观看国产| 久久综合久久综合亚洲| 亚洲午夜免费福利视频| 成人激情免费视频| 欧美一级高清大全免费观看| 最新国产精品久久精品| 久久99久久精品欧美| 欧美性生活久久| 中文字幕在线不卡一区二区三区| 麻豆高清免费国产一区| 91福利资源站| 亚洲欧美日韩国产综合| 国产suv一区二区三区88区| 欧美福利电影网| 亚洲免费观看在线观看| 国产成人亚洲精品狼色在线| 日韩女同互慰一区二区| 午夜精品久久久久久久久久| 在线免费观看日本一区| 亚洲视频狠狠干| 成人国产精品免费网站| 久久久www成人免费毛片麻豆| 久久精品国内一区二区三区| 欧美色图天堂网| 亚洲国产一区二区在线播放| 色综合一个色综合| 中文字幕一区二区三区av| 粗大黑人巨茎大战欧美成人| 精品久久国产字幕高潮| 奇米888四色在线精品| 欧美卡1卡2卡| 亚洲成人第一页| 欧美日产在线观看| 亚洲妇熟xx妇色黄| 欧美日韩亚洲国产综合| 亚洲综合在线电影| 91精品办公室少妇高潮对白| 一区二区三区久久| 91官网在线观看| 亚洲一区影音先锋| 欧美蜜桃一区二区三区| 亚洲一级二级在线| 欧美少妇bbb| 亚洲国产精品久久久男人的天堂| 欧美色图一区二区三区| 爽好久久久欧美精品| 91精品国产综合久久福利| 免费观看在线综合| 日韩欧美成人一区| 国产电影一区二区三区| 国产精品久久久久久亚洲毛片 | 日韩福利视频网| 精品三级av在线| 国产成人夜色高潮福利影视| 综合电影一区二区三区| 91极品视觉盛宴| 日本亚洲免费观看| 久久丝袜美腿综合| 岛国精品在线观看| 一区二区三区中文字幕精品精品| 在线视频国内自拍亚洲视频| 日本不卡一二三区黄网| 久久综合九色综合97婷婷| 国产精品小仙女| 亚洲精品国产品国语在线app| 在线91免费看| 国产盗摄女厕一区二区三区| 亚洲人妖av一区二区| 欧美一卡二卡三卡|