Back to index

plt-scheme  4.2.1
csa_internal.h
Go to the documentation of this file.
00001 /******************************************************************************
00002  *
00003  * File:           csa.h
00004  *
00005  * Created:        16/10/2002
00006  *
00007  * Author:         Pavel Sakov
00008  *                 CSIRO Marine Research
00009  *
00010  * Purpose:        An "internal" header for csa library (2D data approximation
00011  *                 with bivariate cubic spline)
00012  *
00013  * Revisions:      None
00014  *
00015  *****************************************************************************/
00016 
00017 #if !defined(_CSA_INTERNAL_H)
00018 #define _CSA_INTERNAL_H
00019 
00020 #include "csa.h"
00021 
00022 struct square;
00023 typedef struct square square;
00024 
00025 typedef struct {
00026     square* parent;
00027     int index;                  /* index within parent square; 0 <= index <= 
00028                                  * 3 */
00029     point vertices[3];
00030     point middle;               /* barycenter */
00031     double h;                   /* parent square edge length */
00032     double r;                   /* data visibility radius */
00033 
00034     /*
00035      * points used -- in primary triangles only 
00036      */
00037     int nallocated;
00038     int npoints;
00039     point** points;
00040 
00041     int primary;                /* flag -- whether calculate spline
00042                                  * coefficients directly (by least squares
00043                                  * method) (primary = 1) or indirectly (from 
00044                                  * * C1 smoothness conditions) (primary = 0) 
00045                                  */
00046     int hascoeffs;              /* flag -- whether there are no NaNs among
00047                                  * the spline coefficients */
00048     int order;                  /* spline order -- for primary triangles
00049                                  * only */
00050 } triangle;
00051 
00052 struct square {
00053     csa* parent;
00054     int i, j;                   /* indices */
00055 
00056     int nallocated;
00057     int npoints;
00058     point** points;
00059 
00060     int primary;                /* flag -- whether this square contains a
00061                                  * primary triangle */
00062 
00063     triangle* triangles[4];
00064 
00065     double coeffs[25];
00066 };
00067 
00068 struct csa {
00069     int verbose;                /* flag */
00070 
00071     double xmin;
00072     double xmax;
00073     double ymin;
00074     double ymax;
00075 
00076     int nallocated;
00077     int npoints;
00078     point** points;
00079 
00080     /*
00081      * squarization 
00082      */
00083     int ni;
00084     int nj;
00085     double h;
00086     square*** squares;          /* square* [j][i] */
00087 
00088     int npt;                    /* Number of Primary Triangles */
00089     triangle** pt;              /* Primary Triangles -- triangle* [npt] */
00090 
00091     /*
00092      * algorithm parameters 
00093      */
00094     int nmin;
00095     int nmax;
00096     double k;
00097 };
00098 
00099 #endif