coeffjaco.C

00001 /*
00002  *   Copyright (c) 2007 Jean-Louis Cornou
00003  *
00004  *   This file is part of LORENE.
00005  *
00006  *   LORENE is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License as published by
00008  *   the Free Software Foundation; either version 2 of the License, or
00009  *   (at your option) any later version.
00010  *
00011  *   LORENE is distributed in the hope that it will be useful,
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *   GNU General Public License for more details.
00015  *
00016  *   You should have received a copy of the GNU General Public License
00017  *   along with LORENE; if not, write to the Free Software
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 /*
00023  * $Id: coeffjaco.C,v 1.2 2007/12/21 12:41:46 j_novak Exp $
00024  * $Log: coeffjaco.C,v $
00025  * Revision 1.2  2007/12/21 12:41:46  j_novak
00026  * Removed the #include<fftw3.h> not needed here. Corrected headers.
00027  *
00028  * Revision 1.1  2007/12/11 15:42:21  jl_cornou
00029  * Premiere version des fonctions liees aux polynomes de Jacobi(0,2)
00030  *
00031  * $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Coef/coeffjaco.C,v 1.2 2007/12/21 12:41:46 j_novak Exp $
00032  *
00033  */
00034  
00035 #include "tbl.h"
00036 
00037 Tbl jacobipointsgl(int) ;
00038 
00039 double* coeffjaco(int n , double* ff) {
00040 
00041   Tbl jj = jacobipointsgl(n) ;
00042   double som ;
00043   int i,k ;
00044   double* aa = new double[n+1] ;
00045 
00046   for (k = 0 ; k < n ; k++) {
00047     som = 3*ff[0]*jj(k,0)/(jj(n,0)*jj(n,0)) ;
00048     for (i = 1 ; i < n+1 ; i++) {
00049       som += ff[i]*jj(k,i)/(jj(n,i)*jj(n,i)) ;
00050     }
00051     aa[k] = (2*k+3)/double(n*(n+3))*som ;
00052   }
00053   som = 3*ff[0]/jj(n,0) ;
00054     for (i = 1 ; i < n+1 ; i++) {
00055     som += ff[i]/jj(n,i) ;
00056     }
00057     aa[n]=som/double(n+3) ;
00058   return aa ;
00059 }

Generated on Tue Feb 7 01:35:15 2012 for LORENE by  doxygen 1.4.6