#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) |
void BubbleSort | ( | InternalData_SPU * | internal, | |
int | elements | |||
) |
Performs bubble sort on neurons in cache. Neuron distance is used to compare neurons.
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.
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.
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.
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.
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.
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.
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.
internal | Algorithm state information. | |
Number | of neurons in cache to process. |