Logo Search packages:      
Sourcecode: ocropus version File versions  Download package

colib Namespace Reference


Detailed Description

Miscellaneous array utility functions.


Classes

class  autodel
 Automatic deletion, linear assignment. More...
class  autofree
 A simple smart pointer class for holding malloc-allocated pointers. More...
class  autoref
 Automatic allocation and deletion, linear assignment. More...
struct  Boolean
 Boolean values, initialized to false; useful with hashtable implementations. More...
class  check_narray_nomod
 Temporary arrays. More...
class  Classifier
class  cleanup
 General class for remembering cleanup actions (e.g., for pointers). More...
class  Density
struct  floating
 Floating point values initialized to the given value; useful with hashtable implementations. More...
struct  IBinarize
 Perform binarization of grayscale images. More...
struct  ICharacterClassifier
struct  ICleanupBinary
 Cleanup for binary document images. More...
struct  ICleanupGray
 Cleanup for gray scale document images. More...
struct  IComponent
 Base class for OCR interfaces. More...
struct  IGenericFst
 A generic interface for language models. More...
class  int2hash
 A simple pair-of-int-to-something hash class. More...
struct  integer
 Integer values initialized to the given value; useful with hashtable implementations. More...
class  inthash
 A simple int-to-something hash class. More...
struct  IRecognizeLine
 A generic interface for text line recognition. More...
struct  ISegmentLine
 Compute line segmentation into character hypotheses. More...
struct  ISegmentPage
 Compute page segmentation into columns, lines, etc. More...
struct  ITextImageClassification
 Compute text/image probabilities. More...
class  narray
 Multidimensional array class. More...
class  NBest
struct  nuchar
class  nustring
class  objlist
 Wrapper for narray that makes lists of objects less painful. More...
class  param_bool
class  param_double
class  param_float
class  param_int
class  param_string
struct  point
struct  rectangle
class  stdio
 A simple class for holding stdio streams. More...
struct  strbuf
class  strhash
 A string-to-something hash class. More...
struct  utf8buf
struct  vec2

Typedefs

typedef unsigned char byte
typedef narray< unsigned char > bytearray
typedef narray< double > doublearray
typedef narray< float > floatarray
typedef narray< int > intarray
typedef narray< long > longarray
typedef narray< rectangle > rectarray
typedef narray< short > shortarray
typedef narray< vec2 > vec2array

Functions

template<class T>
abs (T x)
 Absolute value of a value.
template<class T>
void add (narray< T > &result, narray< T > &data)
 Add the data to the result.
template<class T>
void addscaled (narray< T > &result, narray< T > &data, double scale)
 Multiply the data with scale and add to result.
template<class T>
int argmax (narray< T > &a)
 Compute the argmax of the rank-1 array.
template<class T>
int argmin (narray< T > &a)
 Compute the argmin of the rank-1 array.
template<class T>
T & bat (narray< T > &a, int i, int j)
 Array subscripting with fixed boundary conditions.
template<class T>
T & bat (narray< T > &a, int i)
 Array subscripting with fixed boundary conditions.
template<class T>
bat (narray< T > &a, int i, int j, T value)
 Array subscripting with fixed boundary conditions.
template<class T>
bat (narray< T > &a, int i, T value)
 Array subscripting with fixed boundary conditions.
template<class T>
void check_rowsorted (narray< T > &data, intarray &permutation)
template<class T>
void check_rowsorted (narray< T > &data)
template<class T, class S>
void copy (narray< T > &dest, const narray< S > &src)
static bool decode_nuchar (nuchar &c, int &offset, const char *utf8, int n)
template<class T>
static void delete_at (narray< T > &a, int i)
double dist2 (floatarray &a, floatarray &b)
 Euclidean distance.
double dist2squared (floatarray &a, floatarray &b)
 Euclidean distance squared.
static int encode_nuchar (narray< char > &utf8, nuchar c)
template<class T>
bool equal (narray< T > &a, narray< T > &b)
 Check whether two narrays are equal (mostly for testing).
template<class T>
T & ext (narray< T > &a, int i, int j)
 Array subscripting with extending boundary conditions.
template<class T>
T & ext (narray< T > &a, int i)
 Array subscripting with extending boundary conditions.
template<class T, class S>
void fill (narray< T > &a, S value)
 Initializing/setting the value.
template<class T, class S>
int first_index_of (narray< T > &a, S target)
template<class T>
fractile (narray< T > &a, double f)
 Compute fractiles.
const char * getenv_ (const char *name, const char *dflt)
int hash_next (int size)
int hash_value (const char *p, int n)
int hash_value (int key1, int key2, int n)
int hash_value (int key, int n)
template<class T>
heaviside (T x)
 Heaviside function of a value.
template<class T>
static void insert_at (narray< T > &a, int i, T value)
template<class T>
static void insert_at (narray< T > &a, int i)
template<class T>
void iota (narray< T > &v, int n)
 Make a vector of length n with entries from 0 to n-1.
