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

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

?? mandel.cpp

?? VC環境下的實用的復數庫函數,編譯后可作為庫函數使用.
?? CPP
字號:
#define WANT_MATH
#define WANT_STREAM

#include "include.h"
#include "array1.h"
#include "cx.h"

//  Consider the sequence of complex numbers
//     z[0] =0; z[n+1] = z[n] ** 2 + c
//  where ** denotes exponentiation (i.e. square in this case).
//
//  The Mandelbrot set, M, is the set of values of c for which this sequence
//  remains bounded as n tends to infinity.
//
//  This program calculates the set, Z, of values of c for which z[n] = 0
//  for some n > 0.
//
//  Of course, Z is a subset of M. It follows from Montel's theorem in
//  complex analysis that the boundary of M is contained in the closure
//  of Z.
//
//  So if we calculate the points of Z we get an outline of M.
//
//  We can search for the values of Z using contour integration. Think of
//  z[n] as function of c and contour integrate d[n] = z[n]' / z[n]
//  around a square. Here ' denotes derivative wrt c.
//  If there are any zeros of z[n] in the square then the imaginary part of
//  integral will have a positive value depending on the number of zeros;
//  otherwise it will be zero.
//
//  The program uses gaussian integration to evaluate the integral numerically.
//  It uses an iterative scheme to work through values of n and a recursive
//  scheme to search for the zeros.
//
//  Start with a square covering the area we are interested in.
//  If the contour integration program finds it contains a zero divide
//  the square into 4 squares by dividing the horizontal and vertical
//  sides in half. Search each of these squares for zeros. Continue the
//  process until the zeros have been located with the desired accuracy.




#ifdef use_namespace
using namespace RBD_COMMON;             // needed for VC++
using namespace RBD_COMPLEX;
#endif

class SearchClass
{
   int maxit;                    // maximum number of iterations
   Real limit;                   // minimum for deciding a point is a "zero"
   const array1<Real>& gauss;    // integration points
   const array1<Real>& weight;   // integration weights
   int gs;                       // number of integration points
   int g4;                       // gs * 4
   array1<CX> C;                 // for integrating around square
   array1<CX> W;
   array1<CX> Z;
   array1<CX> D;
   array1<bool> skip;
public:
   SearchClass(int mi, Real li, const array1<Real>& g, const array1<Real>& w);
   void IntegrationPoints(CX centre, Real delta);
   int IntegrateSquare(Real delta);
   int Search(CX centre, Real delta, int depth);
};


void GaussianIntegration(array1<Real>& G, array1<Real>& W);


int my_main()
{
   int n = 16;                  // order of integration (16, 8, 4 or 2)
   CX centre(0,0);              // centre of square to be examined
   Real delta = 2.0;            // distance of side of square from centre
   int depth = 9;               // number of binary divisions of side of square
   int maxit = 1000;            // maximum number of iterations

//   int n = 16;
//   CX centre(-0.74916,0.06648);
//   Real delta = 0.00004;
//   int depth = 8;
//   int maxit = 10000;

   array1<Real> G(n);           // these will contain the gaussian integration
   array1<Real> W(n);           // parameters - n will set the number of values.

   GaussianIntegration(G, W);   // get Gaussian integration parameters and load
                                // them into G and W.

   SearchClass sc(maxit, 0.2, G, W); // a class that organises the search

   int s = sc.Search(centre, delta, depth); // search our initial square

   cout << "Number of points = " << s << endl;

   return 0;
}

SearchClass::SearchClass(int mi, Real li, const array1<Real>& g,
   const array1<Real>& w)
      : maxit(mi), limit(li), gauss(g), weight(w)
{
   gs = gauss.size(); g4 = 4 * gs;
   C.resize(g4); W.resize(g4); Z.resize(g4); D.resize(g4); skip.resize(g4);
}


// Setup the integration points and their weights for the square defined
// by centre and delta

