00001 #ifndef __vtkKMeansDistanceFunctor_h
00002 #define __vtkKMeansDistanceFunctor_h
00003
00015 #include "vtkObject.h"
00016
00017 class vtkVariantArray;
00018 class vtkAbstractArray;
00019 class vtkTable;
00020
00021 class VTK_INFOVIS_EXPORT vtkKMeansDistanceFunctor : public vtkObject
00022 {
00023 public:
00024 static vtkKMeansDistanceFunctor* New();
00025 vtkTypeMacro(vtkKMeansDistanceFunctor,vtkObject);
00026 virtual void PrintSelf( ostream& os, vtkIndent indent );
00027
00030 virtual vtkVariantArray* GetEmptyTuple( vtkIdType dimension );
00031
00034 virtual void operator() ( double&, vtkVariantArray*, vtkVariantArray * );
00035
00041 virtual void PairwiseUpdate( vtkTable* clusterCenters, vtkIdType row, vtkVariantArray* data, vtkIdType dataCardinality, vtkIdType totalCardinality );
00042
00049 virtual void PerturbElement( vtkTable*, vtkTable*, vtkIdType, vtkIdType, vtkIdType, double );
00050
00054 virtual void* AllocateElementArray( vtkIdType size );
00055
00057 virtual void DeallocateElementArray( void* );
00058
00062 virtual vtkAbstractArray* CreateCoordinateArray();
00063
00067 virtual void PackElements( vtkTable* curTable, void* vElements );
00068
00070
00073 virtual void UnPackElements( vtkTable* curTable, vtkTable* newTable, void* vLocalElements, void* vGlobalElements, int np );
00074 virtual void UnPackElements( vtkTable* curTable, void* vLocalElements, vtkIdType numRows, vtkIdType numCols );
00076
00078 virtual int GetDataType();
00079
00080 protected:
00081 vtkKMeansDistanceFunctor();
00082 virtual ~vtkKMeansDistanceFunctor();
00083
00084 vtkVariantArray* EmptyTuple;
00085 vtkTable* CenterUpdates;
00086
00087 private:
00088 vtkKMeansDistanceFunctor( const vtkKMeansDistanceFunctor& );
00089 void operator = ( const vtkKMeansDistanceFunctor& );
00090 };
00091
00092 #endif // __vtkKMeansDistanceFunctor_h