edu.umd.hooka.ttables
Class TTable_monolithic

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

public class TTable_monolithic
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_monolithic()
           
TTable_monolithic(FileSystem fs, Path p)
           
TTable_monolithic(int[] e, int[] ef, int maxF)
           
TTable_monolithic(int[] e, int[] ef, int maxF, FileSystem fs, Path p)
           
 
Method Summary
 void add(int e, int f, float delta)
           
 void clear()
           
 Object clone()
           
 float get(int e, int f)
           
 int getMaxE()
           
 int getMaxF()
           
 void normalize()
           
 void prune(float threshold)
           
 void readFields(DataInput in)
           
 void set(int e, IndexedFloatArray fs)
           
 void set(int e, int f, float value)
           
 void setDistribution(float[] x)
           
 void setNullDistribution(float[] x)
           
 String toString()
           
 void write()
           
 void write(DataOutput out)
           
 
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_monolithic

public TTable_monolithic()

TTable_monolithic

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

TTable_monolithic

public TTable_monolithic(int[] e,
                         int[] ef,
                         int maxF)

TTable_monolithic

public TTable_monolithic(int[] e,
                         int[] ef,
                         int maxF,
                         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

setDistribution

public void setDistribution(float[] x)

setNullDistribution

public void setNullDistribution(float[] x)

set

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

get

public float get(int e,
                 int f)
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

readFields

public void readFields(DataInput in)
                throws IOException
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

write

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