void SearchClass::IntegrationPoints(CX centre, Real delta)
{
   int i; int j = 0;
   Imag i_delta = _I_ * delta; CX mid = centre + delta;
   for (i = 0; i < gs; i++)
      { W(j) = weight(i) * i_delta;   C(j) = mid + gauss(i) * i_delta; ++j; }
   mid = centre + i_delta;
   for (i = 0; i < gs; i++)
      { W(j) = - weight(i) * delta;   C(j) = mid - gauss(i) * delta;   ++j; }
   mid = centre - delta;
   for (i = 0; i < gs; i++)
      { W(j) = - weight(i) * i_delta; C(j) = mid - gauss(i) * i_delta; ++j; }
   mid = centre - i_delta;
   for (i = 0; i < gs; i++)
      { W(j) = weight(i) * delta;     C(j) = mid + gauss(i) * delta;   ++j; }
}

// do the integration around the square for each n

int SearchClass::IntegrateSquare(Real delta)
{
   Z = CX(0.0); D = CX(0.0); skip = false;    // set all elements of an array

   for (int n = 1; n <= maxit; n++)
   {
      Real sum = 0.0; bool converge = true;
      CX* z = Z.data(); CX* d = D.data(); CX* c = C.data(); CX* w = W.data();
      bool* s = skip.data();
      for (int j = 0; j < g4; j++)
      {
         if (!*s)
         {
            CX z_next = square(*z) + *c;  *z = z_next;
            if (z_next == 0) return n;  // we have hit an exact zero
            *d *= 2.0;
            CX e = (1.0 - *d * *c) / z_next;
            *d += e;                    // the new value of d
            sum += imag(*w * e);        // integration of imaginary part
                                        // we need do only e since we have
                                        // already shown that the integral of
                                        // the previous d is zero
            Real nz = norm1(z_next);
            if (nz < 4 || delta * ( 1.0 + norm1(*d) ) > 0.0001 * nz)
               converge = false;
            else *s = true;             // this term can't contribute
                                        // significantly in the future
         }
         ++z; ++d; ++c; ++w; ++s;
      }
      if (sum / pi_times_2 > limit) return n;  // have found a zero
      if (converge) return 0;           // no term can contribute in the future
   }

   return -1;                           // exit on iteration limit
                                        // usually means that our square
                                        // is completely in the interior
}

// the recursive search

int SearchClass::Search(CX centre, Real delta, int depth)
{
   IntegrationPoints(centre, delta); int n = IntegrateSquare(delta);
   if (n > 0)
   {
      if (depth > 0)
      {
         Real d2 = delta / 2.0; Imag d2i = d2 * _I_; int k = 0;
         k += Search(centre-d2-d2i, d2, depth-1);
         k += Search(centre-d2+d2i, d2, depth-1);
         k += Search(centre+d2-d2i, d2, depth-1);
         k += Search(centre+d2+d2i, d2, depth-1);
         return k;
      }
      else
      {
         // print coordinates of centre of square and iteration number
         cout << setw(20) << setprecision(15) << centre.real() << " "
              << setw(20) << setprecision(15) << centre.imag() << " "
              << setw(10) << n << endl;
         return 1;
      }
   }
   else return 0;
}

// load the integration parameters into G and W

