📄 alf.h
字号:
//// spectral toolkit // copyright (c) 2005 university corporation for atmospheric research// licensed under the gnu general public license//#ifndef __alf__#define __alf__#include "spectral.h"namespace spectral{ /// Associated Legendre function \f$ P_n^m(x)\f$. Constructs an associated /// Legendre function for particular n,m with \f$ 0 \le m \le n \f$. /// \f$ P_n^m(x)\f$ can then be evaluated for \f$ x \in [-1,1] \f$ with /// the operator() member function. /// /// See Swartztrauber, P.N., The Vector Harmonic Transform /// Method for Solving Partial Differential Equations in Spherical Geometry, /// <I>Monthly Weather Review</I>, <B>121</B> (1993), 3415-3437. /// /// The following example creates an associated Legendre polynomial and evaluates it at /// a series of points. /// \code /// #include <alf.h> /// #include <iostream> /// using namespace spectral; /// using namespace std; /// /// int main() /// { /// int n=3; /// int m=2; /// alf P(n,m); /// real x; /// x=0.0; cout << "P(" << n << "," << m << ")(" << x << ")=" << P(x) << endl; /// x=1.0; cout << "P(" << n << "," << m << ")(" << x << ")=" << P(x) << endl; /// x=-1.0; cout << "P(" << n << "," << m << ")(" << x << ")=" << P(x) << endl; /// x=-.12; cout << "P(" << n << "," << m << ")(" << x << ")=" << P(x) << endl; /// x=.7; cout << "P(" << n << "," << m << ")(" << x << ")=" << P(x) << endl; /// return(0); /// } /// \endcode class alf { public: alf(int N,int M=0); ~alf(); real operator()(real x); private: int m,n; real *cp; };}#endif// Local Variables:// mode:C++// End:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -