You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include "Defines.h"
|
|
|
|
|
|
#include "mAlgDefines_global.h"
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
// TODO 20210530 误差函数
|
|
|
|
|
|
// vs 2012(c++11)以上版本已经支持erfc函数
|
|
|
|
|
|
// 但 vs2010暂时无法使用,只得折中方案
|
|
|
|
|
|
// 误差函数实现类库
|
|
|
|
|
|
class M_ALG_DEFINES_EXPORT iErfcUtils
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
iErfcUtils();
|
|
|
|
|
|
~iErfcUtils();
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
// 方式1:内部编写,试井处理过程中用的基本都是本函数
|
|
|
|
|
|
static double errorf(double x);
|
|
|
|
|
|
|
|
|
|
|
|
// 方式2:源自The Art of Scientific Computing第二版、第三版pdf无水印高清版及相应源代码
|
|
|
|
|
|
// 参考:https://blog.csdn.net/xingdu_/article/details/106869318
|
|
|
|
|
|
// 致谢原作者
|
|
|
|
|
|
// 本算法,目前只在 Hegeman 井储计算应用
|
|
|
|
|
|
static double erfc_a(double x);
|
|
|
|
|
|
static double _erfc_a(double z);
|
|
|
|
|
|
|
|
|
|
|
|
// 注:由于H变井储一直有问题,所以2025-11-18再次进行更改,代码提供者 Xiehang
|
|
|
|
|
|
// 此处,仅仅是测试新的误差函数,在H变井储中是否起作用,为了不影响其它,并未全局替换该误差函数
|
|
|
|
|
|
static double erfc_b(double x);
|
|
|
|
|
|
static double _erfc_b(double z);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef _SCAN_OLD_CODES_
|
|
|
|
|
|
// 方式3,暂未启用(新,bwp提供)
|
|
|
|
|
|
static double erf_new(double x);
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
// 方式1:涉及参数
|
|
|
|
|
|
static const int len_cof_1 = 28;
|
|
|
|
|
|
static const double cof_arr_1[28];
|
|
|
|
|
|
|
|
|
|
|
|
// 方式2:涉及参数
|
|
|
|
|
|
static const int len_cof_2 = 6;
|
|
|
|
|
|
static const double cof_arr_2[6];
|
|
|
|
|
|
};
|