void GaussianIntegration(array1<Real>& G, array1<Real>& W)
{
   switch (G.size())
   {
   case 16:

      G(8)  = 0.095012509837637;  G(7) = -G(8);
      G(9)  = 0.281603550779259;  G(6) = -G(9);
      G(10) = 0.458016777657227;  G(5) = -G(10);
      G(11) = 0.617876244402644;  G(4) = -G(11);
      G(12) = 0.755404408355003;  G(3) = -G(12);
      G(13) = 0.865631202387832;  G(2) = -G(13);
      G(14) = 0.944575023073233;  G(1) = -G(14);
      G(15) = 0.989400934991650;  G(0) = -G(15);

      W(8)  = 0.189450610455068;  W(7) = W(8);
      W(9)  = 0.182603415044924;  W(6) = W(9);
      W(10) = 0.169156519395003;  W(5) = W(10);
      W(11) = 0.149595988816577;  W(4) = W(11);
      W(12) = 0.124628971255534;  W(3) = W(12);
      W(13) = 0.095158511682493;  W(2) = W(13);
      W(14) = 0.062253523938648;  W(1) = W(14);
      W(15) = 0.027152459411754;  W(0) = W(15);

      break;

   case 8:

      G(4) = 0.183434642495650;  G(3) = -G(4);
      G(5) = 0.525532409916329;  G(2) = -G(5);
      G(6) = 0.796666477413627;  G(1) = -G(6);
      G(7) = 0.960289856497536;  G(0) = -G(7);

      W(4) = 0.362683783378362;  W(3) = W(4);
      W(5) = 0.313706645877887;  W(2) = W(5);
      W(6) = 0.222381034453374;  W(1) = W(6);
      W(7) = 0.101228536290376;  W(0) = W(7);

      break;

   case 4:

      G(2) = 0.339981043584856;  G(1) = -G(2);
      G(3) = 0.861136311594053;  G(0) = -G(3);

      W(2) = 0.652145154862546;  W(1) = W(2);
      W(3) = 0.347854845137454;  W(0) = W(3);

      break;

   case 2:

      G(1) = 0.577350269189626;  G(0) = -G(1);

      W(1) = 1.0; W(0) = 1.0;

      break;

   default: cout << "invalid parameter" << endl; exit(1);

   }
}

