C:/SPA/projekt/implementace Cell/NeuralGas_SPU/NeuralGas_SPU.c File Reference

#include "NeuralGas_SPU.h"
#include <stdio.h>
#include <spu_ext.h>
#include <spu_mfcio.h>
#include <float.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>

Data Structures

struct  InternalData_SPU

Functions

void ReadInputs (InternalData_SPU *internal, void(handler(InternalData_SPU *, int)))
void ReadAndWriteNeurons (InternalData_SPU *internal, int overlap, void(handler(InternalData_SPU *, int)))
void FindMinMax (InternalData_SPU *internal, int elements)
void DoIterationForInputVertex (InternalData_SPU *internal, int elements)
void ComputeDistance (InternalData_SPU *internal, int elements)
void SortNeurons (InternalData_SPU *internal)
void BubbleSort (InternalData_SPU *internal, int elements)
void UpdateNeuronsPositions (InternalData_SPU *internal, int elements)
int computeNeuralGas_PPU (NeuralGas_InputData *input, Vertex *inputCache, int inputCacheSize, Neuron *neuronCache, int neuronCacheSize)

Function Documentation

void BubbleSort ( InternalData_SPU internal,
int  elements 
)

Performs bubble sort on neurons in cache. Neuron distance is used to compare neurons.

Parameters:
internal Algorithm state information.
Number of neurons in cache to process.

void ComputeDistance ( InternalData_SPU internal,
int  elements 
)

Computes distance of each neuron from actual input vertex.

Parameters:
internal Algorithm state information.
Number of neurons in cache to process.

int computeNeuralGas_PPU ( NeuralGas_InputData input,
Vertex inputCache,
int  inputCacheSize,
Neuron neuronCache,
int  neuronCacheSize 
)

Runs neural gas algorithm computation.

Parameters:
input NeuralGas_InputData structure.
inputCache Pointer to array that will be used as cache for input vertices.
inputCacheSize Input cache size. neuronCache Pointer to array that will be used as cache for neurons.
neuronCacheSize Neuron cache size.

void DoIterationForInputVertex ( InternalData_SPU internal,
int  elements 
)

Performs one iteration for one input vertex, so computes distance of each neuron and move their.

Parameters:
internal Algorithm state information.
Number of inputs in cache to process.

void FindMinMax ( InternalData_SPU internal,
int  elements 
)

Sets minimal and maximal values of inputs that are in cache.

Parameters:
internal Algorithm state information.
Number of inputs in cache to process.

void ReadAndWriteNeurons ( InternalData_SPU internal,
int  overlap,
void(handler(InternalData_SPU *, int))   
)

Reads and saves neurons.

Parameters:
overlap Specifies if batches will be overlapped.

void ReadInputs ( InternalData_SPU internal,
void(handler(InternalData_SPU *, int))   
)

Reads input vertices.

void SortNeurons ( InternalData_SPU internal  ) 

Sorts all neurons by their distances.

Parameters:
internal Algorithm state information.

void UpdateNeuronsPositions ( InternalData_SPU internal,
int  elements 
)

Updates positions of all neurons accoring to their position in sorted set of neurons.

Parameters:
internal Algorithm state information.
Number of neurons in cache to process.


Generated on Mon May 21 15:13:54 2007 by  doxygen 1.5.2