LALInspiralBCVSpinBank.h

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 Bernd Machenschalk, B.S. Sathyaprakash, Chris Van Den Broeck
00003 *
00004 *  This program is free software; you can redistribute it and/or modify
00005 *  it under the terms of the GNU General Public License as published by
00006 *  the Free Software Foundation; either version 2 of the License, or
00007 *  (at your option) any later version.
00008 *
00009 *  This program is distributed in the hope that it will be useful,
00010 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 *  GNU General Public License for more details.
00013 *
00014 *  You should have received a copy of the GNU General Public License
00015 *  along with with program; see the file COPYING. If not, write to the
00016 *  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00017 *  MA  02111-1307  USA
00018 */
00019 
00020 /* Header file for BCVspin_metric_fit.c   
00021    ver 3.0   2005/3/8 H.Tagoshi
00022 ver 3.1   2005/3/21 H.Tagoshi
00023 ver6.5 2006/2/23  NR functions was replaced with GSL functions H. Takahashi
00024 */
00025 
00026 /* <lalVerbatim file="LALInspiralBCVSpinBankHV">
00027 
00028 Author: Tagoshi, H., T. Hirotaka, Van Den Broeck, C., Jones, G., B.S. Sathyaprakash
00029 $Id: LALInspiralBCVSpinBank.h,v 1.9 2007/06/08 14:41:42 bema Exp $
00030 
00031 </lalVerbatim> */
00032 
00033 /* <lalLaTeX>
00034 
00035 \section{Header \texttt{LALInspiralBCVSpinBank.h}}
00036 \label{s:LALInspiralBCVSpinBank.h}
00037 
00038 Header file for the template placement codes.
00039 
00040 \subsection*{Synopsis}
00041 \begin{verbatim}
00042 #include <lal/LALInspiralBCVSpinBank.h>
00043 \end{verbatim}
00044 
00045 \noindent This header file covers routines that are used in template placement
00046 for spinning black hole binaries using phenomenological BCV templates.
00047 
00048 </lalLaTeX> */
00049 
00050 #include <lal/LIGOMetadataTables.h>
00051 #include <lal/LALConstants.h>
00052 #include <lal/LALStdlib.h>
00053 
00054 /* This is a header for double precision complex routine dcomplex.c */
00055 /* H.Tagoshi */
00056 
00057 #ifndef _HT_DCOMPLEX_H_
00058 #define _HT_DCOMPLEX_H_
00059 
00060 #include        <stdio.h>
00061 #include        <stdlib.h>
00062 #include        <string.h>
00063 #include        <math.h>
00064 
00065 #ifndef _DCOMPLEX_DECLARE_HT_
00066 typedef struct DCOMPLEX {double r,i;} dcomplex;
00067 #define _DCOMPLEX_DECLARE_HT_
00068 #endif /* _DCOMPLEX_DECLARE_HT_ */
00069 
00070 dcomplex DCadd(dcomplex a, dcomplex b);
00071 dcomplex DCsub(dcomplex a, dcomplex b);
00072 dcomplex DCmul(dcomplex a, dcomplex b);
00073 dcomplex DComplex(double re, double im);
00074 dcomplex DConjg(dcomplex z);
00075 dcomplex DCdiv(dcomplex a, dcomplex b);
00076 double DCabs(dcomplex z);
00077 dcomplex DCsqrt(dcomplex z);
00078 dcomplex DRCmul(double x, dcomplex a);
00079 
00080 #endif /* _HT_DCOMPLEX_H_ */
00081 
00082 #ifndef _HT_BCVSPINMETRIC_H_
00083 #define _HT_BCVSPINMETRIC_H_
00084 
00085 #include <gsl/gsl_vector.h>
00086 #include <gsl/gsl_math.h>
00087 #include <gsl/gsl_matrix.h>
00088 #include <gsl/gsl_eigen.h>
00089 #include <gsl/gsl_rng.h>
00090 #include <gsl/gsl_roots.h>
00091 
00092 #include <lal/LALRCSID.h>
00093 NRCSID (LALINSPIRALBCVSPINBANKH,"$Id: LALInspiralBCVSpinBank.h,v 1.9 2007/06/08 14:41:42 bema Exp $");
00094 
00095 int cos_sin_func(/* input */
00096                  int N, double beta,double fmax,
00097                  /* output */
00098                  double *costerm,double *sinterm);
00099 
00100 int coef_A(/* input */
00101            int N,double *costerm,double *sinterm,double fmax,
00102            /* output */
00103            double *A1, double *A2,double *A3);
00104 
00105 int deriv_A(/* input */
00106             int N,double *costerm,double *sinterm,double fmax,
00107             /* output */
00108             double *dA2,double *dA3);
00109 
00110 int innerR(/* input */
00111            int N, double *A, double *B, double *Sn,double fmin,double fmax,
00112            /* output */
00113            double *result);
00114 
00115 int innerC(/* input */
00116            int N, dcomplex *A, dcomplex *B, double *Sn,double fmin,double fmax,
00117            /* output */
00118            double *result);
00119 
00120 int orthonormalized_A(/* input */
00121                       int N,double *A1, double *A2,double *A3,double *Sn,
00122                       double fmin,double fmax,
00123                       /* output */
00124                       double *tA2,double *tA3,
00125                       double *hA1,double *hA2, double *hA3,
00126                       double *normtA2,double *normtA3);
00127 
00128 int dA2dbeta(/* input */
00129              int N,double *Sn,double fmin,double fmax, double *hA1,
00130              double *tA2,double *dA2,double normtA2,
00131              /* output */
00132              double *dhA2);
00133 
00134 int dA3dbeta(/* input */
00135              int N,double *Sn,double fmin,double fmax,
00136              double *hA1,double *hA2,double *dhA2,
00137              double *A3,double *tA3,double *dA3,double normtA3,
00138              /*  output */
00139              double *dhA3);
00140 
00141 int calc_function_G(/* input */
00142                int N,double *Sn,double fmin,double fmax,
00143                double *A1,double *A2,double *A3,
00144                double *dhA2db,double *dhA3db,
00145                /* output */
00146                double funcG[7][7][4][4]);
00147 
00148 int functionG(/* input */
00149               int N,double beta,double *Sn,double fmin,double fmax,
00150               /* output */
00151               double funcG[7][7][4][4]);
00152 
00153 int three_metric(/* input */
00154               double funcG[7][7][4][4],double *alpha,
00155               /* output */
00156               double metric3[4][4]);
00157 
00158 int generate_fit_points(/*input*/double MinMatch, double funcG[7][7][4][4],
00159                         int ndata, 
00160                         /*output*/ double fit_point[ndata+1][4]);
00161 
00162 int generate_metric_data(/* input */double MinMatch,
00163                          double funcG[7][7][4][4]);
00164 
00165 void model_func(double xx,double afunc[]);
00166 
00167 int metric_by_fit(/* input */
00168                    double MinMatch, int ndata,
00169                   /* output */
00170                   double metric_fit[4][4]);
00171 
00172 int rescale_metric(/*input*/ double MinMatch, int ndata, double metric1[4][4],
00173                    /*output*/ double metric[4][4]);
00174 
00175 int BCVspin_metric(/*input*/
00176                 double MinMatch, int N,double *Sn,double fmin,double fmax,double beta,
00177                 /*output*/
00178                 double bcv2metric[4][4],int dbg);
00179 
00180 double determinant3(gsl_matrix *matrix);
00181 
00182 int matrix2_determinant_plus(gsl_matrix *matrix,gsl_vector *eig);
00183 
00184 int matrix3_determinant_plus(gsl_matrix *matrix,gsl_vector *eig);
00185 
00186 double innerp(int n,double *b,double *c);
00187 
00188 double vector_product(double *a,double *b,double *c);
00189 
00190 int product_matrix(int n,double A[][n+1],double B[][n+1],double C[][n+1]);
00191 
00192 int product_mat_vec(int n,double *w,double A[][n+1],double *v);
00193 
00194 int BCVspin_spacing(double MinMatch,double metric3[4][4],double a[4][4],double *deltax);
00195 
00196 int BCVspin_effmetric(/* input */
00197                       double MinMatch, double metric3[4][4],double a[4][4],
00198                       /* output */
00199                       double effmetric[3][3]);
00200 
00201 struct func1_params
00202   {
00203         int N;
00204         double *Sn;
00205         double fmin;
00206         double fmax;
00207         double MinMatch;
00208 };
00209 
00210 double func1(double beta,void *params);
00211 
00212 struct func2_params
00213 {
00214         double beta_i;
00215         int N;
00216         double *Sn;
00217         double fmin;
00218         double fmax;
00219         double MinMatch;
00220 };
00221 
00222 double func2(double beta,void *params);
00223 
00224 int BCVspin_beta_placement(double MinMatch,double beta_min,double beta_max, int N,
00225                 double *Sn,double fmin,double fmax, double *beta_list,int *nbeta);
00226 
00227 int BCVspin_beta_placement_effmetric(/* input*/ double MinMatch,double beta_min,double beta_max, int N,
00228                 double *Sn,double fmin,double fmax, 
00229                 /* output */ double effmetric_list[3][3][1001], double *beta_list,int *nbeta);
00230 
00231 
00232 void svdfit_d_test(double x[], double y[], double sig[], int ndata, gsl_vector *a, int ma,
00233         gsl_matrix *u, gsl_matrix  *v, gsl_vector *w, double *chisq,
00234                 void (*funcs)(double, double []));
00235 
00236 #endif
00237 

Generated on Tue Oct 7 02:40:00 2008 for LAL by  doxygen 1.5.2