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.
nmWTAI-Platform/Include/mAlg/mAlgDefines/iErfcUtils.h

50 lines
1.5 KiB
C

#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];
};