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

Function NewMixedProto

deps/tesseract/classify/cluster.cpp:1582–1594  ·  view source on GitHub ↗

* This routine creates a mixed prototype data structure to * approximate the samples in the specified cluster. * Mixed prototypes can have different distributions for * each dimension. All dimensions are independent. The * structure is initially filled in as though it were an * elliptical prototype. The actual distributions of the * dimensions can be altered by other routines. * @param N

Source from the content-addressed store, hash-verified

1580 * @note History: 6/19/89, DSJ, Created.
1581 */
1582PROTOTYPE *NewMixedProto(inT16 N, CLUSTER *Cluster, STATISTICS *Statistics) {
1583 PROTOTYPE *Proto;
1584 int i;
1585
1586 Proto = NewEllipticalProto (N, Cluster, Statistics);
1587 Proto->Distrib = (DISTRIBUTION *) Emalloc (N * sizeof (DISTRIBUTION));
1588
1589 for (i = 0; i < N; i++) {
1590 Proto->Distrib[i] = normal;
1591 }
1592 Proto->Style = mixed;
1593 return (Proto);
1594} // NewMixedProto
1595
1596/**
1597 * This routine allocates memory to hold a simple prototype

Callers 2

MakeDegenerateProtoFunction · 0.85
MakeMixedProtoFunction · 0.85

Calls 2

NewEllipticalProtoFunction · 0.85
EmallocFunction · 0.85

Tested by

no test coverage detected