PLplot  5.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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"

Go to the source code of this file.

Classes

struct  triangle
struct  square
struct  csa

Macros

#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

void csa_setnppc (csa *a, double nppc)
static void csa_quit (const char *format,...)
static voidalloc2d (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)

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 }

Macro Definition Documentation

#define K_DEF   140

Definition at line 49 of file csa.c.

#define NPASTART   5

Definition at line 43 of file csa.c.

#define NPMAX_DEF   40

Definition at line 48 of file csa.c.

#define NPMIN_DEF   3

Definition at line 47 of file csa.c.

#define NPPC_DEF   5

Definition at line 50 of file csa.c.

#define SVD_NMAX   30

Definition at line 44 of file csa.c.

Typedef Documentation

typedef struct square square

Definition at line 53 of file csa.c.

Function Documentation

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

Definition at line 158 of file csa.c.

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

Definition at line 398 of file csa.c.

void csa_approximate_point ( csa a,
point p 
)

Definition at line 1674 of file csa.c.

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

Definition at line 1747 of file csa.c.

static void csa_attachpoints ( csa a)
static

Definition at line 716 of file csa.c.

void csa_calculatespline ( csa a)

Definition at line 1665 of file csa.c.

csa* csa_create ( void  )

Definition at line 351 of file csa.c.

void csa_destroy ( csa a)

Definition at line 380 of file csa.c.

static void csa_findprimarycoeffs ( csa a)
static

Definition at line 1195 of file csa.c.

static void csa_findsecondarycoeffs ( csa a)
static

Definition at line 1469 of file csa.c.

static void csa_quit ( const char *  format,
  ... 
)
static

Definition at line 137 of file csa.c.

static void csa_sethascoeffsflag ( csa a)
static

Definition at line 1638 of file csa.c.

void csa_setk ( csa a,
int  k 
)

Definition at line 1765 of file csa.c.

void csa_setnpmax ( csa a,
int  npmax 
)

Definition at line 1760 of file csa.c.

void csa_setnpmin ( csa a,
int  npmin 
)

Definition at line 1755 of file csa.c.

void csa_setnppc ( csa a,
double  nppc 
)

Definition at line 1770 of file csa.c.

static void csa_setprimaryflag ( csa a)
static

Definition at line 437 of file csa.c.

static void csa_squarize ( csa a)
static

Definition at line 472 of file csa.c.

static double distance ( point p1,
point p2 
)
static

Definition at line 645 of file csa.c.

static void free2d ( void pp)
static

Definition at line 187 of file csa.c.

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

Definition at line 610 of file csa.c.

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

Definition at line 1144 of file csa.c.

static int n2q ( int  n)
static

Definition at line 806 of file csa.c.

static void square_addpoint ( square s,
point p 
)
static

Definition at line 331 of file csa.c.

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

Definition at line 281 of file csa.c.

static void square_destroy ( square s)
static

Definition at line 320 of file csa.c.

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

Definition at line 828 of file csa.c.

static void thindata ( triangle t,
int  npmax 
)
static

Definition at line 658 of file csa.c.

static void triangle_addpoint ( triangle t,
point p 
)
static

Definition at line 220 of file csa.c.

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

Definition at line 253 of file csa.c.

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

Definition at line 198 of file csa.c.

static void triangle_destroy ( triangle t)
static

Definition at line 240 of file csa.c.

Variable Documentation

int csa_verbose = 0

Definition at line 41 of file csa.c.

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

Definition at line 1627 of file csa.c.

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

Definition at line 1632 of file csa.c.

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

Definition at line 1629 of file csa.c.

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

Definition at line 1626 of file csa.c.

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

Definition at line 1630 of file csa.c.

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

Definition at line 1634 of file csa.c.

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

Definition at line 1631 of file csa.c.

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

Definition at line 1633 of file csa.c.

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

Definition at line 1628 of file csa.c.

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

Definition at line 1625 of file csa.c.

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

Definition at line 1636 of file csa.c.