class EditDistance

This class can be used to compute the "edit distance" between two sequences.

Inheritance:


Public Fields

[more]real accuracy
the total edit distance between two sequences
[more]int n_insert
the number of insertions (weighted by their cost)
[more]int n_delete
the number of deletions (weighted by their cost)
[more]int n_subst
the number of substitutions (weighted by their cost)
[more]int n_seq
the number of sequences measured (used to normalize dist by n_seq)
[more]int insert_cost
the cost of one insertion
[more]int delete_cost
the cost of one deletion
[more]int subst_cost
the cost of one substitution
[more]int* obtained
the obtained sequence
[more]int obt_size
the size of the obtained sequence
[more]int* desired
the desired sequence
[more]int des_size
the size of the desired sequence

Public Methods

[more] EditDistance()
[more]virtual void setCosts(int i_cost, int d_cost, int s_cost)
sets the different costs
[more]virtual void distance(int* obtained, int obt_size, int* desired, int des_size)
computes the edit distance between obtained and desired
[more]virtual void add(EditDistance* d)
accumulates the distances of the current object and the given object
[more]virtual void print(FILE* f)
prints the edit distance and optionally the sequences
[more]virtual void printRatio(FILE* f)
prints the edit distance ratio (divided by the number of sequnces) and optionally the obtained and desired sequences


Inherited from Object:

Public Methods

ovirtual void init()
ovoid addOption(const char* name, int size, void* ptr, const char* help="", bool is_allowed_after_init=false)
ovoid addIOption(const char* name, int* ptr, int init_value, const char* help="", bool is_allowed_after_init=false)
ovoid addROption(const char* name, real* ptr, real init_value, const char* help="", bool is_allowed_after_init=false)
ovoid addBOption(const char* name, bool* ptr, bool init_value, const char* help="", bool is_allowed_after_init=false)
ovoid setOption(const char* name, void* ptr)
ovoid setIOption(const char* name, int option)
ovoid setROption(const char* name, real option)
ovoid setBOption(const char* name, bool option)
ovirtual void loadFILE(FILE* file)
ovirtual void saveFILE(FILE* file)
ovoid load(const char* filename)
ovoid save(const char* filename)


Documentation

This class can be used to compute the "edit distance" between two sequences. It computes the number of insertions, deletions and substitutions. The overall distance is the sum of these numbers weighted by their cost (which are intergers equal to 1 by default).

oreal accuracy
the total edit distance between two sequences

oint n_insert
the number of insertions (weighted by their cost)

oint n_delete
the number of deletions (weighted by their cost)

oint n_subst
the number of substitutions (weighted by their cost)

oint n_seq
the number of sequences measured (used to normalize dist by n_seq)

oint insert_cost
the cost of one insertion

oint delete_cost
the cost of one deletion

oint subst_cost
the cost of one substitution

oint* obtained
the obtained sequence

oint obt_size
the size of the obtained sequence

oint* desired
the desired sequence

oint des_size
the size of the desired sequence

o EditDistance()

ovirtual void setCosts(int i_cost, int d_cost, int s_cost)
sets the different costs

ovirtual void distance(int* obtained, int obt_size, int* desired, int des_size)
computes the edit distance between obtained and desired

ovirtual void add(EditDistance* d)
accumulates the distances of the current object and the given object

ovirtual void print(FILE* f)
prints the edit distance and optionally the sequences

ovirtual void printRatio(FILE* f)
prints the edit distance ratio (divided by the number of sequnces) and optionally the obtained and desired sequences


This class has no child classes.
Author:
Samy Bengio (bengio@idiap.ch)

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.