Boost C++ 库

...世界上最受推崇和专业设计的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu,《C++ 编码标准

PrevUpHomeNext

TR1 C 函数快速参考

支持的 TR1 函数
namespace boost{ namespace math{ namespace tr1{ extern "C"{

// [5.2.1.1] associated Laguerre polynomials:
double assoc_laguerre(unsigned n, unsigned m, double x);
float assoc_laguerref(unsigned n, unsigned m, float x);
long double assoc_laguerrel(unsigned n, unsigned m, long double x);

// [5.2.1.2] associated Legendre functions:
double assoc_legendre(unsigned l, unsigned m, double x);
float assoc_legendref(unsigned l, unsigned m, float x);
long double assoc_legendrel(unsigned l, unsigned m, long double x);

// [5.2.1.3] beta function:
double beta(double x, double y);
float betaf(float x, float y);
long double betal(long double x, long double y);

// [5.2.1.4] (complete) elliptic integral of the first kind:
double comp_ellint_1(double k);
float comp_ellint_1f(float k);
long double comp_ellint_1l(long double k);

// [5.2.1.5] (complete) elliptic integral of the second kind:
double comp_ellint_2(double k);
float comp_ellint_2f(float k);
long double comp_ellint_2l(long double k);

// [5.2.1.6] (complete) elliptic integral of the third kind:
double comp_ellint_3(double k, double nu);
float comp_ellint_3f(float k, float nu);
long double comp_ellint_3l(long double k, long double nu);

// [5.2.1.8] regular modified cylindrical Bessel functions:
double cyl_bessel_i(double nu, double x);
float cyl_bessel_if(float nu, float x);
long double cyl_bessel_il(long double nu, long double x);

// [5.2.1.9] cylindrical Bessel functions (of the first kind):
double cyl_bessel_j(double nu, double x);
float cyl_bessel_jf(float nu, float x);
long double cyl_bessel_jl(long double nu, long double x);

// [5.2.1.10] irregular modified cylindrical Bessel functions:
double cyl_bessel_k(double nu, double x);
float cyl_bessel_kf(float nu, float x);
long double cyl_bessel_kl(long double nu, long double x);

// [5.2.1.11] cylindrical Neumann functions;
// cylindrical Bessel functions (of the second kind):
double cyl_neumann(double nu, double x);
float cyl_neumannf(float nu, float x);
long double cyl_neumannl(long double nu, long double x);

// [5.2.1.12] (incomplete) elliptic integral of the first kind:
double ellint_1(double k, double phi);
float ellint_1f(float k, float phi);
long double ellint_1l(long double k, long double phi);

// [5.2.1.13] (incomplete) elliptic integral of the second kind:
double ellint_2(double k, double phi);
float ellint_2f(float k, float phi);
long double ellint_2l(long double k, long double phi);

// [5.2.1.14] (incomplete) elliptic integral of the third kind:
double ellint_3(double k, double nu, double phi);
float ellint_3f(float k, float nu, float phi);
long double ellint_3l(long double k, long double nu, long double phi);

// [5.2.1.15] exponential integral:
double expint(double x);
float expintf(float x);
long double expintl(long double x);

// [5.2.1.16] Hermite polynomials:
double hermite(unsigned n, double x);
float hermitef(unsigned n, float x);
long double hermitel(unsigned n, long double x);

// [5.2.1.18] Laguerre polynomials:
double laguerre(unsigned n, double x);
float laguerref(unsigned n, float x);
long double laguerrel(unsigned n, long double x);

// [5.2.1.19] Legendre polynomials:
double legendre(unsigned l, double x);
float legendref(unsigned l, float x);
long double legendrel(unsigned l, long double x);

// [5.2.1.20] Riemann zeta function:
double riemann_zeta(double);
float riemann_zetaf(float);
long double riemann_zetal(long double);

// [5.2.1.21] spherical Bessel functions (of the first kind):
double sph_bessel(unsigned n, double x);
float sph_besself(unsigned n, float x);
long double sph_bessell(unsigned n, long double x);

// [5.2.1.22] spherical associated Legendre functions:
double sph_legendre(unsigned l, unsigned m, double theta);
float sph_legendref(unsigned l, unsigned m, float theta);
long double sph_legendrel(unsigned l, unsigned m, long double theta);

// [5.2.1.23] spherical Neumann functions;
// spherical Bessel functions (of the second kind):
double sph_neumann(unsigned n, double x);
float sph_neumannf(unsigned n, float x);
long double sph_neumannl(unsigned n, long double x);

}}}} // namespaces

此外,还提供了上述函数的 double 版本的足够多的额外重载,以便支持使用 floatdoublelong double整数 参数的任意组合调用函数,返回类型由 结果类型计算规则 确定。

例如

expintf(2.0f);  // float version, returns float.
expint(2.0f);   // also calls the float version and returns float.
expint(2.0);    // double version, returns double.
expintl(2.0L);  // long double version, returns a long double.
expint(2.0L);   // also calls the long double version.
expint(2);      // integer argument is treated as a double, returns double.
快速参考
// [5.2.1.1] associated Laguerre polynomials:
double assoc_laguerre(unsigned n, unsigned m, double x);
float assoc_laguerref(unsigned n, unsigned m, float x);
long double assoc_laguerrel(unsigned n, unsigned m, long double x);

assoc_laguerre 函数返回

另请参阅 laguerre 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.2] associated Legendre functions:
double assoc_legendre(unsigned l, unsigned m, double x);
float assoc_legendref(unsigned l, unsigned m, float x);
long double assoc_legendrel(unsigned l, unsigned m, long double x);

assoc_legendre 函数返回

另请参阅 legendre_p 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.3] beta function:
double beta(double x, double y);
float betaf(float x, float y);
long double betal(long double x, long double y);

