zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vqgen.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "vqgen.h"
#include "bookutil.h"

Go to the source code of this file.

Macros

#define vN(data, i)   (data+v->elements*i)
 

Functions

float _dist (vqgen *v, float *a, float *b)
 
void _vqgen_seed (vqgen *v)
 
float * _weight_null (vqgen *v, float *a)
 
int directdsort (const void *a, const void *b)
 
static int meshcomp (const void *a, const void *b)
 
void vqgen_addpoint (vqgen *v, float *p, float *a)
 
void vqgen_cellmetric (vqgen *v)
 
void vqgen_init (vqgen *v, int elements, int aux, int entries, float mindist, float(*metric)(vqgen *, float *, float *), float *(*weight)(vqgen *, float *), int centroid)
 
float vqgen_iterate (vqgen *v, int biasp)
 
void vqgen_quantize (vqgen *v, quant_meta *q)
 
void vqgen_sortmesh (vqgen *v)
 
void vqgen_unquantize (vqgen *v, quant_meta *q)
 

Variables

static int sortit =0
 
static int sortsize =0
 

Macro Definition Documentation

#define vN (   data,
  i 
)    (data+v->elements*i)

Definition at line 57 of file vqgen.c.

Referenced by vqgen_iterate().

Function Documentation

float _dist ( vqgen v,
float *  a,
float *  b 
)

Definition at line 60 of file vqgen.c.

References vqgen::elements, and i.

Referenced by vqgen_cellmetric(), and vqgen_init().

void _vqgen_seed ( vqgen v)

Definition at line 76 of file vqgen.c.

References _now(), _point(), vqgen::elements, vqgen::entries, i, memcpy, and vqgen::seeded.

Referenced by vqgen_iterate().

float* _weight_null ( vqgen v,
float *  a 
)

Definition at line 71 of file vqgen.c.

Referenced by vqgen_init().

int directdsort ( const void a,
const void b 
)

Definition at line 83 of file vqgen.c.

Referenced by vqgen_cellmetric(), and vqgen_iterate().

static int meshcomp ( const void a,
const void b 
)
static

Definition at line 300 of file vqgen.c.

References spinnit().

Referenced by vqgen_sortmesh().

void vqgen_addpoint ( vqgen v,
float *  p,
float *  a 
)
void vqgen_cellmetric ( vqgen v)

Definition at line 89 of file vqgen.c.

References _dist(), _now(), vqgen::assigned, directdsort(), vqgen::entries, entries, i, vqgen::it, j, k, vqgen::max, max, min, and qsort().

void vqgen_init ( vqgen v,
int  elements,
int  aux,
int  entries,
float  mindist,
float(*)(vqgen *, float *, float *)  metric,
float *(*)(vqgen *, float *)  weight,
int  centroid 
)
void vqgen_sortmesh ( vqgen v)
void vqgen_unquantize ( vqgen v,
quant_meta q 
)

Variable Documentation

int sortit =0
static

Definition at line 298 of file vqgen.c.

int sortsize =0
static

Definition at line 299 of file vqgen.c.