| 1 |
/* |
| 2 |
* Copyright (c) 2007 Jean-Louis Cornou |
| 3 |
* |
| 4 |
* This file is part of LORENE. |
| 5 |
* |
| 6 |
* LORENE is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU General Public License as published by |
| 8 |
* the Free Software Foundation; either version 2 of the License, or |
| 9 |
* (at your option) any later version. |
| 10 |
* |
| 11 |
* LORENE is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU General Public License |
| 17 |
* along with LORENE; if not, write to the Free Software |
| 18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 |
* |
| 20 |
*/ |
| 21 |
|
| 22 |
/* |
| 23 |
* $Id: coeffjaco.C,v 1.3 2014/10/13 08:53:12 j_novak Exp $ |
| 24 |
* $Log: coeffjaco.C,v $ |
| 25 |
* Revision 1.3 2014/10/13 08:53:12 j_novak |
| 26 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 27 |
* |
| 28 |
* Revision 1.2 2007/12/21 12:41:46 j_novak |
| 29 |
* Removed the #include<fftw3.h> not needed here. Corrected headers. |
| 30 |
* |
| 31 |
* Revision 1.1 2007/12/11 15:42:21 jl_cornou |
| 32 |
* Premiere version des fonctions liees aux polynomes de Jacobi(0,2) |
| 33 |
* |
| 34 |
* $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Coef/coeffjaco.C,v 1.3 2014/10/13 08:53:12 j_novak Exp $ |
| 35 |
* |
| 36 |
*/ |
| 37 |
|
| 38 |
#include "tbl.h" |
| 39 |
|
| 40 |
namespace Lorene { |
| 41 |
Tbl jacobipointsgl(int) ; |
| 42 |
|
| 43 |
double* coeffjaco(int n , double* ff) { |
| 44 |
|
| 45 |
Tbl jj = jacobipointsgl(n) ; |
| 46 |
double som ; |
| 47 |
int i,k ; |
| 48 |
double* aa = new double[n+1] ; |
| 49 |
|
| 50 |
for (k = 0 ; k < n ; k++) { |
| 51 |
som = 3*ff[0]*jj(k,0)/(jj(n,0)*jj(n,0)) ; |
| 52 |
for (i = 1 ; i < n+1 ; i++) { |
| 53 |
som += ff[i]*jj(k,i)/(jj(n,i)*jj(n,i)) ; |
| 54 |
} |
| 55 |
aa[k] = (2*k+3)/double(n*(n+3))*som ; |
| 56 |
} |
| 57 |
som = 3*ff[0]/jj(n,0) ; |
| 58 |
for (i = 1 ; i < n+1 ; i++) { |
| 59 |
som += ff[i]/jj(n,i) ; |
| 60 |
} |
| 61 |
aa[n]=som/double(n+3) ; |
| 62 |
return aa ; |
| 63 |
} |
| 64 |
} |