void make_random (floatarray &v, int n, float scale)
 Make a random vector of length n with uniformly random values between -scale and scale.
void make_unit_vector (floatarray &a, int n, int i)
 Make a unit vector of length n with a 1 in position i.
template<class T, class S>
void makelike (narray< T > &a, narray< S > &b)
 Make the first array have the same dimensions as the second array.
const char * malloc_utf8_encode (intarray &data)
template<class T>
max (narray< T > &a)
 Compute the global max of the array.
template<class T, class U>
max (T a, U b)
 The max of two integer values.
template<class T>
min (narray< T > &a)
 Compute the global min of the array.
template<class T, class U>
min (T a, U b)
 The min of two integer values.
template<class T>
void move (narray< T > &out, objlist< T > &in)
template<class T>
void move (narray< T > &dest, narray< T > &src)
double norm2 (floatarray &a)
 Euclidean norm.
double norm2squared (floatarray &a)
 Euclidean norm squared.
void normalize2 (floatarray &a)
 Normalize the Euclidean norm of the array.
static int nustring_length (unsigned char a)
template<class T>
void permute (narray< T > &data, narray< int > &permutation)
 Permute the elements of an array given a permutation.
template<class T>
void permute_move (narray< T > &data, narray< int > &permutation)
void perturb (floatarray &v, float scale)
 Perturb the array with uniformly random values between -scale and scale.
template<class T>
void pick (narray< T > &data, narray< T > &source, narray< int > &indexes)
 Select elements with the given indexes.
template<class T>
double product (narray< T > &data)
 The product of the values of the array.
template<class T>
void quicksort (narray< T > &values)
 Quicksort the elements of an array in place.
template<class T>
void quicksort (narray< T > &values, int start, int end)
template<class T>
void quicksort (narray< int > &index, narray< T > &values)
 Quicksort an array, generating a permutation of the indexes.
template<class T>
void quicksort (narray< int > &index, narray< T > &values, int start, int end)
template<class T>
void quicksort_perm (narray< T > &data)
template<class T>
void randomly_permute (narray< T > &v)
 Randomly permute the elements of a vector.
template<class T>
void remove_element (narray< T > &a, int index)
template<class T>
void remove_left (narray< T > &a, int offset)
 reverse an array
template<class T, class S>
void remove_value (narray< T > &a, S v)
template void reverse (vec2array &)
template<class T>
void reverse (narray< T > &out)
 reverse an array in place
template<class T>
void reverse (narray< T > &out, narray< T > &in)
 reverse an array
template<class T>
int rowargmax (narray< T > &values, int i)
template<class T>
int rowargmin (narray< T > &values, int i)
template<class T>
int rowcompare (narray< T > &values, int i, int j)
template<class T, class S>
void rowcopy (narray< T > &a, narray< S > &b, int i)
template<class T, class S>
void rowcopy (narray< T > &a, int i, narray< S > &b)
template<class T>
void rowcopy (narray< T > &values, int i, int j)
template<class T>
int rowduplicates (narray< T > &data, intarray &permutation)
template<class T>
int rowduplicates (narray< T > &data)
template<class T>
T & rowmax (narray< T > &values, int i)
template<class T>
T & rowmin (narray< T > &values, int i)
template<class T>
void rowpermute (narray< T > &data, narray< int > &permutation)
 Permute the elements of an array given a permutation.
template<class T>
int rowprefixselect (intarray &matching, narray< T > &table, narray< T > &prefix)
 Select all the rows matching a given prefix.
template<class T>
void rowpush (narray< T > &table, narray< T > &data)
template<class T>
void rowsort (narray< T > &data)
template<class T>
void rowsort (narray< int > &index, narray< T > &values)
 Quicksort the rows of a 2D array, generating a permutation of the indexes.
template<class T>
void rowsort (narray< int > &index, narray< T > &values, int start, int end)
template<class T>
bool rowsorted (narray< T > &data, intarray &permutation)
template<class T>
bool rowsorted (narray< T > &data)
template<class T>
void rowswap (narray< T > &values, int i, int j)
template<class T, class S>
bool samedims (narray< T > &a, narray< S > &b)
 Check whether two narrays have the same rank and sizes.
template<class T>
sqr (T x)
 Square of a value.
template<class T>
double sum (narray< T > &data)
 Sum the values of the array.
template<class T, class S>
void swap (T &a, S &b)
 Swap two values.
template<class T>
void swap (T &a, T &b)
template<class T>
void swap (narray< T > &dest, narray< T > &src)
template<class T>
void swap_ (T &a, T &b)
void utf8_decode (intarray &result, const char *s, int n=-1)
void utf8_encode (bytearray &s, intarray &a)
void utf8_encode (narray< char > &s, intarray &a)

Variables

const int hash_empty = 999999


Generated by  Doxygen 1.6.0   Back to index