• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆-48  評論-259  文章-1  trackbacks-0

            #include"iostream.h"
            #include"math.h"

            double f(double x)
            {
               return pow(x,3.0/2.0);
            }
            double T(double n,double a,double b)
            {
              double sum=0;
              for(int i=0;2*i+1<=n;i++)
              {
                sum+=f(a+double(2*i+1)/n);
              }
              if(n==1) return 0.5*(f(a)+f(b));
              return 0.5*T(n/2,a,b)+sum*(1.0/n);
            }
            void Romberg(double a,double b,double e)
            {
              double Old[10]={0.0},New[10]={0.0};
              double h=b-a;
              New[0]=h*(f(a)+f(b))/2.0;
              int j;
              for(int i=1;;i++)
              {
                for(j=0;j<i;j++) Old[j]=New[j];
             New[0]=T(pow(2,i),a,b);
             for(j=1;j<=i;j++)
              New[j]=(pow(4,j)*New[j-1]/(pow(4,j)-1)-Old[j-1]/(pow(4,j)-1));
             if(fabs(New[i]-Old[i-1])<e) break;
              }
              cout<<New[i];
            }

            void main()
            {
              double a,b; 
              double e;
              cout<<"請輸入積分的下、上限:";
              cin>>a>>b;
              cout<<"輸入你要的精度:";
              cin>>e;
              Romberg(a,b,e);
            }


            評論:
            # re: 數(shù)值分析--龍貝格算法 2007-06-11 15:30 | 農(nóng)夫
            怎么用的啊?  回復(fù)  更多評論
              
            # re: 數(shù)值分析--龍貝格算法 2007-06-11 20:53 | 星夢情緣
            double f(double x)
            {
            return pow(x,3.0/2.0);
            }

            你把這里的函數(shù)改成你要的函數(shù)就可以了用了的  回復(fù)  更多評論
              
            # re: 數(shù)值分析--龍貝格算法 2007-06-20 23:39 |
            有關(guān)于反冪法計算矩陣特征值的程序嗎  回復(fù)  更多評論
              
            # re: 數(shù)值分析--龍貝格算法 2010-05-12 21:23 | S
            對 函數(shù)的 調(diào)用不明確····  回復(fù)  更多評論
              
            # re: 數(shù)值分析--龍貝格算法 2010-05-12 21:24 | S
            k:\jisuan\longbeigea\longbeigea\longbeigea.cpp(34) : error C2668: “pow”: 對重載函數(shù)的調(diào)用不明確
            1> d:\軟件程序\vc++8.0\vc\include\math.h(575): 可能是“l(fā)ong double pow(long double,int)”
            1> d:\軟件程序\vc++8.0\vc\include\math.h(527): 或 “float pow(float,int)”
            1> d:\軟件程序\vc++8.0\vc\include\math.h(489): 或 “double pow(double,int)”
            1> 試圖匹配參數(shù)列表“(int, int)”時
            1>k:\jisuan\longbeigea\longbeigea\longbeigea.cpp(36) : error C2668: “pow”: 對重載函數(shù)的調(diào)用不明確
            1> d:\軟件程序\vc++8.0\vc\include\math.h(575): 可能是“l(fā)ong double pow(long double,int)”
            1> d:\軟件程序\vc++8.0\vc\include\math.h(527): 或 “float pow(float,int)”
            1> d:\軟件程序\vc++8.0\vc\include\math.h(489): 或 “double pow(double,int)”
            1> 試圖匹配參數(shù)列表“(int, int)”時
            1>k:\jisuan\longbeigea\longbeigea\longbeigea.cpp(36) : error C2668: “pow”: 對重載函數(shù)的調(diào)用不明確
            1> d:\軟件程序\vc++8.0\vc\include\math.h(575): 可能是“l(fā)ong double pow(long double,int)”
            1> d:\軟件程序\vc++8.0\vc\include\math.h(527): 或 “float pow(float,int)”
            1> d:\軟件程序\vc++8.0\vc\include\math.h(489): 或 “double pow(double,int)”
            1> 試圖匹配參數(shù)列表“(int, int)”時
            1>k:\jisuan\longbeigea\longbeigea\longbeigea.cpp(36) : error C2668: “pow”: 對重載函數(shù)的調(diào)用不明確
            1> d:\軟件程序\vc++8.0\vc\include\math.h(575): 可能是“l(fā)ong double pow(long double,int)”
            1> d:\軟件程序\vc++8.0\vc\include\math.h(527): 或 “float pow(float,int)”
            1> d:\軟件程序\vc++8.0\vc\include\math.h(489): 或 “double pow(double,int)”
            1> 試圖匹配參數(shù)列表“(int, int)”時
            1>生成日志保存在“file://k:\jisuan\longbeigea\longbeigea\Debug\BuildLog.htm”
            1>longbeigea - 4 個錯誤,0 個警告
            ========== 生成: 成功 0 個,失敗 1 個,最新 0 個,跳過 0 個 ==========
              回復(fù)  更多評論
              
            # re: 數(shù)值分析--龍貝格算法[未登錄] 2011-04-20 19:58 | C++愛好者
            太謝謝你的這段龍貝格積分的程序,很贊!謝謝!  回復(fù)  更多評論
              
            亚洲乱码中文字幕久久孕妇黑人| 久久精品人妻一区二区三区| 久久天天躁夜夜躁狠狠躁2022 | 色欲av伊人久久大香线蕉影院| 中文字幕热久久久久久久| 久久精品人人做人人爽电影蜜月| 久久精品中文字幕久久| 狠狠色丁香婷婷久久综合| 色欲久久久天天天综合网| 国产精品久久久久一区二区三区 | 久久精品不卡| 性欧美丰满熟妇XXXX性久久久| 色综合久久久久| 午夜天堂精品久久久久| 久久精品无码av| A狠狠久久蜜臀婷色中文网| 无码任你躁久久久久久| 久久久久亚洲Av无码专| 久久精品免费网站网| 久久精品一区二区三区不卡| 2021国产精品午夜久久| 久久精品国产亚洲αv忘忧草| 2021国内久久精品| 狠狠色伊人久久精品综合网 | 久久妇女高潮几次MBA| 91麻豆精品国产91久久久久久| 无码AV中文字幕久久专区| 热久久国产欧美一区二区精品| 久久精品成人欧美大片| 9999国产精品欧美久久久久久| 2021久久精品国产99国产精品| 久久久av波多野一区二区| 久久精品国产亚洲AV久| 久久SE精品一区二区| 一本一本久久a久久综合精品蜜桃| 人妻少妇精品久久| 久久久WWW成人| 久久久久久A亚洲欧洲AV冫| 久久天天躁狠狠躁夜夜2020| 久久久久国产精品三级网 | 亚洲熟妇无码另类久久久|