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

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

?? fastmarching.h

?? fast marching method
?? H
?? 第 1 頁 / 共 2 頁
字號:
                    if (y>0) __UpdatePointVoro(x,y-1,z);                    if (y<height-1) __UpdatePointVoro(x,y+1,z);                    if (z>0) __UpdatePointVoro(x,y,z-1);                    if (z<depth-1) __UpdatePointVoro(x,y,z+1);                }            }        }    private:        ////////////////////////////////////////////////////////////////////////////////////////////////////////////        // En: Update of a point        // Fr: Mise a jour d'un point       void __UpdatePoint(const int x, const int y, const int z) {			const int n = _offset(x,y,z);            const eState st = (eState)state[n];            if (st == eFar) {                // En: If it was a far point, we put it as trial,  we compute its value and we add it to the queue                // Fr: Si c'etait un point far, on le rend trial, on calcule sa valeur et on l'ajoute a la queue                state[n] = eTrial;                const T val = _UpdateValue(x,y,z);                data[n] = sign*val;                tabnode[n] = trial_queue.push(stCoordVal<T>(x,y,z,n,val));            }            else if (st == eTrial) {                // En: If it was a far point, we recompute its value                // En: if the new value is inferior, we accept it and we increase the point in the queue                // Fr: Si c'etait deja un point trial, on recalcule sa valeur                // Fr: Si la nouvelle valeur est inferieure, on l'accepte et on fait remonter le point dans la queue                const T val = _UpdateValue(x,y,z);                if (val<sign*data[n]) {                    data[n] = sign*val;                    trial_queue.increase(tabnode[n],stCoordVal<T>(x,y,z,n,val));                }            }        }        // voro must be non-null        void __UpdatePointVoro(const int x, const int y, const int z) {			const int n = _offset(x,y,z);            int mx = -1, my = -1, mz = -1;            const eState st = (eState)state[n];            if (st == eFar) {                // En: If it was a far point, we put it as trial,  we compute its value and we add it to the queue                // Fr: Si c'etait un point far, on le rend trial, on calcule sa valeur et on l'ajoute a la queue                const T val = _UpdateValue(x,y,z,mx,my,mz);                state[n] = eTrial;                data[n] = sign*val;                if ((mx != -1) && (my != -1) && (mz != -1)) voro[n] = voro[_offset(mx, my, mz)];                tabnode[n] = trial_queue.push(stCoordVal<T>(x,y,z,n,val));            }            else if (st == eTrial) {                // En: If it was a far point, we recompute its value                // En: if the new value is inferior, we accept it and we increase the point in the queue                // Fr: Si c'etait deja un point trial, on recalcule sa valeur                // Fr: Si la nouvelle valeur est inferieure, on l'accepte et on fait remonter le point dans la queue                const T val = _UpdateValue(x,y,z,mx,my,mz);                //if ((mx < 0) || (mx > width-1) || (my < 0) || (my > height-1) || (mz < 0) || (mz > depth-1)) return;                if (val<sign*data[n]) {                    data[n] = sign*val;                    voro[n] = voro[_offset(mx,my,mz)];                    trial_queue.increase(tabnode[n],stCoordVal<T>(x,y,z,n,val));                }            }        }	protected:      	////////////////////////////////////////////////////////////////////////////////////////////////////////////        // En: Acces to a  point        // Fr: Acces a un point        int _offset(const int x, const int y, const int z) const { return x+width*(y+height*z); }        T _GetValue(const int x, const int y, const int z) const { return _GetValue(_offset(x,y,z)); }        T _GetValue(const int n) const {            if (state[n] <= eTrial) return sign*data[n];            return big;		}        ////////////////////////////////////////////////////////////////////////////////////////////////////////////        // Fr: Computation of the value of a point : have to be defined in the inherited class        // En: Calcul de la valeur d'un point : a definir dans les classes derivees        virtual T _UpdateValue(const int x, const int y, const int z) const = 0;        virtual T _UpdateValue(const int x, const int y, const int z, int &mx, int &my, int &mz) const = 0;        ////////////////////////////////////////////////////////////////////////////////////////////////////////////        // En: resolution of a second degree trinomial equation        // Fr: Resolution d'un trinome du second degre        bool _SolveTrinome(const T a, const T b, const T c, T &sol_max, T &sol_min) const {            const T delta = b*b - 4.*a*c;            if (delta < 0) return false;            const T sqrtDelta = std::sqrt(delta);            sol_max = (- b + sqrtDelta) / a / 2.;            sol_min = (- b - sqrtDelta) / a / 2.;            return true;        }    };        ////////////////////////////////////////////////////////////////////////////////////////////////////////////    // En: 2D Iconale Equation     // Fr: Equation iconale en 2D    template <typename T = float, int sign = +1>    class Eikonal2D : public FastMarching<T,sign> {                  public:        Eikonal2D(T *_data, int _width, int _height) :  FastMarching<T,sign>(_data,_width,_height) {}        virtual ~Eikonal2D() {}               protected:        ////////////////////////////////////////////////////////////////////////////////////////////////////////////             // En: Update of a point        // Fr: Mise a jour d'un point        virtual T _UpdateValue(const int x, const int y, const int z) const {               // En: we take the minimum of each couple of neighbourhood            // Fr: On prend le minimum de chaque paire de voisins            const T A = (x==0) ? this->_GetValue(x+1,y,z) : (x==this->width-1) ? this->_GetValue(x-1,y,z) : std::min( this->_GetValue(x+1,y,z), this->_GetValue(x-1,y,z) );            const T B = (y==0) ? this->_GetValue(x,y+1,z) : (y==this->height-1) ? this->_GetValue(x,y-1,z) : std::min( this->_GetValue(x,y+1,z), this->_GetValue(x,y-1,z) );            return _Solve(A,B);        }        virtual T _UpdateValue(const int x, const int y, const int z, int &mx, int &my, int &mz) const {               // En: we take the minimum of each couple of neighbourhood            // Fr: On prend le minimum de chaque paire de voisins            mx = (x==0) ? x+1 : (x==this->width-1) ? x-1 : (this->_GetValue(x+1,y,z) < this->_GetValue(x-1,y,z) ? x+1 : x-1);            my = (y==0) ? y+1 : (y==this->height-1) ? y-1 : (this->_GetValue(x,y+1,z) < this->_GetValue(x,y-1,z) ? y+1 : y-1);            mz = z;            return _Solve(x,y,z,mx,my);        }        ////////////////////////////////////////////////////////////////////////////////////////////////////////////        // En: Resolution of the trinomial equation        // Fr: Resolution du trinome        T _Solve(T A, T B) const {            // En: we get rid of the trival cases             // Fr: On se debarasse des cas triviaux            if (A == this->big) return B+1;            if (B == this->big) return A+1;            // En: we reorder the values in order to have  B>=A            // Fr: On reordonne les valeurs pour avoir B>=A            if (A>B) std::swap(A,B);                       //En: We assume that  u>=B : we solve the trinomial equation. If we have u>=B, it is ok            //Fr: On supppose u>=B : trinome. Si on a bien u>=B, on a gagne            T sol_max, sol_min;            if (B<this->big && _SolveTrinome(2, -2.*(A+B), A*A+B*B-1., sol_max, sol_min) && sol_max+EPS>=B) return sol_max;            // En: We assume A<=u<B            // Fr: On suppose A<=u<B            return A+1.;        }        T _Solve(const int x, const int y, const int z, int &mx, int &my) const {            // En: we get rid of the trival cases             // Fr: On se debarasse des cas triviaux            const T A = this->_GetValue(mx,y,z);            const T B = this->_GetValue(x,my,z);            if (A == this->big) { mx = x; return B+1; }            if (B == this->big) { my = y; return A+1; }            // En: we reorder the values in order to have  B>=A            // Fr: On reordonne les valeurs pour avoir B>=A            if (A>B) { std::swap(A,B); mx = x; }            else { my = y; }            //En: We assume that  u>=B : we solve the trinomial equation. If we have u>=B, it is ok            //Fr: On supppose u>=B : trinome. Si on a bien u>=B, on a gagne            T sol_max, sol_min;            if (B<this->big && _SolveTrinome(2, -2.*(A+B), A*A+B*B-1., sol_max, sol_min) && sol_max+EPS>=B) return sol_max;            // En: We assume A<=u<B            // Fr: On suppose A<=u<B            return A+1.;        }    };        ////////////////////////////////////////////////////////////////////////////////////////////////////////////    // En: 3D Iconale Equation     // Fr: Equation iconale en 3D    template <typename T = float, int sign = +1>    class Eikonal3D : public FastMarching<T,sign> {        public:        Eikonal3D(T *_data, int _width, int _height, int _depth) :  FastMarching<T,sign>(_data,_width,_height,_depth) {}        virtual ~Eikonal3D() {}    protected:        ////////////////////////////////////////////////////////////////////////////////////////////////////////////        // En: Update of a point        // Fr: Mise a jour d'un point        virtual T _UpdateValue(const int x, const int y, const int z) const {            // En: we take the minimum of each couple of neighbourhood            // Fr: On prend le minimum de chaque paire de voisins            const T A = (x==0) ? this->_GetValue(x+1,y,z) : (x==this->width-1) ? this->_GetValue(x-1,y,z) : std::min( this->_GetValue(x+1,y,z), this->_GetValue(x-1,y,z) );            const T B = (y==0) ? this->_GetValue(x,y+1,z) : (y==this->height-1) ? this->_GetValue(x,y-1,z) : std::min( this->_GetValue(x,y+1,z), this->_GetValue(x,y-1,z) );            const T C = (z==0) ? this->_GetValue(x,y,z+1) : (z==this->depth-1) ? this->_GetValue(x,y,z-1) : std::min( this->_GetValue(x,y,z+1), this->_GetValue(x,y,z-1) );            return _Solve(A,B,C);        }        virtual T _UpdateValue(const int x, const int y, const int z, int &mx, int &my, int &mz) const {            // En: we take the minimum of each couple of neighbourhood            // Fr: On prend le minimum de chaque paire de voisins            mx = (x==0) ? x+1 : (x==this->width-1) ? x-1 : (this->_GetValue(x+1,y,z) < this->_GetValue(x-1,y,z) ? x+1 : x-1);            my = (y==0) ? y+1 : (y==this->height-1) ? y-1 : (this->_GetValue(x,y+1,z) < this->_GetValue(x,y-1,z) ? y+1 : y-1);            mz = (z==0) ? z+1 : (z==this->depth-1) ? z-1 : (this->_GetValue(x,y,z+1) < this->_GetValue(x,y,z-1) ? z+1 : z-1);            return _Solve(x,y,z,mx,my,mz);        }        ////////////////////////////////////////////////////////////////////////////////////////////////////////////        // En: Resolution of the trinomial equation        // Fr: Resolution du trinome        T _Solve(T A, T B, T C) const {            // En: we reorder the values in order to have  C>=B>=A            // Fr: On reordonne les valeurs pour avoir C>=B>=A            if (A>B) std::swap(A,B);            if (B>C) std::swap(B,C);            if (A>B) std::swap(A,B);            // En: We assume sol>=C : first trinomial equation. If we have sol>=C, it is ok            // Fr: On suppose sol>=C : premier trinome. Si on a bien sol>=C, on a gagne            T sol_max, sol_min;            if (C<this->big && _SolveTrinome(3, -2*(A+B+C), A*A+B*B+C*C-1, sol_max, sol_min) && sol_max+EPS>=C) return sol_max;            // En: We assume B<=sol<C : second trinomial equation. If we have sol>=B, it is ok            // Fr: On supppose B<=sol<C : deuxieme trinome. Si on a bien sol>=B, on a gagne            if (B<this->big && _SolveTrinome(2, -2*(A+B), A*A+B*B-1, sol_max, sol_min) && sol_max+EPS>=B) return sol_max;                            // En: We assume A<=sol<B            // Fr: On suppose A<=sol<B            return A+1;        }        // à faire        T _Solve(const int x, const int y, const int z, int &mx, int &my, int &mz) const {            const T A = this->_GetValue(mx,y,z);            const T B = this->_GetValue(x,my,z);            const T C = this->_GetValue(x,y,mz);            // En: we reorder the values in order to have  C>=B>=A            // Fr: On reordonne les valeurs pour avoir C>=B>=A            if (A>B) std::swap(A,B);            if (B>C) std::swap(B,C);            if (A>B) std::swap(A,B);            // En: We assume sol>=C : first trinomial equation. If we have sol>=C, it is ok            // Fr: On suppose sol>=C : premier trinome. Si on a bien sol>=C, on a gagne            T sol_max, sol_min;            if (C<this->big && _SolveTrinome(3, -2*(A+B+C), A*A+B*B+C*C-1, sol_max, sol_min) && sol_max+EPS>=C) return sol_max;            // En: We assume B<=sol<C : second trinomial equation. If we have sol>=B, it is ok            // Fr: On supppose B<=sol<C : deuxieme trinome. Si on a bien sol>=B, on a gagne            if (B<this->big && _SolveTrinome(2, -2*(A+B), A*A+B*B-1, sol_max, sol_min) && sol_max+EPS>=B) return sol_max;                            // En: We assume A<=sol<B            // Fr: On suppose A<=sol<B            return A+1;        }    };}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久久久久免费樱桃 | 国产乱码精品一区二区三区五月婷| 国产精品亚洲成人| 奇米影视7777精品一区二区| 国产精品夜夜嗨| 欧美日韩在线一区二区| 国产亚洲欧洲一区高清在线观看| 亚洲婷婷综合久久一本伊一区| 久久精品国产一区二区| 91网站最新地址| 91色婷婷久久久久合中文| 欧美成人精品1314www| 亚洲精品欧美在线| 久久精品国产亚洲一区二区三区| 色综合久久中文综合久久牛| 国产视频一区在线观看| 亚洲1区2区3区视频| 国产一区二区三区高清播放| 欧美高清视频不卡网| 中文字幕一区二区在线观看| 理论片日本一区| 欧美日韩精品免费| 中文字幕一区二区三区四区不卡| 麻豆国产一区二区| 国产精品自拍av| 日韩欧美精品在线视频| 一区二区三区在线免费观看| av激情成人网| 久久亚区不卡日本| 日本vs亚洲vs韩国一区三区 | 首页欧美精品中文字幕| 成人国产一区二区三区精品| 久久久久久久久久久久电影| 免费观看30秒视频久久| 99视频有精品| 国产精品卡一卡二卡三| 国产精品原创巨作av| 欧美一区二区三级| 日本sm残虐另类| 欧美福利一区二区| 亚洲一区免费视频| 欧美体内she精高潮| 国产精品丝袜久久久久久app| 另类小说视频一区二区| 欧美一区二区视频在线观看| 久久先锋影音av| 日日欢夜夜爽一区| 欧美日韩高清在线| 亚洲视频一区二区在线观看| 97se亚洲国产综合在线| 国产欧美精品一区二区色综合朱莉| 国产精选一区二区三区| 久久综合国产精品| 东方aⅴ免费观看久久av| 久久久精品黄色| 成人一二三区视频| 蜜臀av性久久久久蜜臀aⅴ| 91精品麻豆日日躁夜夜躁| 亚洲与欧洲av电影| 777午夜精品视频在线播放| 亚洲第一福利一区| 91精品国产入口在线| 日本欧美一区二区三区乱码| 欧美三级一区二区| 五月婷婷久久综合| 欧美精品xxxxbbbb| 国产精品久久久久婷婷| 成人免费毛片aaaaa**| 久久精品亚洲精品国产欧美kt∨| 国产一区二区伦理| 国产日韩欧美a| 91视频免费播放| 一区二区三区不卡视频| 九色porny丨国产精品| 国产亚洲污的网站| 99综合影院在线| 亚洲欧洲av在线| 欧美在线免费视屏| 性做久久久久久久免费看| 日韩欧美一二区| 国产呦萝稀缺另类资源| 日韩三级在线观看| 成人开心网精品视频| 亚洲视频一区二区免费在线观看| 欧美天堂亚洲电影院在线播放| 日韩av高清在线观看| 精品国产麻豆免费人成网站| 成人91在线观看| 一区二区三区加勒比av| 欧美一级欧美一级在线播放| 国产综合色精品一区二区三区| 亚洲国产精品成人久久综合一区| 在线视频观看一区| 日韩电影在线一区二区三区| 日韩久久精品一区| 国产黄色精品网站| 亚洲六月丁香色婷婷综合久久| 8x8x8国产精品| 国产精品一二三四| 亚洲一区二区三区四区的| 日韩一区二区在线看| 高清av一区二区| 一区二区在线观看av| 日韩一区二区视频| 国产精品资源站在线| 性做久久久久久久免费看| 久久精品一区八戒影视| 91精彩视频在线| 久久国产视频网| 亚洲图片欧美激情| 日韩一区国产二区欧美三区| 成人小视频在线观看| 亚洲成人高清在线| 久久久久久亚洲综合| 91麻豆.com| 精品在线观看免费| 亚洲男同1069视频| 日韩精品中文字幕一区二区三区 | 欧美一级日韩免费不卡| www.亚洲色图.com| 男女视频一区二区| 最近中文字幕一区二区三区| 精品久久久久久久一区二区蜜臀| 福利一区二区在线| 日韩高清一级片| 国产精品国产三级国产| 欧美v日韩v国产v| 欧美在线一二三四区| 成a人片国产精品| 久久国产视频网| 亚洲国产精品精华液网站| 亚洲日本va午夜在线电影| 精品国产区一区| 99re热这里只有精品视频| 精品午夜久久福利影院| 日韩和的一区二区| 亚洲免费在线视频| 欧美va亚洲va| 日韩一区二区三免费高清| 91蜜桃网址入口| 国产v综合v亚洲欧| 久久爱www久久做| 亚洲18色成人| 偷拍日韩校园综合在线| 亚洲欧美另类在线| 国产网红主播福利一区二区| 久久久三级国产网站| 日韩一级精品视频在线观看| 在线观看国产91| 在线精品视频免费播放| aa级大片欧美| 精品一区二区三区视频在线观看| 成人av网在线| 国产乱子伦视频一区二区三区| 精品一区二区三区在线视频| 石原莉奈在线亚洲二区| 亚洲免费av在线| 亚洲欧美另类图片小说| 亚洲国产精品激情在线观看| 国产一区二区网址| 国产在线精品国自产拍免费| 麻豆中文一区二区| 亚洲国产精品精华液网站| 午夜精品123| 亚洲国产aⅴ成人精品无吗| 日韩欧美一级二级| 精品区一区二区| 日韩你懂的在线观看| 精品久久久久久无| 精品国产伦一区二区三区观看体验 | 久久久天堂av| 精品捆绑美女sm三区| 精品久久久网站| 日韩欧美一区二区视频| 久久众筹精品私拍模特| 日韩美一区二区三区| 久久久www免费人成精品| 久久中文娱乐网| 国产精品电影一区二区| 国产精品久久久一本精品 | 国产一区二区精品久久99| 国产一区二区精品久久99| 国产伦精品一区二区三区在线观看| 国产在线精品一区二区夜色 | 欧美日免费三级在线| 欧美人动与zoxxxx乱| 欧美一区午夜精品| 91成人看片片| 日韩一区二区免费在线观看| 制服.丝袜.亚洲.另类.中文 | 成人激情免费网站| 亚洲高清免费在线| 蜜桃视频在线一区| 精品一区二区三区欧美| 国产在线看一区| 成人午夜激情视频| 91麻豆视频网站| 欧美一区二区性放荡片| 久久女同互慰一区二区三区| 日韩毛片精品高清免费|