MCPcopy Create free account
hub / github.com/Kitware/VTK / Learn

Method Learn

Filters/ParallelStatistics/vtkPContingencyStatistics.cxx:126–389  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

124
125//------------------------------------------------------------------------------
126void vtkPContingencyStatistics::Learn(
127 vtkTable* inData, vtkTable* inParameters, vtkStatisticalModel* outMeta)
128{
129#if DEBUG_PARALLEL_CONTINGENCY_STATISTICS
130 vtkTimerLog* timer = vtkTimerLog::New();
131 timer->StartTimer();
132#endif // DEBUG_PARALLEL_CONTINGENCY_STATISTICS
133
134 if (!outMeta)
135 {
136#if DEBUG_PARALLEL_CONTINGENCY_STATISTICS
137 timer->Delete();
138#endif // DEBUG_PARALLEL_CONTINGENCY_STATISTICS
139
140 return;
141 }
142
143#if DEBUG_PARALLEL_CONTINGENCY_STATISTICS
144 vtkTimerLog* timers = vtkTimerLog::New();
145 timers->StartTimer();
146#endif // DEBUG_PARALLEL_CONTINGENCY_STATISTICS
147 // First calculate contingency statistics on local data set
148 this->Superclass::Learn(inData, inParameters, outMeta);
149#if DEBUG_PARALLEL_CONTINGENCY_STATISTICS
150 timers->StopTimer();
151
152 std::cout << "## Process " << this->Controller->GetCommunicator()->GetLocalProcessId()
153 << " serial engine executed in " << timers->GetElapsedTime() << " seconds."
154 << "\n";
155
156 timers->Delete();
157#endif // DEBUG_PARALLEL_CONTINGENCY_STATISTICS
158
159 // Get a hold of the summary table
160 vtkTable* summaryTab = outMeta->GetTable(vtkStatisticalModel::Learned, 0);
161 if (!summaryTab)
162 {
163#if DEBUG_PARALLEL_CONTINGENCY_STATISTICS
164 timer->Delete();
165#endif // DEBUG_PARALLEL_CONTINGENCY_STATISTICS
166
167 return;
168 }
169
170 // Determine how many (X,Y) variable pairs are present
171 vtkIdType nRowSumm = summaryTab->GetNumberOfRows();
172 if (nRowSumm <= 0)
173 {
174 // No statistics were calculated in serial.
175#if DEBUG_PARALLEL_CONTINGENCY_STATISTICS
176 timer->Delete();
177#endif // DEBUG_PARALLEL_CONTINGENCY_STATISTICS
178
179 return;
180 }
181
182 // Get a hold of the contingency table
183 vtkTable* contingencyTab = outMeta->GetTable(vtkStatisticalModel::Learned, 1);

Callers

nothing calls this directly

Calls 15

ReduceMethod · 0.95
BroadcastMethod · 0.95
GetNumberOfProcessesMethod · 0.80
GatherVMethod · 0.80
SetRowMethod · 0.80
InsertNextRowMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
StartTimerMethod · 0.45
StopTimerMethod · 0.45
GetLocalProcessIdMethod · 0.45

Tested by

no test coverage detected