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/iAlg/iAlgMath/zxBesselInstance.h

61 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 "iAlgMath_global.h"
class zxBessel;
// 本类的目的通过单例实现对XML文件解析之后的存储
class I_ALGMATH_EXPORT zxBesselInstance
{
public:
// 获取对象,单例模式
static zxBesselInstance* getInstance();
// 关闭消耗
static void release();
private:
zxBesselInstance();
~zxBesselInstance();
public:
// 为了方便与MATLAB的统一再次封装
// which 为0或1分别对应I0I1K0K1
double besselk(int which, double x, bool* pOk = nullptr);
double besseli(int which, double x, bool* pOk = nullptr);
// 20220717 baiwp去除积分改用直接计算的方式伪积分
double besselk0_pseu(double x, bool* pOk = nullptr);
// 返回对象体
zxBessel* getBessel();
private:
static zxBesselInstance* _instance;
zxBessel* m_pBessel;
};
#define _bslHelper zxBesselInstance::getInstance()
#define _getBessel zxBesselInstance::getInstance()->getBessel
#define _besselk zxBesselInstance::getInstance()->besselk
#define _besseli zxBesselInstance::getInstance()->besseli
#define _besselI0 zxBesselInstance::getInstance()->getBessel()->besselI0
#define _besselI1 zxBesselInstance::getInstance()->getBessel()->besselI1
#define _besselK0 zxBesselInstance::getInstance()->getBessel()->besselK0
#define _besselK1 zxBesselInstance::getInstance()->getBessel()->besselK1
#define _getbesselI0 zxBesselInstance::getInstance()->getBessel()->getbesselI0
#define _getbesselI1 zxBesselInstance::getInstance()->getBessel()->getbesselI1
#define _getbesselK0 zxBesselInstance::getInstance()->getBessel()->getbesselK0
#define _getbesselK1 zxBesselInstance::getInstance()->getBessel()->getbesselK1
#define _besselk0_pseu zxBesselInstance::getInstance()->besselk0_pseu