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

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

?? fastmarching.h.svn-base

?? fast marching method
?? SVN-BASE
?? 第 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一区二区三区免费野_久草精品视频
亚洲蜜桃精久久久久久久| 久久免费国产精品| 色综合天天性综合| 国产成人在线免费观看| 国产精品69久久久久水密桃| 亚洲.国产.中文慕字在线| 亚洲精品成人少妇| 亚洲一区二区视频在线| 午夜视频一区二区| 日韩国产欧美在线视频| 日本aⅴ免费视频一区二区三区| 亚洲电影第三页| 蜜臀av亚洲一区中文字幕| 美女视频黄久久| 国产精品自拍在线| caoporen国产精品视频| 91福利国产成人精品照片| 欧美视频一区二| 欧美www视频| 国产日产欧产精品推荐色| 亚洲欧美综合色| 亚洲综合在线视频| 久久成人av少妇免费| 国产成+人+日韩+欧美+亚洲| 不卡的av在线| 欧美高清激情brazzers| 26uuu精品一区二区在线观看| 国产欧美一二三区| 亚洲影视在线观看| 蜜桃av噜噜一区二区三区小说| 国产精品888| 欧美午夜片在线观看| 精品美女被调教视频大全网站| 国产女人18毛片水真多成人如厕 | 91麻豆精品国产综合久久久久久| 91精品国产aⅴ一区二区| 国产午夜精品一区二区| 亚洲一区二区三区不卡国产欧美| 美国av一区二区| 色婷婷综合视频在线观看| 911精品产国品一二三产区| 欧美激情一区二区| 日日夜夜精品视频免费| thepron国产精品| 日韩欧美精品在线视频| 亚洲欧美激情插| 韩国女主播成人在线观看| 色哦色哦哦色天天综合| 国产视频一区在线播放| 日本中文在线一区| 91麻豆国产精品久久| 久久久影视传媒| 蜜桃视频一区二区三区在线观看| 99久久精品国产一区| 精品对白一区国产伦| 婷婷久久综合九色国产成人 | 亚洲免费在线电影| 国产成人av影院| 精品国产sm最大网站免费看| 亚洲午夜久久久久久久久电影院 | 亚洲天堂精品在线观看| 激情欧美日韩一区二区| 91精品黄色片免费大全| 亚洲综合精品久久| 一本一道综合狠狠老| 中文字幕精品在线不卡| 国产乱码精品一区二区三区忘忧草| 精品1区2区3区| 伊人一区二区三区| 在线观看区一区二| 亚洲精品国产品国语在线app| 不卡的av在线播放| 日韩伦理免费电影| 9l国产精品久久久久麻豆| 欧美高清在线视频| 成人av在线网| 中文字幕一区二区三| 粉嫩绯色av一区二区在线观看| 久久综合九色综合97婷婷| 国内精品久久久久影院薰衣草| 精品欧美乱码久久久久久| 日本在线不卡一区| 精品国产a毛片| 国产成人一级电影| 亚洲欧洲日韩在线| 91国在线观看| 亚洲高清免费一级二级三级| 91亚洲大成网污www| 亚洲欧洲综合另类在线| 欧美日韩一卡二卡| 麻豆freexxxx性91精品| 久久综合久久久久88| 丰满亚洲少妇av| 国产精品久久久久久久久晋中 | 久久精品国产色蜜蜜麻豆| 欧美最猛黑人xxxxx猛交| 亚洲欧美国产毛片在线| 欧美日韩精品免费| 婷婷六月综合网| 久久综合九色欧美综合狠狠| 不卡的av在线播放| 天天综合色天天| 久久久久久久久免费| 成a人片亚洲日本久久| 亚洲一区二区在线免费观看视频| 欧美一区二区二区| 丰满亚洲少妇av| 亚洲一卡二卡三卡四卡无卡久久 | 精品盗摄一区二区三区| 国产精品亚洲午夜一区二区三区| 国产精品乱码人人做人人爱| 成人av免费在线| 午夜精品国产更新| 久久综合色之久久综合| 97精品久久久午夜一区二区三区| 日韩av电影天堂| 欧美激情一区二区三区四区| 欧美亚洲高清一区二区三区不卡| 久久电影网站中文字幕| 亚洲激情欧美激情| 日韩一级二级三级| 在线观看免费成人| 国产一区三区三区| 亚欧色一区w666天堂| 国产女人水真多18毛片18精品视频| 99久久99久久免费精品蜜臀| 蜜臀91精品一区二区三区| 亚洲三级电影网站| 国产色产综合色产在线视频| 337p亚洲精品色噜噜噜| 色婷婷综合久久久中文字幕| 国产精品综合一区二区| 亚洲福利视频导航| 欧美一卡二卡三卡| 欧美日韩免费一区二区三区视频| 成人黄色一级视频| 国产一区二三区| 麻豆国产精品一区二区三区| 亚洲男人的天堂一区二区| 欧美激情一区二区在线| 久久综合一区二区| 精品国内二区三区| 日韩视频永久免费| 91麻豆精品国产91久久久久久久久 | aaa欧美大片| 国产91丝袜在线观看| 久久99久久精品| 看片网站欧美日韩| 麻豆精品在线看| 蜜桃免费网站一区二区三区| 日本vs亚洲vs韩国一区三区二区| 亚洲一级在线观看| 日韩主播视频在线| 日本va欧美va瓶| 久久国产精品第一页| 美日韩一区二区| 久久精品国产第一区二区三区| 石原莉奈在线亚洲二区| 男女激情视频一区| 精品无人区卡一卡二卡三乱码免费卡| 青青草97国产精品免费观看 | 国产精品毛片无遮挡高清| 欧美一区二区三区四区久久| 一本一道综合狠狠老| 欧美性猛交xxxxxx富婆| 欧美日韩国产高清一区二区| 91精品国产高清一区二区三区 | 欧美一区二区三区四区视频| 日韩欧美国产高清| 国产欧美日韩一区二区三区在线观看| 国产精品色在线观看| 亚洲欧洲美洲综合色网| 亚洲午夜一二三区视频| 美女久久久精品| 成人丝袜视频网| 色国产综合视频| 91精品国产乱| 欧美极品美女视频| 亚洲国产成人av网| 狠狠色丁香久久婷婷综合_中| 懂色一区二区三区免费观看| 91免费国产在线观看| 日韩一区二区中文字幕| 久久精品一区四区| 亚洲美女电影在线| 美女一区二区三区在线观看| 国产999精品久久| 欧美日本视频在线| 亚洲国产精品精华液ab| 五月婷婷激情综合网| 国产高清精品在线| 欧美日韩国产123区| 国产精品毛片高清在线完整版 | 欧美日韩一区二区三区在线看| 日韩一区二区视频在线观看| 久久天天做天天爱综合色| 亚洲精品老司机| 国产一区二区精品久久| 欧美视频在线一区二区三区| 久久无码av三级|