sinfo_solve_poly_root.h

00001 #ifndef SINFO_SOLVE_POLY_ROOT_H
00002 #define SINFO_SOLVE_POLY_ROOT_H
00003 /*
00004  * This file is part of the ESO SINFONI Pipeline
00005  * Copyright (C) 2004,2005 European Southern Observatory
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
00020  */
00021 
00022 /*
00023 #include <stdio.h>
00024 */
00025 #include <stdlib.h>
00026 #include <math.h>
00027 #include <stdlib.h>
00028 #include <cpl.h>
00029 #include "sinfo_msg.h"
00030 
00031 /* C-style sinfo_matrix elements */
00032 #define MAT(m,i,j,n) ((m)[(i)*(n) + (j)])
00033 
00034 /* Fortran-style sinfo_matrix elements */
00035 #define FMAT(m,i,j,n) ((m)[((i)-1)*(n) + ((j)-1)])
00036 
00037 
00038 #undef __BEGIN_DECLS
00039 #undef __END_DECLS
00040 #ifdef __cplusplus
00041 # define __BEGIN_DECLS extern "C" {
00042 # define __END_DECLS }
00043 #else
00044 # define __BEGIN_DECLS /* empty */
00045 # define __END_DECLS /* empty */
00046 #endif
00047 
00048 typedef double *       gsl_complex_packed_ptr ;
00049 
00050 void sinfo_balance_companion_matrix (double *m, size_t nc);
00051 int sinfo_qr_companion (double *h, size_t nc, gsl_complex_packed_ptr z);
00052 void sinfo_set_companion_matrix (const double *a, size_t n, double *m);
00053 
00054 __BEGIN_DECLS
00055 
00056 /* Solve for the complex roots of a general real polynomial */
00057 
00058 typedef struct 
00059 { 
00060   size_t nc ;
00061   double * sinfo_matrix ; 
00062 } 
00063 gsl_poly_complex_workspace ;
00064 
00065 gsl_poly_complex_workspace * sinfo_gsl_poly_complex_workspace_alloc (size_t n);
00066 void sinfo_gsl_poly_complex_workspace_free (gsl_poly_complex_workspace * w);
00067 
00068 int
00069 sinfo_gsl_poly_complex_solve (const double * a, size_t n, 
00070                         gsl_poly_complex_workspace * w,
00071                         gsl_complex_packed_ptr z);
00072             
00073             
00074 
00075 __END_DECLS
00076 
00077 #endif /* SINFO_SOLVE_POLY_ROOT_H */

Generated on 8 Mar 2011 for SINFONI Pipeline Reference Manual by  doxygen 1.6.1