⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basefabmacros.h

📁 自适应网格划分通用程序包
💻 H
📖 第 1 页 / 共 5 页
字号:
            const int thisLen = _b_len[0];                              \

#define ForAllXBNN(T,x,b,ns,nc)                                         \
{                                                                       \
    assert((x).contains(b));                                            \
    assert((ns) >= 0 && (ns) + (nc) <= (x).nComp());                    \
    const int *_x_plo = (x).loVect();                                   \
    const int *_x_plen = (x).size();                                    \
    const int *_b_lo = (b).loVect();                                    \
    const int *_b_len = (b).size().getVect();                           \
    T* _x_p = (x) .dataPtr();                                           \
    for(int _n = (ns); _n < (ns)+(nc); ++_n) {                          \
        const int nR = _n;                                              \
        for(int _j = 0; _j < _b_len[1]; ++_j) {                         \
            const int jR = _j + _b_lo[1];                               \
            T *_x_pp = _x_p                                             \
                + ((_b_lo[0] - _x_plo[0])                               \
                       + _x_plen[0]*(                                   \
                           (jR - _x_plo[1])                             \
                           + _n * _x_plen[1]));                         \
            for(int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) {            \
                const int iR = _i + _b_lo[0];                           \
                T &x##R = * _x_pp;

#define ForAllXCBNN(T,x,b,ns,nc)                                        \
{                                                                       \
    assert(x.contains(b));                                              \
    assert((ns) >= 0 && (ns) + (nc) <= (x).nComp());                    \
    const int *_x_plo = (x).loVect();                                   \
    const int *_x_plen = (x).size();                                    \
    const int *_b_lo = (b).loVect();                                    \
    const int *_b_len = (b).size().getVect();                           \
    const T* _x_p = (x).dataPtr();                                      \
    for(int _n = (ns); _n < (ns)+(nc); ++_n) {                          \
        const int nR = _n;                                              \
        for(int _j = 0; _j < _b_len[1]; ++_j) {                         \
            const int jR = _j + _b_lo[1];                               \
            const T *_x_pp = _x_p                                       \
                + ((_b_lo[0] - _x_plo[0])                               \
                       + _x_plen[0]*(                                   \
                           (jR  - _x_plo[1])                            \
                           + _n * _x_plen[1]));                         \
            for(int _i = 0; _i < _b_len[0]; ++_i) {                     \
                const int iR = _i + _b_lo[0];                           \
                const T & x##R = _x_pp[_i];


#define ForAllThisBNN(T,b,ns,nc)                                        \
{                                                                       \
    assert(contains(b));                                                \
    assert((ns) >= 0 && (ns) + (nc) <= nComp());                        \
    const int *_th_plo = loVect();                                      \
    const int *_th_plen = size();                                       \
    const int *_b_lo = (b).loVect();                                    \
    const int *_b_len = (b).size().getVect();                           \
    T* _th_p = dptr;                                                    \
    for(int _n = (ns); _n < (ns)+(nc); ++_n) {                          \
        int nR = _n; nR += 0;                                           \
        for(int _j = 0; _j < _b_len[1]; ++_j) {                         \
            const int jR = _j + _b_lo[1];                               \
            T *_th_pp = _th_p                                           \
                + ((_b_lo[0] - _th_plo[0])                              \
                   + _th_plen[0]*(                                      \
                       (jR - _th_plo[1])                                \
                       + _n * _th_plen[1]));                            \
            for(int _i = 0; _i < _b_len[0]; ++_i, ++_th_pp) {           \
                int iR = _i + _b_lo[0]; iR += 0;                        \
                T &thisR = * _th_pp;

#define ForAllThisCBNN(T,b,ns,nc)                                       \
{                                                                       \
    assert(contains(b));                                                \
    assert((ns) >= 0 && (ns) + (nc) <= nComp());                        \
    const int *_th_plo = loVect();                                      \
    const int *_th_plen = size();                                       \
    const int *_b_lo = (b).loVect();                                    \
    const int *_b_len = (b).size().getVect();                           \
    const T* _th_p = dptr;                                              \
    for(int _n = (ns); _n < (ns)+(nc); ++_n) {                          \
        const int nR = _n;                                              \
        for(int _j = 0; _j < _b_len[1]; ++_j) {                         \
            const int jR = _j + _b_lo[1];                               \
            const T *_th_pp = _th_p                                     \
                + ((_b_lo[0] - _th_plo[0])                              \
                   + _th_plen[0]*(                                      \
                       (_j + _b_lo[1] - _th_plo[1])                     \
                       + _n * _th_plen[1]));                            \
            for(int _i = 0; _i < _b_len[0]; ++_i) {                     \
                const int iR = _i + _b_lo[0];                           \
                const T &thisR = _th_pp[_i];

#define ForAllThisBNNXC(T,b,ns,nc,x,nss)                                \
{                                                                       \
    assert((ns) >= 0 && (ns) + (nc) <= nComp());                        \
    assert((nss) >= 0 && (nss) + (nc) <= (x).nComp());                  \
    Box _subbox_((x).box());                                            \
    _subbox_ &= box();                                                  \
    _subbox_ &= b;                                                      \
    if(!_subbox_.isEmpty()) {                                           \
        const int *_th_plo = loVect();                                  \
        const int *_th_plen = size();                                   \
        const int *_x_plo = (x).loVect();                               \
        const int *_x_plen = (x).size();                                \
        const int *_subbox_lo = _subbox_.loVect();                      \
        const int *_subbox_len = _subbox_.size().getVect();             \
        T* _th_p = dataPtr(ns);                                         \
        const T* _x_p  = (x).dataPtr(nss);                              \
        for(int _n = 0; _n < (nc); ++_n) {                              \
            int nR = _n; nR += 0;                                       \
            for(int _j = 0; _j < _subbox_len[1]; ++_j) {                \
                const int jR = _j + _subbox_lo[1];                      \
                T *_th_pp = _th_p                                       \
                    + ((_subbox_lo[0] - _th_plo[0])                     \
                       + _th_plen[0]*(                                  \
                           (jR - _th_plo[1])                            \
                           + _n * _th_plen[1]));                        \
                const T *_x_pp = _x_p                                   \
                    + ((_subbox_lo[0] - _x_plo[0])                      \
                       + _x_plen[0]*(                                   \
                           (jR - _x_plo[1])                             \
                           + _n * _x_plen[1]));                         \
                for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) {  \
                    int iR = _i + _subbox_lo[0]; iR += 0;               \
                    T &thisR = * _th_pp; const T & x##R = _x_pp[_i];

#define ForAllThisCBNNXC(T,b,ns,nc,x,nss)                                \
{                                                                       \
    assert((ns) >= 0 && (ns) + (nc) <= nComp());                        \
    assert((nss) >= 0 && (nss) + (nc) <= (x).nComp());                  \
    Box _subbox_((x).box());                                            \
    _subbox_ &= box();                                                  \
    _subbox_ &= b;                                                      \
    if(!_subbox_.isEmpty()) {                                           \
        const int *_th_plo = loVect();                                  \
        const int *_th_plen = size();                                   \
        const int *_x_plo = (x).loVect();                               \
        const int *_x_plen = (x).size();                                \
        const int *_subbox_lo = _subbox_.loVect();                      \
        const int *_subbox_len = _subbox_.size().getVect();             \
        const T* _th_p = dataPtr(ns);                                         \
        const T* _x_p  = (x).dataPtr(nss);                              \
        for(int _n = 0; _n < (nc); ++_n) {                              \
            int nR = _n; nR += 0;                                       \
            for(int _j = 0; _j < _subbox_len[1]; ++_j) {                \
                const int jR = _j + _subbox_lo[1];                      \
                const T *_th_pp = _th_p                                       \
                    + ((_subbox_lo[0] - _th_plo[0])                     \
                       + _th_plen[0]*(                                  \
                           (jR - _th_plo[1])                            \
                           + _n * _th_plen[1]));                        \
                const T *_x_pp = _x_p                                   \
                    + ((_subbox_lo[0] - _x_plo[0])                      \
                       + _x_plen[0]*(                                   \
                           (jR - _x_plo[1])                             \
                           + _n * _x_plen[1]));                         \
                for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) {  \
                    int iR = _i + _subbox_lo[0]; iR += 0;               \
                    const T &thisR = * _th_pp; const T & x##R = _x_pp[_i];

#define ForAllThisBNNXCBN(T,b,ns,nc,x,bx,nss)                           \
{                                                                       \
    assert((ns) >= 0 && (ns) + (nc) <= nComp());                        \
    assert((nss) >= 0 && (nss) + (nc) <= (x).nComp());                  \
    assert(bx.sameSize((b)));                                             \
    if(!((b).isEmpty())) {                                                  \
        const int *_th_plo = loVect();                                  \
        const int *_th_plen = size();                                   \
        const int *_x_plo = (x).loVect();                               \
        const int *_x_plen = (x).size();                                \
        const int *_subbox_lo = (b).loVect();                             \
        const int *_subbox_len = (b).size().getVect();                    \
        const int *_bx_lo = (bx).loVect();                              \
        T* _th_p = dataPtr(ns);                                         \
        int nR = ns; int n##x##R = nss;                                 \
        const T* _x_p  = (x).dataPtr(nss);                              \
        for(int _n = 0; _n < (nc); ++_n, ++nR, ++n##x##R ) {             \
            for(int _j = 0; _j < _subbox_len[1]; ++_j) {                \
                const int jR = _j + _subbox_lo[1];                      \
                const int j##x##R = _j + _bx_lo[1];                     \
                T *_th_pp = _th_p                                       \
                    + ((_subbox_lo[0] - _th_plo[0])                     \
                       + _th_plen[0]*(                                  \
                           (jR - _th_plo[1])                            \
                           + _n * _th_plen[1]));                        \
                const T *_x_pp = _x_p                                   \
                    + ((_bx_lo[0] - _x_plo[0])                          \
                       + _x_plen[0]*(                                   \
                           (j##x##R - _x_plo[1])                        \
                           + _n * _x_plen[1]));                         \
                int iR = _subbox_lo[0]; int i##x##R = _bx_lo[0];        \

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -