edu.umd.hooka.ttables
Class TTable_sliced

java.lang.Object
  extended by edu.umd.hooka.ttables.TTable
      extended by edu.umd.hooka.ttables.TTable_sliced
All Implemented Interfaces:
Cloneable

public class TTable_sliced
extends TTable
implements Cloneable

Data structure that stores translation probabilities p(f|e) or counts c(f,e). The set of values (*,e) associated with a particular e are stored adjacent to one another in an array. For a given f in (f,e) the location of the f is found using a binary search. Layout: http://www.umiacs.umd.edu/~redpony/ttable-structure.png

Author:
redpony

Constructor Summary
TTable_sliced()
           
TTable_sliced(FileSystem fs, Path p)
           
TTable_sliced(int e_voc_size)
           
TTable_sliced(int e_voc_size, FileSystem fs, Path p)
           
 
Method Summary
 void add_addr(long coord, float delta)
           
 void add(int e, int f, float delta)
           
 void clear()
           
 Object clone()
           
 float get(int e, int f)
          public void plusEquals(int e, IndexedFloatArray fs) { checkE(e); _data[e].plusEquals(fs); }
 long getCoord(int e, int f)
           
 int getMaxE()
           
 int getMaxF()
           
 void normalize()
           
 void prune(float threshold)
           
 void set(int e, IndexedFloatArray fs)
           
 void set(int e, int f, float value)
           
 String toString()
           
 void write()
           
 
Methods inherited from class edu.umd.hooka.ttables.TTable
prepare
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TTable_sliced

public TTable_sliced()

TTable_sliced

public TTable_sliced(int e_voc_size)

TTable_sliced

public TTable_sliced(FileSystem fs,
                     Path p)
              throws IOException
Throws:
IOException

TTable_sliced

public TTable_sliced(int e_voc_size,
                     FileSystem fs,
                     Path p)
Method Detail

clone

public Object clone()
Specified by:
clone in class TTable

getMaxF

public int getMaxF()

getMaxE

public int getMaxE()

add

public void add(int e,
                int f,
                float delta)
Specified by:
add in class TTable

set

public void set(int e,
                int f,
                float value)
Specified by:
set in class TTable

getCoord

public long getCoord(int e,
                     int f)

add_addr

public void add_addr(long coord,
                     float delta)

set

public void set(int e,
                IndexedFloatArray fs)
Specified by:
set in class TTable

get

public float get(int e,
                 int f)
public void plusEquals(int e, IndexedFloatArray fs) { checkE(e); _data[e].plusEquals(fs); }

Specified by:
get in class TTable

clear

public void clear()
Specified by:
clear in class TTable

prune

public void prune(float threshold)

normalize

public void normalize()
Specified by:
normalize in class TTable

toString

public String toString()
Overrides:
toString in class Object

write

public void write()
           throws IOException
Specified by:
write in class TTable
Throws:
IOException