File indexing completed on 2025-02-21 10:03:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef __GSL_SF_ALF_H__
0021 #define __GSL_SF_ALF_H__
0022
0023 #include <stdlib.h>
0024 #include <gsl/gsl_inline.h>
0025 #include <gsl/gsl_sf_result.h>
0026
0027 #undef __BEGIN_DECLS
0028 #undef __END_DECLS
0029 #ifdef __cplusplus
0030 # define __BEGIN_DECLS extern "C" {
0031 # define __END_DECLS }
0032 #else
0033 # define __BEGIN_DECLS
0034 # define __END_DECLS
0035 #endif
0036
0037 __BEGIN_DECLS
0038
0039 typedef enum
0040 {
0041 GSL_SF_ALF_SCHMIDT,
0042 GSL_SF_ALF_SPHARM,
0043 GSL_SF_ALF_FULL,
0044 GSL_SF_ALF_FOURPI,
0045 GSL_SF_ALF_NONE
0046 } gsl_sf_alf_t;
0047
0048 #define GSL_SF_ALF_FLG_CSPHASE (1 << 0)
0049
0050 int gsl_sf_alf_precompute(const gsl_sf_alf_t norm, const size_t lmax,
0051 const size_t mmax, const size_t flags, double output_array[]);
0052 size_t gsl_sf_alf_array_size(const size_t lmax, const size_t mmax);
0053 int gsl_sf_alf_array(const size_t lmax, const size_t mmax, const double x, double result_array[]);
0054 int gsl_sf_alf_deriv_array(const size_t lmax, const size_t mmax, const double x,
0055 double result_array[], double result_deriv_array[]);
0056 int gsl_sf_alf_vsh_array(const size_t lmax, const size_t mmax, const double x,
0057 double result_array[], double result_deriv_array[]);
0058
0059 INLINE_DECL size_t gsl_sf_alf_nlm(const size_t lmax, const size_t mmax);
0060 INLINE_DECL size_t gsl_sf_alf_array_index(const size_t l, const size_t m, const size_t lmax);
0061
0062 #ifdef HAVE_INLINE
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074 INLINE_FUN
0075 size_t
0076 gsl_sf_alf_array_index(const size_t l, const size_t m, const size_t lmax)
0077 {
0078 return (((m * (2 * lmax + 1 - m)) >> 1) + l);
0079 }
0080
0081
0082 INLINE_FUN
0083 size_t
0084 gsl_sf_alf_nlm(const size_t lmax, const size_t mmax)
0085 {
0086 const size_t M = (mmax > lmax) ? lmax : mmax;
0087 return ((lmax + 1) * (M + 1) - ((M * (M + 1)) >> 1));
0088 }
0089
0090 #endif
0091
0092 __END_DECLS
0093
0094 #endif