返回 x 和 y 的 beta 函数

另请参阅 beta 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.4] (complete) elliptic integral of the first kind:
double comp_ellint_1(double k);
float comp_ellint_1f(float k);
long double comp_ellint_1l(long double k);

返回 k 的第一类完全椭圆积分

另请参阅 ellint_1 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.5] (complete) elliptic integral of the second kind:
double comp_ellint_2(double k);
float comp_ellint_2f(float k);
long double comp_ellint_2l(long double k);

返回 k 的第二类完全椭圆积分

另请参阅 ellint_2 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.6] (complete) elliptic integral of the third kind:
double comp_ellint_3(double k, double nu);
float comp_ellint_3f(float k, float nu);
long double comp_ellint_3l(long double k, long double nu);

返回 k 和 nu 的第三类完全椭圆积分

另请参阅 ellint_3 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.8] regular modified cylindrical Bessel functions:
double cyl_bessel_i(double nu, double x);
float cyl_bessel_if(float nu, float x);
long double cyl_bessel_il(long double nu, long double x);

返回 nu 和 x 的第一类修正贝塞尔函数

另请参阅 cyl_bessel_i 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.9] cylindrical Bessel functions (of the first kind):
double cyl_bessel_j(double nu, double x);
float cyl_bessel_jf(float nu, float x);
long double cyl_bessel_jl(long double nu, long double x);

返回 nu 和 x 的第一类贝塞尔函数

另请参阅 cyl_bessel_j 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.10] irregular modified cylindrical Bessel functions:
double cyl_bessel_k(double nu, double x);
float cyl_bessel_kf(float nu, float x);
long double cyl_bessel_kl(long double nu, long double x);

返回 nu 和 x 的第二类修正贝塞尔函数

另请参阅 cyl_bessel_k 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.11] cylindrical Neumann functions;
// cylindrical Bessel functions (of the second kind):
double cyl_neumann(double nu, double x);
float cyl_neumannf(float nu, float x);
long double cyl_neumannl(long double nu, long double x);

返回 nu 和 x 的第二类贝塞尔函数(诺伊曼函数)

另请参阅 cyl_neumann 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.12] (incomplete) elliptic integral of the first kind:
double ellint_1(double k, double phi);
float ellint_1f(float k, float phi);
long double ellint_1l(long double k, long double phi);

返回 k 和 phi 的第一类不完全椭圆积分

另请参阅 ellint_1 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.13] (incomplete) elliptic integral of the second kind:
double ellint_2(double k, double phi);
float ellint_2f(float k, float phi);
long double ellint_2l(long double k, long double phi);

返回 k 和 phi 的第二类不完全椭圆积分

另请参阅 ellint_2 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.14] (incomplete) elliptic integral of the third kind:
double ellint_3(double k, double nu, double phi);
float ellint_3f(float k, float nu, float phi);
long double ellint_3l(long double k, long double nu, long double phi);

返回 k、nu 和 phi 的第三类不完全椭圆积分

另请参阅 ellint_3 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.15] exponential integral:
double expint(double x);
float expintf(float x);
long double expintl(long double x);

返回 x 的指数积分 Ei

另请参阅 expint 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.16] Hermite polynomials:
double hermite(unsigned n, double x);
float hermitef(unsigned n, float x);
long double hermitel(unsigned n, long double x);

返回 x 的第 n 阶埃尔米特多项式

另请参阅 hermite 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.18] Laguerre polynomials:
double laguerre(unsigned n, double x);
float laguerref(unsigned n, float x);
long double laguerrel(unsigned n, long double x);

返回 x 的第 n 阶拉盖尔多项式

另请参阅 laguerre 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.19] Legendre polynomials:
double legendre(unsigned l, double x);
float legendref(unsigned l, float x);
long double legendrel(unsigned l, long double x);

返回 x 的第 l 阶勒让德多项式

另请参阅 legendre_p 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.20] Riemann zeta function:
double riemann_zeta(double);
float riemann_zetaf(float);
long double riemann_zetal(long double);

返回 x 的黎曼 Zeta 函数

另请参阅 zeta 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.21] spherical Bessel functions (of the first kind):
double sph_bessel(unsigned n, double x);
float sph_besself(unsigned n, float x);
long double sph_bessell(unsigned n, long double x);

返回 x 的第一类球贝塞尔函数 jn(x)

另请参阅 sph_bessel 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.22] spherical associated Legendre functions:
double sph_legendre(unsigned l, unsigned m, double theta);
float sph_legendref(unsigned l, unsigned m, float theta);
long double sph_legendrel(unsigned l, unsigned m, long double theta);

返回 l、m 和 theta 的球形缔合勒让德函数

另请参阅 spherical_harmonic 以获取此函数的完整模板(仅标头)版本。

// [5.2.1.23] spherical Neumann functions;
// spherical Bessel functions (of the second kind):
double sph_neumann(unsigned n, double x);
float sph_neumannf(unsigned n, float x);
long double sph_neumannl(unsigned n, long double x);

返回 x 的球形诺伊曼函数 yn(x)

另请参阅 sph_bessel 以获取此函数的完整模板(仅标头)版本。

当前不支持的 TR1 函数
// [5.2.1.7] confluent hypergeometric functions:
double conf_hyperg(double a, double c, double x);
float conf_hypergf(float a, float c, float x);
long double conf_hypergl(long double a, long double c, long double x);

// [5.2.1.17] hypergeometric functions:
double hyperg(double a, double b, double c, double x);
float hypergf(float a, float b, float c, float x);
long double hypergl(long double a, long double b, long double c,
long double x);
[Note] 注意

这两个函数未实现,因为它们被认为在数值上不稳定。


PrevUpHomeNext