VTK
vtkPKMeansStatistics.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPKMeansStatistics.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2011 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19  -------------------------------------------------------------------------*/
32 #ifndef vtkPKMeansStatistics_h
33 #define vtkPKMeansStatistics_h
34 
35 #include "vtkFiltersParallelStatisticsModule.h" // For export macro
36 #include "vtkKMeansStatistics.h"
37 
39 class vtkCommunicator;
40 
41 class VTKFILTERSPARALLELSTATISTICS_EXPORT vtkPKMeansStatistics : public vtkKMeansStatistics
42 {
43 public:
44  static vtkPKMeansStatistics* New();
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
53  virtual void SetController(vtkMultiProcessController*);
54  vtkGetObjectMacro(Controller, vtkMultiProcessController);
56 
60  void UpdateClusterCenters( vtkTable* newClusterElements,
61  vtkTable* curClusterElements,
62  vtkIdTypeArray* numMembershipChanges,
63  vtkIdTypeArray* numElementsInCluster,
64  vtkDoubleArray* error,
65  vtkIdTypeArray* startRunID,
66  vtkIdTypeArray* endRunID,
67  vtkIntArray *computeRun ) override;
68 
72  vtkIdType GetTotalNumberOfObservations( vtkIdType numObservations ) override;
73 
77  void CreateInitialClusterCenters(vtkIdType numToAllocate,
78  vtkIdTypeArray* numberOfClusters,
79  vtkTable* inData,
80  vtkTable* curClusterElements,
81  vtkTable* newClusterElements) override;
82 
83 
84 protected:
86  ~vtkPKMeansStatistics() override;
87 
89 
90 
91 private:
93  void operator=(const vtkPKMeansStatistics&) = delete;
94 };
95 
96 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:347
dynamic, self-adjusting array of double
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:45
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void UpdateClusterCenters(vtkTable *newClusterElements, vtkTable *curClusterElements, vtkIdTypeArray *numMembershipChanges, vtkIdTypeArray *numElementsInCluster, vtkDoubleArray *error, vtkIdTypeArray *startRunID, vtkIdTypeArray *endRunID, vtkIntArray *computeRun)
Subroutine to update new cluster centers from the old centers.
A class for KMeans clustering.
virtual vtkIdType GetTotalNumberOfObservations(vtkIdType numObservations)
Subroutine to get the total number of observations.
vtkMultiProcessController * Controller
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
virtual void CreateInitialClusterCenters(vtkIdType numToAllocate, vtkIdTypeArray *numberOfClusters, vtkTable *inData, vtkTable *curClusterElements, vtkTable *newClusterElements)
Subroutine to initialize cluster centerss if not provided by the user.
Used to send/receive messages in a multiprocess environment.
static vtkKMeansStatistics * New()
Multiprocessing communication superclass.