Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MATRIX Class Reference

#include <matrix.h>

Inheritance diagram for MATRIX:
GENERIC_MATRIX< BLOB_CHOICE_LIST * > GENERIC_2D_ARRAY< BLOB_CHOICE_LIST * >

Public Member Functions

 MATRIX (int dimension)
 
void print (const UNICHARSET &unicharset) const
 
- Public Member Functions inherited from GENERIC_MATRIX< BLOB_CHOICE_LIST * >
 GENERIC_MATRIX (int dimension, const BLOB_CHOICE_LIST *&empty)
 
int dimension () const
 
- Public Member Functions inherited from GENERIC_2D_ARRAY< BLOB_CHOICE_LIST * >
 GENERIC_2D_ARRAY (int dim1, int dim2, const BLOB_CHOICE_LIST *&empty)
 
 ~GENERIC_2D_ARRAY ()
 
bool Serialize (FILE *fp) const
 
bool DeSerialize (bool swap, FILE *fp)
 
bool SerializeClasses (FILE *fp) const
 
bool DeSerializeClasses (bool swap, FILE *fp)
 
int dim1 () const
 
int dim2 () const
 
int index (int column, int row) const
 
void put (int column, int row, const BLOB_CHOICE_LIST *&thing)
 
BLOB_CHOICE_LIST * get (int column, int row) const
 
const BLOB_CHOICE_LIST *& operator() (int column, int row) const
 
BLOB_CHOICE_LIST *& operator() (int column, int row)
 
BLOB_CHOICE_LIST ** operator[] (int column)
 
void delete_matrix_pointers ()
 

Detailed Description

Definition at line 193 of file matrix.h.

Constructor & Destructor Documentation

MATRIX::MATRIX ( int  dimension)
inline

Member Function Documentation

void MATRIX::print ( const UNICHARSET unicharset) const

Definition at line 36 of file matrix.cpp.

36  {
37  tprintf("Ratings Matrix (top choices)\n");
38  int row, col;
39  for (col = 0; col < this->dimension(); ++col) tprintf("\t%d", col);
40  tprintf("\n");
41  for (row = 0; row < this->dimension(); ++row) {
42  for (col = 0; col <= row; ++col) {
43  if (col == 0) tprintf("%d\t", row);
44  BLOB_CHOICE_LIST *rating = this->get(col, row);
45  if (rating != NOT_CLASSIFIED) {
46  BLOB_CHOICE_IT b_it(rating);
47  int counter = 0;
48  for (b_it.mark_cycle_pt(); !b_it.cycled_list(); b_it.forward()) {
49  tprintf("%s ", unicharset.id_to_unichar(b_it.data()->unichar_id()));
50  ++counter;
51  if (counter == 3) break;
52  }
53  tprintf("\t");
54  } else {
55  tprintf(" \t");
56  }
57  }
58  tprintf("\n");
59  }
60 }
const char *const id_to_unichar(UNICHAR_ID id) const
Definition: unicharset.cpp:233
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:41
#define NOT_CLASSIFIED
Definition: matrix.h:31

The documentation for this class was generated from the following files: