QSAS_2_4/QSAS_dist/src/Utilities/qplplot/csa.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <limits.h>
#include <float.h>
#include <math.h>
#include <assert.h>
#include <string.h>
#include <errno.h>
#include "version.h"
#include "nan.h"
#include "csa.h"

Classes

struct  triangle
struct  square
struct  csa

Defines

#define NPASTART   5
#define SVD_NMAX   30
#define NPMIN_DEF   3
#define NPMAX_DEF   40
#define K_DEF   140
#define NPPC_DEF   5

Typedefs

typedef struct square square

Functions

static void csa_quit (char *format,...)
static void * alloc2d (int n1, int n2, size_t unitsize)
static void free2d (void *pp)
static triangletriangle_create (square *s, point vertices[], int index)
static void triangle_addpoint (triangle *t, point *p)
static void triangle_destroy (triangle *t)
static void triangle_calculatebc (triangle *t, point *p, double bc[])
static squaresquare_create (csa *parent, double xmin, double ymin, int i, int j)
static void square_destroy (square *s)
static void square_addpoint (square *s, point *p)
csacsa_create ()
void csa_destroy (csa *a)
void csa_addpoints (csa *a, int n, point points[])
static void csa_setprimaryflag (csa *a)
static void csa_squarize (csa *a)
static void getsquares (csa *a, triangle *t, int *n, square ***squares)
static double distance (point *p1, point *p2)
static void thindata (triangle *t, int npmax)
static void csa_attachpoints (csa *a)
static int n2q (int n)
static void svd (double **a, int n, int m, double *w, double **v)
static void lsq (double **A, int ni, int nj, double *z, double *w, double *sol)
static void csa_findprimarycoeffs (csa *a)
static void csa_findsecondarycoeffs (csa *a)
static void csa_sethascoeffsflag (csa *a)
void csa_calculatespline (csa *a)
void csa_approximate_point (csa *a, point *p)
void csa_approximate_points (csa *a, int n, point *points)
void csa_setnpmin (csa *a, int npmin)
void csa_setnpmax (csa *a, int npmax)
void csa_setk (csa *a, int k)
void csa_setnppc (csa *a, double nppc)

Variables

int csa_verbose = 0
static int i300 [] = { 12, 12, 12, 12 }
static int i030 [] = { 3, 24, 21, 0 }
static int i003 [] = { 0, 3, 24, 21 }
static int i210 [] = { 9, 16, 15, 8 }
static int i021 [] = { 2, 17, 22, 7 }
static int i102 [] = { 4, 6, 20, 18 }
static int i120 [] = { 6, 20, 18, 4 }
static int i012 [] = { 1, 10, 23, 14 }
static int i201 [] = { 8, 9, 16, 15 }
static int i111 [] = { 5, 13, 19, 11 }
static int * iall [] = { i300, i030, i003, i210, i021, i102, i120, i012, i201, i111 }

Define Documentation

#define K_DEF   140

#define NPASTART   5

#define NPMAX_DEF   40

#define NPMIN_DEF   3

#define NPPC_DEF   5

#define SVD_NMAX   30


Typedef Documentation

typedef struct square square


Function Documentation

static void* alloc2d ( int  n1,
int  n2,
size_t  unitsize 
) [static]

void csa_addpoints ( csa a,
int  n,
point  points[] 
)

void csa_approximate_point ( csa a,
point p 
)

void csa_approximate_points ( csa a,
int  n,
point points 
)

static void csa_attachpoints ( csa a  )  [static]

void csa_calculatespline ( csa a  ) 

csa* csa_create (  ) 

void csa_destroy ( csa a  ) 

static void csa_findprimarycoeffs ( csa a  )  [static]

static void csa_findsecondarycoeffs ( csa a  )  [static]

static void csa_quit ( char *  format,
  ... 
) [static]

static void csa_sethascoeffsflag ( csa a  )  [static]

void csa_setk ( csa a,
int  k 
)

void csa_setnpmax ( csa a,
int  npmax 
)

void csa_setnpmin ( csa a,
int  npmin 
)

void csa_setnppc ( csa a,
double  nppc 
)

static void csa_setprimaryflag ( csa a  )  [static]

static void csa_squarize ( csa a  )  [static]

static double distance ( point p1,
point p2 
) [static]

static void free2d ( void *  pp  )  [static]

static void getsquares ( csa a,
triangle t,
int *  n,
square ***  squares 
) [static]

static void lsq ( double **  A,
int  ni,
int  nj,
double *  z,
double *  w,
double *  sol 
) [static]

static int n2q ( int  n  )  [static]

static void square_addpoint ( square s,
point p 
) [static]

static square* square_create ( csa parent,
double  xmin,
double  ymin,
int  i,
int  j 
) [static]

static void square_destroy ( square s  )  [static]

static void svd ( double **  a,
int  n,
int  m,
double *  w,
double **  v 
) [static]

Singular value decomposition. Borrowed from EISPACK (1972-1973). Presents input matrix A as A = U.W.V'.

Parameters:
a Input matrix A = U.W[0..m-1][0..n-1]; output matrix U
n Number of columns
m Number of rows
w Ouput vector that presents diagonal matrix W
V output matrix V

static void thindata ( triangle t,
int  npmax 
) [static]

static void triangle_addpoint ( triangle t,
point p 
) [static]

static void triangle_calculatebc ( triangle t,
point p,
double  bc[] 
) [static]

static triangle* triangle_create ( square s,
point  vertices[],
int  index 
) [static]

static void triangle_destroy ( triangle t  )  [static]


Variable Documentation

int csa_verbose = 0

int i003[] = { 0, 3, 24, 21 } [static]

int i012[] = { 1, 10, 23, 14 } [static]

int i021[] = { 2, 17, 22, 7 } [static]

int i030[] = { 3, 24, 21, 0 } [static]

int i102[] = { 4, 6, 20, 18 } [static]

int i111[] = { 5, 13, 19, 11 } [static]

int i120[] = { 6, 20, 18, 4 } [static]

int i201[] = { 8, 9, 16, 15 } [static]

int i210[] = { 9, 16, 15, 8 } [static]

int i300[] = { 12, 12, 12, 12 } [static]

int* iall[] = { i300, i030, i003, i210, i021, i102, i120, i012, i201, i111 } [static]


Generated on Fri Jan 8 12:51:25 2010 for QSAS by  doxygen 1.5.7