// call my_main() - use this to catch exceptions
// use macros for exception names for compatibility with simulated exceptions
int main()
{
   Tracer tr("main ");
   Try  { return my_main(); }
   Catch(BaseException) { cout << BaseException::what() << "\n"; }
   CatchAll { cout << "\nProgram fails - exception generated\n\n"; }
   return 0;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人激情黄色小说| 欧美电影精品一区二区| 欧美伦理影视网| 欧美激情综合五月色丁香小说| 一区二区高清免费观看影视大全 | 欧美一区二区三区免费| 国产精品妹子av| 久久99国产精品免费| 欧美调教femdomvk| 亚洲人被黑人高潮完整版| 精品一区二区三区的国产在线播放| av电影在线观看一区| 精品处破学生在线二十三| 午夜成人免费视频| 日本高清视频一区二区| 中文字幕欧美激情| 国产在线播放一区| 欧美一区二区三区精品| 亚洲一区二区在线免费看| 成人avav在线| 国产午夜精品在线观看| 久久精品国产网站| 7777精品伊人久久久大香线蕉超级流畅 | 久久久亚洲综合| 日本vs亚洲vs韩国一区三区二区| 色综合久久久久综合| 中文字幕日韩精品一区| 国产不卡视频一区| 久久精品人人做人人综合| 精品一区二区成人精品| 欧美福利视频一区| 日韩电影在线免费| 91精品国产欧美一区二区| 日韩精品一二三区| 8v天堂国产在线一区二区| 视频精品一区二区| 日韩午夜小视频| 国产精品自拍毛片| 中文字幕乱码亚洲精品一区| 国产1区2区3区精品美女| 久久久精品欧美丰满| 成人av网站大全| 亚洲人亚洲人成电影网站色| 99视频在线观看一区三区| 亚洲色图欧洲色图婷婷| 欧美午夜不卡视频| 免费不卡在线观看| 久久这里只有精品6| 国产精品一区二区久激情瑜伽| 久久先锋影音av鲁色资源网| 国产精品91一区二区| 亚洲视频1区2区| 欧美日韩国产精选| 精品中文字幕一区二区小辣椒 | 国产在线精品免费av| 日本一区二区三区久久久久久久久不| 成人性生交大合| 亚洲免费观看高清完整版在线观看熊| 欧美在线|欧美| 久久精品国产久精国产| 国产精品欧美经典| 欧美日韩精品一区二区三区| 国产曰批免费观看久久久| 亚洲欧洲韩国日本视频| 欧美无砖专区一中文字| 国产一区欧美一区| 夜夜精品浪潮av一区二区三区| 91精品国产品国语在线不卡| 粉嫩一区二区三区性色av| 亚洲已满18点击进入久久| 日韩美女视频一区二区在线观看| 成人黄色免费短视频| 日本亚洲电影天堂| 亚洲视频一区在线| 欧美r级电影在线观看| av一区二区三区| 九九精品一区二区| 亚洲无线码一区二区三区| 久久精品人人做人人综合| 欧美美女bb生活片| 91免费视频观看| 经典三级视频一区| 日韩精品一级二级| 一区二区三区日本| 国产精品国产三级国产专播品爱网| 欧美久久婷婷综合色| aaa欧美日韩| 国产乱理伦片在线观看夜一区| 五月天一区二区三区| 亚洲丝袜美腿综合| 欧美精品一区二区三区视频| 欧美蜜桃一区二区三区| 一本一道久久a久久精品综合蜜臀| 九九视频精品免费| 奇米色777欧美一区二区| 亚洲午夜国产一区99re久久| 亚洲色图另类专区| 中文字幕人成不卡一区| 久久青草欧美一区二区三区| 91精品国产一区二区三区蜜臀 | 日韩精品一区二区三区视频 | 91蝌蚪porny| 成人av免费在线播放| 成人网男人的天堂| 国产一区二区福利| 久久国产剧场电影| 麻豆国产精品视频| 美女久久久精品| 麻豆高清免费国产一区| 亚洲va天堂va国产va久| 亚洲一区在线观看免费| 亚洲一区二区不卡免费| 亚洲免费观看高清完整版在线| 国产精品久久久久9999吃药| 国产女人18水真多18精品一级做| 久久综合色天天久久综合图片| 91精品国产一区二区| 日韩一区二区三区电影| 日韩一区二区在线免费观看| 91精品国产91综合久久蜜臀| 制服丝袜国产精品| 欧美一区二区播放| 日韩欧美二区三区| 国产午夜亚洲精品理论片色戒| 久久九九久久九九| 国产精品电影院| 一区二区在线免费观看| 亚洲一二三四区不卡| 亚洲成年人影院| 美国十次综合导航| 高清不卡在线观看av| 波多野结衣91| 精品污污网站免费看| 欧美一级一级性生活免费录像| 91精品国产丝袜白色高跟鞋| 精品国产网站在线观看| 国产色产综合产在线视频| 国产精品乱码一区二区三区软件| **欧美大码日韩| 五月开心婷婷久久| 国产激情精品久久久第一区二区 | 欧美大片免费久久精品三p| 久久免费午夜影院| 亚洲欧美日韩国产手机在线| 日日夜夜免费精品| 国产福利一区在线| 欧美午夜精品一区二区蜜桃| 精品国产乱码久久久久久久久| 国产精品免费看片| 亚洲高清免费一级二级三级| 久久国产精品区| 色综合视频一区二区三区高清| 欧美精品久久久久久久多人混战| 精品国产1区二区| 亚洲黄色片在线观看| 精品在线视频一区| 欧美体内she精高潮| 2020国产成人综合网| 一区二区三区四区av| 韩国一区二区在线观看| 91麻豆国产精品久久| 精品日本一线二线三线不卡| 亚洲欧美国产高清| 久久99国产精品麻豆| 欧美性一级生活| 精品国产乱码久久久久久图片| 中文字幕人成不卡一区| 美女脱光内衣内裤视频久久影院| 99久久夜色精品国产网站| 91精品国产美女浴室洗澡无遮挡| 国产精品乱码妇女bbbb| 日本免费在线视频不卡一不卡二| 成人app下载| 日韩欧美国产三级| 亚洲一区电影777| 99在线精品观看| 国产精品青草久久| 精品一区二区三区在线观看国产| 91国内精品野花午夜精品| 国产亚洲综合在线| 久久国内精品自在自线400部| 欧美喷水一区二区| 麻豆91在线观看| 91精品国产麻豆国产自产在线| 樱桃国产成人精品视频| av资源站一区| 国产精品色噜噜| 国产一区二区在线视频| 精品三级av在线| 免费观看91视频大全| 欧美日韩卡一卡二| 亚洲bt欧美bt精品777| 在线观看国产日韩| 亚洲欧美日韩中文字幕一区二区三区 | 亚洲成a人片在线观看中文| 91麻豆国产福利精品| 亚洲欧美一区二区三区孕妇| av电影一区二区| 亚洲欧洲精品成人久久奇米网| 成人精品视频一区二区三区尤物|