VTK
vtkKMeansDistanceFunctor.h
Go to the documentation of this file.
1 #ifndef vtkKMeansDistanceFunctor_h
2 #define vtkKMeansDistanceFunctor_h
3 
15 #include "vtkFiltersStatisticsModule.h" // For export macro
16 #include "vtkObject.h"
17 
18 class vtkVariantArray;
19 class vtkAbstractArray;
20 class vtkTable;
21 
23 {
24 public:
25  static vtkKMeansDistanceFunctor* New();
27  virtual void PrintSelf( ostream& os, vtkIndent indent );
28 
31  virtual vtkVariantArray* GetEmptyTuple( vtkIdType dimension );
32 
35  virtual void operator() ( double&, vtkVariantArray*, vtkVariantArray * );
36 
42  virtual void PairwiseUpdate( vtkTable* clusterCenters, vtkIdType row, vtkVariantArray* data, vtkIdType dataCardinality, vtkIdType totalCardinality );
43 
50  virtual void PerturbElement( vtkTable*, vtkTable*, vtkIdType, vtkIdType, vtkIdType, double );
51 
55  virtual void* AllocateElementArray( vtkIdType size );
56 
58  virtual void DeallocateElementArray( void* );
59 
63  virtual vtkAbstractArray* CreateCoordinateArray();
64 
68  virtual void PackElements( vtkTable* curTable, void* vElements );
69 
71 
74  virtual void UnPackElements( vtkTable* curTable, vtkTable* newTable, void* vLocalElements, void* vGlobalElements, int np );
75  virtual void UnPackElements( vtkTable* curTable, void* vLocalElements, vtkIdType numRows, vtkIdType numCols );
77 
79  virtual int GetDataType();
80 
81 protected:
83  virtual ~vtkKMeansDistanceFunctor();
84 
85  vtkVariantArray* EmptyTuple; // Used to quickly initialize Tuple for each datum
86  vtkTable* CenterUpdates; // Used to hold online computation of next iteration's cluster center coords.
87 
88 private:
89  vtkKMeansDistanceFunctor( const vtkKMeansDistanceFunctor& ); // Not implemented.
90  void operator = ( const vtkKMeansDistanceFunctor& ); // Not implemented.
91 };
92 
93 #endif // vtkKMeansDistanceFunctor_h
abstract base class for most VTK objects
Definition: vtkObject.h:61
An array holding vtkVariants.
Abstract superclass for all arrays.
int vtkIdType
Definition: vtkType.h:275
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:67
#define VTKFILTERSSTATISTICS_EXPORT
static vtkObject * New()
measure distance from k-means cluster centers