修改辛普森积分算法实现报错
This commit is contained in:
parent
db797522e8
commit
292289a9fb
|
|
@ -1,13 +1,14 @@
|
|||
#ifndef ADAPTIVESIMPSONINTEGRATE_H
|
||||
#ifndef ADAPTIVESIMPSONINTEGRATE_H
|
||||
#define ADAPTIVESIMPSONINTEGRATE_H
|
||||
|
||||
namespace AdaptiveSimpsonIntegrate {
|
||||
|
||||
#include <armadillo>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#include <iomanip> // 用于格式化输出
|
||||
|
||||
|
||||
namespace AdaptiveSimpsonIntegrate {
|
||||
|
||||
// 定义被积函数:y = A*exp(-(x-P)²/(2*delt²)) + H/(1+exp((x-P)/W)) + C
|
||||
struct FitFunction {
|
||||
// 拟合公式的参数
|
||||
|
|
@ -55,7 +56,7 @@ double adaptive_simpson(double a, double b, double eps, const Func& f,
|
|||
double right = simpson(c, b, f);
|
||||
|
||||
// 精度判断:满足则返回,不满足则递归细分
|
||||
if (::std::abs(left + right - whole) <= 15 * eps) {
|
||||
if (std::abs(left + right - whole) <= 15 * eps) {
|
||||
return left + right + (left + right - whole) / 15.0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,11 @@
|
|||
<string>道址数</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>数据模式</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>硬件增益</string>
|
||||
|
|
@ -120,7 +125,32 @@
|
|||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>最大能量范围</string>
|
||||
<string>成形时间</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>快通道触发阈值</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>CR微分模式</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>新建列</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>新建列</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>输入信号正负极性选择</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user