MCPcopy Create free account
hub / github.com/creatale/node-dv / NextSample

Function NextSample

deps/tesseract/classify/cluster.cpp:626–639  ·  view source on GitHub ↗

* This routine is used to find all of the samples which * belong to a cluster. It starts by removing the top * cluster on the cluster list (SearchState). If this cluster is * a leaf it is returned. Otherwise, the right subcluster * is pushed on the list and we continue the search in the * left subcluster. This continues until a leaf is found. * If all samples have been found, NULL is ret

Source from the content-addressed store, hash-verified

624 * @note History: 6/16/89, DSJ, Created.
625 */
626CLUSTER *NextSample(LIST *SearchState) {
627 CLUSTER *Cluster;
628
629 if (*SearchState == NIL_LIST)
630 return (NULL);
631 Cluster = (CLUSTER *) first_node (*SearchState);
632 *SearchState = pop (*SearchState);
633 while (TRUE) {
634 if (Cluster->Left == NULL)
635 return (Cluster);
636 *SearchState = push (*SearchState, Cluster->Right);
637 Cluster = Cluster->Left;
638 }
639} // NextSample
640
641/**
642 * This routine returns the mean of the specified

Callers 3

ComputeStatisticsFunction · 0.85
FillBucketsFunction · 0.85
cluster.cppFile · 0.85

Calls 2

popFunction · 0.85
pushFunction · 0.85

Tested by

no test coverage detected