VTK  9.7.1
vtkOrderStatistics.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2011 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
33 #ifndef vtkOrderStatistics_h
34 #define vtkOrderStatistics_h
35 
36 #include "vtkFiltersStatisticsModule.h" // For export macro
37 #include "vtkStatisticsAlgorithm.h"
38 
39 VTK_ABI_NAMESPACE_BEGIN
41 class vtkStringArray;
42 class vtkTable;
43 class vtkVariant;
44 
45 class VTKFILTERSSTATISTICS_EXPORT vtkOrderStatistics : public vtkStatisticsAlgorithm
46 {
47 public:
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50  static vtkOrderStatistics* New();
51 
53  int GetMaximumNumberOfColumnsPerRequest() const override { return 1; }
54 
59  {
60  InverseCDF = 0, // Identical to method 1 of R
61  InverseCDFAveragedSteps = 1, // Identical to method 2 of R, ignored for non-numeric types
62  NearestObservation = 2 // Identical to method 3 of R
63  };
64 
66 
69  vtkSetMacro(NumberOfIntervals, vtkIdType);
70  vtkGetMacro(NumberOfIntervals, vtkIdType);
72 
74 
77  vtkSetMacro(QuantileDefinition, QuantileDefinitionType);
78  void SetQuantileDefinition(int);
80 
82 
85  vtkSetMacro(Quantize, bool);
86  vtkGetMacro(Quantize, bool);
88 
90 
94  vtkSetMacro(MaximumHistogramSize, vtkIdType);
95  vtkGetMacro(MaximumHistogramSize, vtkIdType);
97 
101  vtkIdType GetQuantileDefinition() { return static_cast<vtkIdType>(this->QuantileDefinition); }
102 
108  bool SetParameter(const char* parameter, int index, vtkVariant value) override;
109 
114  bool Aggregate(vtkDataObjectCollection*, vtkStatisticalModel*) override { return false; }
115 
117  void AppendAlgorithmParameters(std::string& algorithmParameters) const override;
118 
120  std::size_t ConsumeNextAlgorithmParameter(
121  vtkStringToken parameterName, const std::string& algorithmParameters) override;
122 
123 protected:
125  ~vtkOrderStatistics() override;
126 
130  void Learn(vtkTable*, vtkTable*, vtkStatisticalModel*) override;
131 
135  void Derive(vtkStatisticalModel*) override;
136 
140  void Test(vtkTable*, vtkStatisticalModel*, vtkTable*) override;
141 
145  void Assess(vtkTable* inData, vtkStatisticalModel* inMeta, vtkTable* outData) override
146  {
147  this->Superclass::Assess(inData, inMeta, outData, 1);
148  }
149 
153  void SelectAssessFunctor(vtkTable* outData, vtkDataObject* inMeta, vtkStringArray* rowNames,
154  AssessFunctor*& dfunc) override;
155 
158  bool Quantize;
160 
161 private:
162  vtkOrderStatistics(const vtkOrderStatistics&) = delete;
163  void operator=(const vtkOrderStatistics&) = delete;
164 };
165 
166 VTK_ABI_NAMESPACE_END
167 #endif
a base class for statistical modeling of other data
virtual std::size_t ConsumeNextAlgorithmParameter(vtkStringToken parameterName, const std::string &algorithmParameters)
Consume a single parameter value, setting the value on this instance of the class.
static vtkTableAlgorithm * New()
A class for univariate order statistics.
maintain an unordered list of data objects
virtual void AppendAlgorithmParameters(std::string &algorithmParameters) const
Subclasses must override this method if they have any internal ivars that affect the behavior of Requ...
a vtkAbstractArray subclass for strings
int vtkIdType
Definition: vtkType.h:363
A type representing the union of many types.
Definition: vtkVariant.h:52
virtual void Learn(vtkTable *, vtkTable *, vtkStatisticalModel *)=0
Execute the calculations required by the Learn option, given some input Data.
Base class for statistics algorithms.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void Derive(vtkStatisticalModel *)=0
Execute the calculations required by the Derive option.
Represent a string by its integer hash.
QuantileDefinitionType
The type of quantile definition.
virtual void Test(vtkTable *, vtkStatisticalModel *, vtkTable *)=0
Execute the calculations required by the Test option.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:59
virtual bool SetParameter(const char *parameter, int index, vtkVariant value)
A convenience method (in particular for access from other applications) to set parameter values of Le...
virtual void SelectAssessFunctor(vtkTable *outData, vtkDataObject *inMeta, vtkStringArray *rowNames, AssessFunctor *&dfunc)=0
A pure virtual method to select the appropriate assessment functor.
QuantileDefinitionType QuantileDefinition
general representation of visualization data
Definition: vtkDataObject.h:55
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetMaximumNumberOfColumnsPerRequest() const override
Order statistics requests are univariate.
vtkIdType GetQuantileDefinition()
Get the quantile definition.
void Assess(vtkTable *inData, vtkStatisticalModel *inMeta, vtkTable *outData) override
Execute the calculations required by the Assess option.
bool Aggregate(vtkDataObjectCollection *, vtkStatisticalModel *) override
Given a collection of models, calculate aggregate model NB: not implemented.