VTK
vtkKMeansDistanceFunctor.h
Go to the documentation of this file.
1 #ifndef vtkKMeansDistanceFunctor_h
2 #define vtkKMeansDistanceFunctor_h
3 
16 #include "vtkFiltersStatisticsModule.h" // For export macro
17 #include "vtkObject.h"
18 
19 class vtkVariantArray;
20 class vtkAbstractArray;
21 class vtkTable;
22 
23 class VTKFILTERSSTATISTICS_EXPORT vtkKMeansDistanceFunctor : public vtkObject
24 {
25 public:
26  static vtkKMeansDistanceFunctor* New();
28  void PrintSelf( ostream& os, vtkIndent indent ) override;
29 
34  virtual vtkVariantArray* GetEmptyTuple( vtkIdType dimension );
35 
40  virtual void operator() ( double&, vtkVariantArray*, vtkVariantArray * );
41 
50  virtual void PairwiseUpdate( vtkTable* clusterCenters, vtkIdType row, vtkVariantArray* data, vtkIdType dataCardinality, vtkIdType totalCardinality );
51 
60  virtual void PerturbElement( vtkTable*, vtkTable*, vtkIdType, vtkIdType, vtkIdType, double );
61 
66  virtual void* AllocateElementArray( vtkIdType size );
67 
71  virtual void DeallocateElementArray( void* );
72 
77  virtual vtkAbstractArray* CreateCoordinateArray();
78 
83  virtual void PackElements( vtkTable* curTable, void* vElements );
84 
86 
90  virtual void UnPackElements( vtkTable* curTable, vtkTable* newTable, void* vLocalElements, void* vGlobalElements, int np );
91  virtual void UnPackElements( vtkTable* curTable, void* vLocalElements, vtkIdType numRows, vtkIdType numCols );
93 
97  virtual int GetDataType();
98 
99 protected:
101  ~vtkKMeansDistanceFunctor() override;
102 
103  vtkVariantArray* EmptyTuple; // Used to quickly initialize Tuple for each datum
104  vtkTable* CenterUpdates; // Used to hold online computation of next iteration's cluster center coords.
105 
106 private:
108  void operator = ( const vtkKMeansDistanceFunctor& ) = delete;
109 };
110 
111 #endif // vtkKMeansDistanceFunctor_h
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
An array holding vtkVariants.
Abstract superclass for all arrays.
int vtkIdType
Definition: vtkType.h:347
a simple class to control print indentation
Definition: vtkIndent.h:39
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
measure distance from k-means cluster centers