lanczos.c
Go to the documentation of this file.
1 /* (C) Copyright John Maddock 2006.
2  * Use, modification and distribution are subject to the
3  * Boost Software License, Version 1.0. (See accompanying file
4  * LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
5  */
6 
7 /* Scipy changes:
8  * - 06-22-2016: Removed all code not related to double precision and
9  * ported to c for use in Cephes
10  */
11 
12 #include "mconf.h"
13 #include "lanczos.h"
14 
15 
16 static double lanczos_sum(double x)
17 {
18  return ratevl(x, lanczos_num,
19  sizeof(lanczos_num) / sizeof(lanczos_num[0]) - 1,
21  sizeof(lanczos_denom) / sizeof(lanczos_denom[0]) - 1);
22 }
23 
24 
25 double lanczos_sum_expg_scaled(double x)
26 {
31 }
32 
33 
34 static double lanczos_sum_near_1(double dx)
35 {
36  double result = 0;
37  unsigned k;
38 
39  for (k = 1; k <= sizeof(lanczos_sum_near_1_d)/sizeof(lanczos_sum_near_1_d[0]); ++k) {
40  result += (-lanczos_sum_near_1_d[k-1]*dx)/(k*dx + k*k);
41  }
42  return result;
43 }
44 
45 
46 static double lanczos_sum_near_2(double dx)
47 {
48  double result = 0;
49  double x = dx + 2;
50  unsigned k;
51 
52  for(k = 1; k <= sizeof(lanczos_sum_near_2_d)/sizeof(lanczos_sum_near_2_d[0]); ++k) {
53  result += (-lanczos_sum_near_2_d[k-1]*dx)/(x + k*x + k*k - 1);
54  }
55  return result;
56 }
lanczos_num
static const double lanczos_num[13]
Definition: lanczos.h:37
lanczos_sum
static double lanczos_sum(double x)
Definition: lanczos.c:16
lanczos_sum_near_2
static double lanczos_sum_near_2(double dx)
Definition: lanczos.c:46
lanczos_sum_expg_scaled_num
static const double lanczos_sum_expg_scaled_num[13]
Definition: lanczos.h:69
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
lanczos_denom
static const double lanczos_denom[13]
Definition: lanczos.h:53
result
Values result
Definition: OdometryOptimize.cpp:8
lanczos_sum_near_1
static double lanczos_sum_near_1(double dx)
Definition: lanczos.c:34
ratevl
static double ratevl(double x, const double num[], int M, const double denom[], int N)
Definition: polevl.h:116
lanczos_sum_expg_scaled_denom
static const double lanczos_sum_expg_scaled_denom[13]
Definition: lanczos.h:85
lanczos.h
lanczos_sum_expg_scaled
double lanczos_sum_expg_scaled(double x)
Definition: lanczos.c:25
lanczos_sum_near_2_d
static const double lanczos_sum_near_2_d[12]
Definition: lanczos.h:116
mconf.h
lanczos_sum_near_1_d
static const double lanczos_sum_near_1_d[12]
Definition: lanczos.h:101


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:52