| 1 |
233 |
bertin |
/*
|
| 2 |
|
|
* poly.h
|
| 3 |
2 |
bertin |
*
|
| 4 |
233 |
bertin |
* Include file for poly.c.
|
| 5 |
2 |
bertin |
*
|
| 6 |
233 |
bertin |
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
| 7 |
2 |
bertin |
*
|
| 8 |
233 |
bertin |
* This file part of: AstrOmatic WCS library
|
| 9 |
2 |
bertin |
*
|
| 10 |
233 |
bertin |
* Copyright: (C) 1998-2010 IAP/CNRS/UPMC
|
| 11 |
2 |
bertin |
*
|
| 12 |
233 |
bertin |
* Author: Emmanuel Bertin (IAP)
|
| 13 |
|
|
*
|
| 14 |
|
|
* License: GNU General Public License
|
| 15 |
|
|
*
|
| 16 |
|
|
* AstrOmatic software is free software: you can redistribute it and/or
|
| 17 |
|
|
* modify it under the terms of the GNU General Public License as
|
| 18 |
|
|
* published by the Free Software Foundation, either version 3 of the
|
| 19 |
|
|
* License, or (at your option) any later version.
|
| 20 |
|
|
* AstrOmatic software is distributed in the hope that it will be useful,
|
| 21 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 22 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 23 |
|
|
* GNU General Public License for more details.
|
| 24 |
|
|
* You should have received a copy of the GNU General Public License
|
| 25 |
|
|
* along with AstrOmatic software.
|
| 26 |
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
| 27 |
|
|
*
|
| 28 |
|
|
* Last modified: 10/10/2010
|
| 29 |
|
|
*
|
| 30 |
|
|
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
| 31 |
2 |
bertin |
|
| 32 |
|
|
#ifndef _POLY_H_
|
| 33 |
|
|
#define _POLY_H_
|
| 34 |
|
|
|
| 35 |
|
|
/*--------------------------------- constants -------------------------------*/
|
| 36 |
|
|
|
| 37 |
|
|
#define POLY_MAXDIM 4 /* Max dimensionality of polynom */
|
| 38 |
|
|
#define POLY_MAXDEGREE 10 /* Max degree of the polynom */
|
| 39 |
|
|
|
| 40 |
|
|
/*---------------------------------- macros ---------------------------------*/
|
| 41 |
|
|
|
| 42 |
|
|
/*--------------------------- structure definitions -------------------------*/
|
| 43 |
|
|
|
| 44 |
|
|
typedef struct poly
|
| 45 |
|
|
{
|
| 46 |
|
|
double *basis; /* Current values of the basis functions */
|
| 47 |
|
|
double *coeff; /* Polynom coefficients */
|
| 48 |
|
|
int ncoeff; /* Number of coefficients */
|
| 49 |
|
|
int *group; /* Groups */
|
| 50 |
|
|
int ndim; /* dimensionality of the polynom */
|
| 51 |
|
|
int *degree; /* Degree in each group */
|
| 52 |
|
|
int ngroup; /* Number of different groups */
|
| 53 |
|
|
} polystruct;
|
| 54 |
|
|
|
| 55 |
|
|
/*---------------------------------- protos --------------------------------*/
|
| 56 |
|
|
|
| 57 |
|
|
extern polystruct *poly_init(int *group,int ndim,int *degree,int ngroup);
|
| 58 |
|
|
|
| 59 |
|
|
extern double poly_func(polystruct *poly, double *pos);
|
| 60 |
|
|
|
| 61 |
|
|
extern int cholsolve(double *a, double *b, int n),
|
| 62 |
|
|
*poly_powers(polystruct *poly);
|
| 63 |
|
|
|
| 64 |
|
|
extern void poly_addcste(polystruct *poly, double *cste),
|
| 65 |
|
|
poly_end(polystruct *poly),
|
| 66 |
|
|
poly_fit(polystruct *poly, double *x, double *y,
|
| 67 |
|
|
double *w, int ndata, double *extbasis),
|
| 68 |
233 |
bertin |
poly_solve(double *a, double *b, int n);
|
| 69 |
2 |
bertin |
#endif
|
| 70 |
|
|
|