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

59 lines
1.7 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#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);
#ifdef _SCAN_OLD_CODES_
// 方式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);
// 方式3暂未启用bwp提供
static double erf_new(double x);
#endif
// 方式4:20260610 针对H变井储再次进行研究攻关
// 解决Matlab的erfcx函数进行实现
// 只有H变井储使用
static double erfc_x(double x);
public:
// 方式1涉及参数
static const int len_cof_1 = 6;
static const double cof_arr_1[6];
#ifdef _SCAN_OLD_CODES_
// 方式2涉及参数
static const int len_cof_2 = 28;
static const double cof_arr_2[28];
#endif
};