#include "bitvec.h"
#include "params.h"
#include "unichar.h"
#include "unicity_table.h"
Go to the source code of this file.
|
#define | NUMBER_OF_CLASSES MAX_NUM_CLASSES |
|
#define | Y_OFFSET -40.0 |
|
#define | FEATURE_SCALE 100.0 |
|
#define | AddProtoToConfig(Pid, Config) (SET_BIT(Config, Pid)) |
|
#define | RemoveProtoFromConfig(Pid, Config) (reset_bit(Config, Pid)) |
|
#define | ClassOfChar(Char) ((TrainingData[Char].NumProtos) ? (&TrainingData[Char]) : NO_CLASS) |
|
#define | ProtoIn(Class, Pid) (&(Class)->Prototypes[Pid]) |
|
#define | PrintProto(Proto) |
|
#define | PrintProtoLine(Proto) (cprintf("A=%4.2f, B=%4.2f, C=%4.2f", Proto->A, Proto->B, Proto->C)) |
|
◆ AddProtoToConfig
AddProtoToConfig
Set a single proto bit in the specified configuration.
Definition at line 95 of file protos.h.
◆ ClassOfChar
ClassOfChar
Return the class of a particular ASCII character value.
Definition at line 111 of file protos.h.
◆ FEATURE_SCALE
#define FEATURE_SCALE 100.0 |
◆ NUMBER_OF_CLASSES
◆ PrintProto
#define PrintProto |
( |
|
Proto | ) |
|
Value:(
tprintf(
"X=%4.2f, Y=%4.2f, Length=%4.2f, Angle=%4.2f", Proto->X, Proto->Y, \
Proto->Length, Proto->Angle))
DLLSYM void tprintf(const char *format,...)
PrintProto
Print out the contents of a prototype. The 'Proto' argument is of type 'PROTO'.
Definition at line 130 of file protos.h.
◆ PrintProtoLine
#define PrintProtoLine |
( |
|
Proto | ) |
(cprintf("A=%4.2f, B=%4.2f, C=%4.2f", Proto->A, Proto->B, Proto->C)) |
PrintProtoLine
Print out the contents of a prototype. The 'Proto' argument is of type 'PROTO'.
Definition at line 141 of file protos.h.
◆ ProtoIn
#define ProtoIn |
( |
|
Class, |
|
|
|
Pid |
|
) |
| (&(Class)->Prototypes[Pid]) |
ProtoIn
Choose the selected prototype in this class record. Return the pointer to it (type PROTO).
Definition at line 121 of file protos.h.
◆ RemoveProtoFromConfig
RemoveProtoFromConfig
Clear a single proto bit in the specified configuration.
Definition at line 103 of file protos.h.
◆ Y_OFFSET
◆ CLASS_TYPE
◆ CLASSES
◆ CONFIGS
◆ PROTO
◆ AddConfigToClass()
Definition at line 60 of file protos.cpp.
#define WordsInVectorOfSize(NumBits)
#define zero_all_bits(array, length)
BIT_VECTOR NewBitVector(int NumBits)
void * Erealloc(void *ptr, int size)
◆ AddProtoToClass()
Definition at line 96 of file protos.cpp.
118 for (Bit = Class->
NumProtos; Bit < NewNumProtos; Bit++)
124 tprintf(
"Ouch! number of protos = %d, vs max of %d!",
DLLSYM void tprintf(const char *format,...)
BIT_VECTOR ExpandBitVector(BIT_VECTOR Vector, int NewNumBits)
#define reset_bit(array, bit)
void * Erealloc(void *ptr, int size)
◆ ClassConfigLength()
Definition at line 139 of file protos.cpp.
141 float TotalLength = 0;
143 for (Pid = 0; Pid < Class->
NumProtos; Pid++) {
146 TotalLength += (
ProtoIn (Class, Pid))->Length;
149 return (TotalLength);
#define ProtoIn(Class, Pid)
#define test_bit(array, bit)
◆ ClassProtoLength()
Definition at line 160 of file protos.cpp.
162 float TotalLength = 0;
164 for (Pid = 0; Pid < Class->
NumProtos; Pid++) {
165 TotalLength += (
ProtoIn (Class, Pid))->Length;
167 return (TotalLength);
#define ProtoIn(Class, Pid)
◆ CopyProto()
◆ FillABC()
void FillABC |
( |
PROTO |
Proto | ) |
|
Definition at line 195 of file protos.cpp.
196 float Slope, Intercept, Normalizer;
198 Slope = tan(Proto->
Angle * 2.0 * M_PI);
199 Intercept = Proto->
Y - Slope * Proto->
X;
200 Normalizer = 1.0 / sqrt (Slope * Slope + 1.0);
201 Proto->
A = Slope * Normalizer;
202 Proto->
B = -Normalizer;
203 Proto->
C = Intercept * Normalizer;
◆ FreeClass()
Definition at line 212 of file protos.cpp.
void FreeClassFields(CLASS_TYPE Class)
◆ FreeClassFields()
Definition at line 225 of file protos.cpp.
void FreeBitVector(BIT_VECTOR BitVector)
◆ InitPrototypes()
◆ NewClass()
CLASS_TYPE NewClass |
( |
int |
NumProtos, |
|
|
int |
NumConfigs |
|
) |
| |
◆ PrintProtos()
Definition at line 269 of file protos.cpp.
272 for (Pid = 0; Pid < Class->
NumProtos; Pid++) {
void cprintf(const char *format,...)
#define ProtoIn(Class, Pid)
DLLSYM void tprintf(const char *format,...)
#define PrintProtoLine(Proto)
#define PrintProto(Proto)
◆ classify_training_file
char* classify_training_file = "MicroFeatures" |
◆ TrainingData