1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>class EditDistance</TITLE>
<META NAME="GENERATOR" CONTENT="DOC++ 3.4.8">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H2>class <A HREF="#DOC.DOCU">EditDistance</A></H2></H2><BLOCKQUOTE>This class can be used to compute the "edit distance" between two sequences.</BLOCKQUOTE>
<HR>
<H2>Inheritance:</H2>
<APPLET CODE="ClassGraph.class" WIDTH=600 HEIGHT=65>
<param name=classes value="CObject,MObject.html,CEditDistance,MEditDistance.html">
<param name=before value="M,M">
<param name=after value="Md_,M">
<param name=indent value="0,1">
<param name=arrowdir value="down">
</APPLET>
<HR>
<DL>
<P><DL>
<DT><H3>Public Fields</H3><DD><DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>real <B><A HREF="#DOC.94.1">accuracy</A></B>
<DD><I>the total edit distance between two sequences</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.94.2">n_insert</A></B>
<DD><I>the number of insertions (weighted by their cost)</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.94.3">n_delete</A></B>
<DD><I>the number of deletions (weighted by their cost)</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.94.4">n_subst</A></B>
<DD><I>the number of substitutions (weighted by their cost)</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.94.5">n_seq</A></B>
<DD><I>the number of sequences measured (used to normalize <TT>dist</TT> by <TT>n_seq</TT>)</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.94.6">insert_cost</A></B>
<DD><I>the cost of one insertion</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.94.7">delete_cost</A></B>
<DD><I>the cost of one deletion</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.94.8">subst_cost</A></B>
<DD><I>the cost of one substitution</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int* <B><A HREF="#DOC.94.9">obtained</A></B>
<DD><I>the obtained sequence</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.94.10">obt_size</A></B>
<DD><I>the size of the obtained sequence</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int* <B><A HREF="#DOC.94.11">desired</A></B>
<DD><I>the desired sequence</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.94.12">des_size</A></B>
<DD><I>the size of the desired sequence</I>
</DL></P>
<P><DL>
<DT><H3>Public Methods</H3><DD><DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif> <B><A HREF="#DOC.94.13">EditDistance</A></B>()
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>virtual void <B><A HREF="#DOC.94.14">setCosts</A></B>(int i_cost, int d_cost, int s_cost)
<DD><I>sets the different costs</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>virtual void <B><A HREF="#DOC.94.15">distance</A></B>(int* <!1><A HREF="EditDistance.html#DOC.94.9">obtained</A>, int <!1><A HREF="EditDistance.html#DOC.94.10">obt_size</A>, int* <!1><A HREF="EditDistance.html#DOC.94.11">desired</A>, int <!1><A HREF="EditDistance.html#DOC.94.12">des_size</A>)
<DD><I>computes the edit distance between <TT>obtained</TT> and <TT>desired</TT></I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>virtual void <B><A HREF="#DOC.94.16">add</A></B>(<!1><A HREF="EditDistance.html">EditDistance</A>* d)
<DD><I>accumulates the distances of the current object and the given object</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>virtual void <B><A HREF="#DOC.94.17">print</A></B>(FILE* f)
<DD><I>prints the edit distance and optionally the sequences</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>virtual void <B><A HREF="#DOC.94.18">printRatio</A></B>(FILE* f)
<DD><I>prints the edit distance ratio (divided by the number of sequnces) and optionally the obtained and desired sequences</I>
</DL></P>
</DL>
<HR><H3>Inherited from <A HREF="Object.html">Object</A>:</H3>
<DL>
<P><DL>
<DT><H3>Public Methods</H3><DD><DT>
<IMG ALT="o" SRC=icon2.gif>virtual void <B>init</B>()
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>addOption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, int size, void* <!1><A HREF="Vec.html#DOC.81.3">ptr</A>, const char* <!1><A HREF="CmdLine.html#DOC.7.3">help</A>="", bool is_allowed_after_init=false)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>addIOption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, int* <!1><A HREF="Vec.html#DOC.81.3">ptr</A>, int init_value, const char* <!1><A HREF="CmdLine.html#DOC.7.3">help</A>="", bool is_allowed_after_init=false)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>addROption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, real* <!1><A HREF="Vec.html#DOC.81.3">ptr</A>, real init_value, const char* <!1><A HREF="CmdLine.html#DOC.7.3">help</A>="", bool is_allowed_after_init=false)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>addBOption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, bool* <!1><A HREF="Vec.html#DOC.81.3">ptr</A>, bool init_value, const char* <!1><A HREF="CmdLine.html#DOC.7.3">help</A>="", bool is_allowed_after_init=false)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>setOption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, void* <!1><A HREF="Vec.html#DOC.81.3">ptr</A>)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>setIOption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, int option)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>setROption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, real option)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>setBOption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, bool option)
<DT>
<IMG ALT="o" SRC=icon2.gif>virtual void <B>loadFILE</B>(FILE* <!1><A HREF="Measurer.html#DOC.30.2">file</A>)
<DT>
<IMG ALT="o" SRC=icon2.gif>virtual void <B>saveFILE</B>(FILE* <!1><A HREF="Measurer.html#DOC.30.2">file</A>)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>load</B>(const char* filename)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>save</B>(const char* filename)
</DL></P>
</DL>
<A NAME="DOC.DOCU"></A>
<HR>
<H2>Documentation</H2>
<BLOCKQUOTE>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).
<P></BLOCKQUOTE>
<DL>
<A NAME="accuracy"></A>
<A NAME="DOC.94.1"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>real accuracy</B></TT>
<DD>the total edit distance between two sequences
<DL><DT><DD></DL><P>
<A NAME="n_insert"></A>
<A NAME="DOC.94.2"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int n_insert</B></TT>
<DD>the number of insertions (weighted by their cost)
<DL><DT><DD></DL><P>
<A NAME="n_delete"></A>
<A NAME="DOC.94.3"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int n_delete</B></TT>
<DD>the number of deletions (weighted by their cost)
<DL><DT><DD></DL><P>
<A NAME="n_subst"></A>
<A NAME="DOC.94.4"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int n_subst</B></TT>
<DD>the number of substitutions (weighted by their cost)
<DL><DT><DD></DL><P>
<A NAME="n_seq"></A>
<A NAME="DOC.94.5"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int n_seq</B></TT>
<DD>the number of sequences measured (used to normalize <TT>dist</TT> by <TT>n_seq</TT>)
<DL><DT><DD></DL><P>
<A NAME="insert_cost"></A>
<A NAME="DOC.94.6"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int insert_cost</B></TT>
<DD>the cost of one insertion
<DL><DT><DD></DL><P>
<A NAME="delete_cost"></A>
<A NAME="DOC.94.7"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int delete_cost</B></TT>
<DD>the cost of one deletion
<DL><DT><DD></DL><P>
<A NAME="subst_cost"></A>
<A NAME="DOC.94.8"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int subst_cost</B></TT>
<DD>the cost of one substitution
<DL><DT><DD></DL><P>
<A NAME="obtained"></A>
<A NAME="DOC.94.9"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int* obtained</B></TT>
<DD>the obtained sequence
<DL><DT><DD></DL><P>
<A NAME="obt_size"></A>
<A NAME="DOC.94.10"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int obt_size</B></TT>
<DD>the size of the obtained sequence
<DL><DT><DD></DL><P>
<A NAME="desired"></A>
<A NAME="DOC.94.11"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int* desired</B></TT>
<DD>the desired sequence
<DL><DT><DD></DL><P>
<A NAME="des_size"></A>
<A NAME="DOC.94.12"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int des_size</B></TT>
<DD>the size of the desired sequence
<DL><DT><DD></DL><P>
<A NAME="EditDistance"></A>
<A NAME="DOC.94.13"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> EditDistance()</B></TT>
<DL><DT><DD></DL><P>
<A NAME="setCosts"></A>
<A NAME="DOC.94.14"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>virtual void setCosts(int i_cost, int d_cost, int s_cost)</B></TT>
<DD>sets the different costs
<DL><DT><DD></DL><P>
<A NAME="distance"></A>
<A NAME="DOC.94.15"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>virtual void distance(int* <!1><A HREF="EditDistance.html#DOC.94.9">obtained</A>, int <!1><A HREF="EditDistance.html#DOC.94.10">obt_size</A>, int* <!1><A HREF="EditDistance.html#DOC.94.11">desired</A>, int <!1><A HREF="EditDistance.html#DOC.94.12">des_size</A>)</B></TT>
<DD>computes the edit distance between <TT>obtained</TT> and <TT>desired</TT>
<DL><DT><DD></DL><P>
<A NAME="add"></A>
<A NAME="DOC.94.16"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>virtual void add(<!1><A HREF="EditDistance.html">EditDistance</A>* d)</B></TT>
<DD>accumulates the distances of the current object and the given object
<DL><DT><DD></DL><P>
<A NAME="print"></A>
<A NAME="DOC.94.17"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>virtual void print(FILE* f)</B></TT>
<DD>prints the edit distance and optionally the sequences
<DL><DT><DD></DL><P>
<A NAME="printRatio"></A>
<A NAME="DOC.94.18"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>virtual void printRatio(FILE* f)</B></TT>
<DD>prints the edit distance ratio (divided by the number of sequnces)
and optionally the obtained and desired sequences
<DL><DT><DD></DL><P></DL>
<HR><DL><DT><B>This class has no child classes.</B></DL>
<DL><DT><DT><B>Author:</B><DD>Samy Bengio (bengio@idiap.ch)
<DD></DL><P><P><I><A HREF="index.html">Alphabetic index</A></I> <I><A HREF="HIER.html">HTML hierarchy of classes</A> or <A HREF="HIERjava.html">Java</A></I></P><HR>
<BR>
This page was generated with the help of <A HREF="http://docpp.sourceforge.net">DOC++</A>.
</BODY>
</HTML>
|