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

Function FreePrototype

deps/tesseract/classify/cluster.cpp:588–609  ·  view source on GitHub ↗

* This routine deallocates the memory consumed by the specified * prototype and modifies the corresponding cluster so that it * is no longer marked as a prototype. The cluster is NOT * deallocated by this routine. * @param arg prototype data structure to be deallocated * @return None * @note Exceptions: None * @note History: 5/30/89, DSJ, Created. */

Source from the content-addressed store, hash-verified

586 * @note History: 5/30/89, DSJ, Created.
587 */
588void FreePrototype(void *arg) { //PROTOTYPE *Prototype)
589 PROTOTYPE *Prototype = (PROTOTYPE *) arg;
590
591 // unmark the corresponding cluster (if there is one
592 if (Prototype->Cluster != NULL)
593 Prototype->Cluster->Prototype = FALSE;
594
595 // deallocate the prototype statistics and then the prototype itself
596 if (Prototype->Distrib != NULL)
597 memfree (Prototype->Distrib);
598 if (Prototype->Mean != NULL)
599 memfree (Prototype->Mean);
600 if (Prototype->Style != spherical) {
601 if (Prototype->Variance.Elliptical != NULL)
602 memfree (Prototype->Variance.Elliptical);
603 if (Prototype->Magnitude.Elliptical != NULL)
604 memfree (Prototype->Magnitude.Elliptical);
605 if (Prototype->Weight.Elliptical != NULL)
606 memfree (Prototype->Weight.Elliptical);
607 }
608 memfree(Prototype);
609} // FreePrototype
610
611/**
612 * This routine is used to find all of the samples which

Callers 2

MakeMixedProtoFunction · 0.85
ReadNormProtosMethod · 0.85

Calls 1

memfreeFunction · 0.85

Tested by

no test coverage detected