/usr/include/Lfunction/Ldirichlet_series.h is in liblfunction-dev 1.23+dfsg-6build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | /*
Copyright (C) 2001,2002,2003,2004 Michael Rubinstein
This file is part of the L-function package L.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Check the License for details. You should have received a copy of it, along
with the package; see the file 'COPYING'. If not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "Lmisc.h"
template <class ttype>
Complex L_function <ttype>::
partial_dirichlet_series(Complex s, long long N1, long long N2)
{
Complex z=0.;
long long m,n;
if(what_type_L==-1) //i.e. if the Riemann zeta function
for(n=N1;n<=N2;n++) z=z+exp(-s*LOG(n));
else if(what_type_L!=1) //if not periodic
for(n=N1;n<=N2;n++) z=z+dirichlet_coefficient[n]*exp(-s*LOG(n));
else //if periodic
for(n=N1;n<=N2;n++)
{
m=n%period; if(m==0)m=period;
z=z+dirichlet_coefficient[m]*exp(-s*LOG(n));
}
return z;
}
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
template <class ttype>
Complex L_function <ttype>::
dirichlet_series(Complex s, long long N)
{
Complex z=0.;
long long m,n;
if(N==-1) N=number_of_dirichlet_coefficients;
if(N>number_of_dirichlet_coefficients&&what_type_L!=-1&&what_type_L!=1)
{
if(print_warning){
print_warning=false;
cout << "WARNING from dirichlet series- we don't have enough Dirichlet coefficients." << endl;
cout << "Will use the maximum possible, though the output ";
cout << "will not necessarily be accurate." << endl;
}
N=number_of_dirichlet_coefficients;
}
if(what_type_L==-1) //i.e. if the Riemann zeta function
for(n=1;n<=N;n++) z=z+exp(-s*LOG(n));
else if(what_type_L!=1) //if not periodic
for(n=1;n<=N;n++) z=z+dirichlet_coefficient[n]*exp(-s*LOG(n));
else //if periodic
for(n=1;n<=N;n++)
{
m=n%period; if(m==0)m=period;
z=z+dirichlet_coefficient[m]*exp(-s*LOG(n));
}
return z;
}
|