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

Function NewAdaptedClass

deps/tesseract/classify/adaptive.cpp:113–132  ·  view source on GitHub ↗

---------------------------------------------------------------------------*/ * This operation allocates and initializes a new adapted * class data structure and returns a ptr to it. * * @return Ptr to new class data structure. * * @note Globals: none * @note Exceptions: none * @note History: Thu Mar 14 12:58:13 1991, DSJ, Created. */

Source from the content-addressed store, hash-verified

111 * @note History: Thu Mar 14 12:58:13 1991, DSJ, Created.
112 */
113ADAPT_CLASS NewAdaptedClass() {
114 ADAPT_CLASS Class;
115 int i;
116
117 Class = (ADAPT_CLASS) Emalloc (sizeof (ADAPT_CLASS_STRUCT));
118 Class->NumPermConfigs = 0;
119 Class->MaxNumTimesSeen = 0;
120 Class->TempProtos = NIL_LIST;
121
122 Class->PermProtos = NewBitVector (MAX_NUM_PROTOS);
123 Class->PermConfigs = NewBitVector (MAX_NUM_CONFIGS);
124 zero_all_bits (Class->PermProtos, WordsInVectorOfSize (MAX_NUM_PROTOS));
125 zero_all_bits (Class->PermConfigs, WordsInVectorOfSize (MAX_NUM_CONFIGS));
126
127 for (i = 0; i < MAX_NUM_CONFIGS; i++)
128 TempConfigFor (Class, i) = NULL;
129
130 return (Class);
131
132} /* NewAdaptedClass */
133
134
135/*-------------------------------------------------------------------------*/

Callers 1

NewAdaptedTemplatesMethod · 0.85

Calls 2

EmallocFunction · 0.85
NewBitVectorFunction · 0.85

Tested by

no test coverage detected