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.
nmWATI/Include/iAlg/iAlgMath/zxBessel.h

107 lines
2.7 KiB
C++

#pragma once
#include "math.h"
#include "zxHugeNum.h"
// 贝塞尔函数
class I_ALGMATH_EXPORT zxBessel
{
public:
zxBessel();
~zxBessel();
public:
// 贝塞尔函数(基础函数部分)
bool besselI0(double x, double &b);
double getbesselI0(double x);
bool besselI1(double x, double &b);
double getbesselI1(double x);
bool besselK0(double x, double &b);
double getbesselK0(double x);
bool besselK1(double x ,double &b);
double getbesselK1(double x);
// 贝塞尔函数(组合模式)
// K1/I1
bool besselK1I1(double x, double &b);
// K0/I0
bool besselK0I0(double x, double &b);
// I0/I1
bool besselI0I1(double x, double &b);
// I0(x)/I1(y)
bool besselI0I1(double x, double y, double &b);
// I0(x)/I0(y)
bool besselI0I0(double x, double y, double &b);
// I1(x)/I1(y)
bool besselI1I1(double x, double y, double &b);
// K1(x)/I1(y)
bool besselK1I1(double x, double y, double &b);
// K1(x)/I0(y)
bool besselK1I0(double x, double y, double &b);
// K0(x)/I0(y)
bool besselK0I0(double x, double y, double &b);
// (I0(x)/I1(x))/(I0(y)/I1(y))
bool besselI0I1I0I1(double x, double y, double &b);
// (K0(x)/I0(x))/(K1(y)/I1(y))
bool besselK0I0K1I1(double x, double y, double &b);
// 大数模式
zxHugeNum besselI(int which, double x);
zxHugeNum besselK(int which, double x);
public:
////////////////////////////////////////////////////////////////
// 由于单个的超过数值范围,故一起在内部进行处理
// 仅仅测试
//double calDemoA(double d1, double d2);
//double calDemoB(double d1, double d2);
zxHugeNum besselDivide(bool byK1, int which1, double x1, \
bool byK2, int which2, double x2, \
bool* pOk = NULL);
zxHugeNum besselMultiple(bool byK1, int which1, double x1, \
bool byK2, int which2, double x2, \
bool* pOk = NULL);
protected:
zxHugeNum besselDivMul(bool bDivide, \
bool byK1, int which1, double x1, \
bool byK2, int which2, double x2, \
bool* pOk = NULL);
double _besselByY(double y, bool bK, int which, bool bLower);
public:
void setComMode(bool b) { m_bComMode = b; }
bool isComMode() { return m_bComMode; }
double getResultI() { return m_dIndex; }
double getResultM() { return m_dMultipler; }
private:
bool m_bComMode; //对于大数,采取复合模式
double m_dIndex; //exp的次数
double m_dMultipler; //乘数,合起来是 exp(m_dIndex) * m_dMultipler;
////////////////////////////////////////////////////////////////
};