|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTable
public class Table
Field Summary | |
---|---|
static boolean |
FLAG_DEBUG
|
static boolean |
FLAG_DEBUG_STATE_MODIFICATION
|
static double |
ONE
|
static double |
ZERO
|
Constructor Summary | |
---|---|
Table(FiniteVariable[] vars)
Creates a new table that has a TableIndex generated from the variables supplied. |
|
Table(List variables)
Creates a new table that has a TableIndex generated from the variables supplied. |
|
Table(List variables,
double[] values)
Creates a new table that has a TableIndex generated from the variables supplied. |
|
Table(Object[] vars,
double[] values)
Creates a new table that has a TableIndex generated from the variables supplied. |
|
Table(Table t)
Creates a copy of the table. |
|
Table(TableIndex index)
Creates a table with the supplied index. |
|
Table(TableIndex index,
double[] values)
Creates a new Table. |
|
Table(TableIndex index,
double[] values,
boolean strict)
|
Method Summary | |
---|---|
Table |
add(Table t)
Could return a Table or TableScaled. |
void |
addInto(Table t)
|
void |
addIntoTrivial(Table that)
|
void |
addIntoTrivialScale(Table that,
double scalar)
|
Object |
clone()
|
double[] |
dataclone()
|
static double |
distanceMeasure(double[] data1,
double[] data2)
|
double |
distanceMeasure(Table table2)
|
Table |
divide(Table t)
|
void |
divideInto(Table t)
|
boolean |
ensureCPTProperty(FiniteVariable var)
|
void |
ensureNonsingular()
|
double |
entropy()
|
boolean |
epsilonEquals(Table table,
double epsilon)
|
Table |
expand(FiniteVariable var)
|
void |
fill(double value)
|
Table |
forget(Set vars)
|
Table |
forget(Variable var)
|
double |
getCP(int ind)
|
int |
getCPLength()
|
double |
getCPScaled(int ind)
|
double |
getCPScaled(int[] indices)
|
TableIndex |
index()
Returns the TableIndex of this Table. |
static Table |
innerProduct(Table t1,
Table t2)
|
void |
insertState(int ind)
|
boolean |
isSingular()
|
boolean |
isValidProbability()
|
void |
makeUniform()
|
double |
max()
|
int |
maxInd()
|
double |
min()
|
Table |
multiply(Table t2)
|
static Table |
multiply(Table t1,
Table t2)
|
static Table |
multiplyAll(Set tables)
|
void |
multiplyInto(Table t2)
|
static double |
myLog(double arg)
|
void |
normalize()
|
void |
normalize(int conditionIndex)
|
static Table |
normalize(Table t)
|
void |
parentStateInserted(FiniteVariable parent,
int indexNewInstance)
|
void |
parentStateRemoved(FiniteVariable parent,
int indexRemovedInstance)
|
Table |
permute(FiniteVariable[] order)
|
static void |
printArr(double[] array,
PrintStream stream)
|
static void |
printArr(double[] array,
PrintWriter stream)
|
static void |
printArr(Table t,
PrintStream stream)
|
static void |
printArr(Table t,
PrintWriter stream)
|
static void |
printArrScaled(double[] array,
double scalar)
Calls TableScaled.toScaled on each value. |
static void |
printArrUnScaled(double[] array,
double scalar)
Calls TableScaled.toRealPr on each value. |
Table |
project(Set vars)
|
int |
random(Map mapInstantions)
|
void |
removeState(int ind)
|
void |
replaceVariables(Map old2new)
|
void |
replaceVariables(Map old2new,
boolean partial)
|
boolean |
satisfiesCPTProperty(FiniteVariable var,
double epsilon)
|
double |
scalar()
|
void |
scale(double scalar)
|
void |
set(Table t)
Copies the values from another compatible array. |
void |
setCP(int indx,
double val)
|
void |
setValue(int[] ind,
double val)
Sets the value of the table entry referenced by ind. |
void |
setValues(double[] valuesToSet)
|
Table |
shrink(Map evidence)
|
static Set |
shrinkAll(Collection tables,
Map evidence)
102502 Modified to accomodate CPTShell |
static double |
sum(double[] values,
int startindex,
int endindex)
|
String |
tableString()
|
String |
tableString(String tab)
|
String |
toString()
|
double |
value(int[] ind)
Returns the value of the table entry referenced by ind. |
double |
value(Object[] instantiations)
|
ArrayList |
valueElimination()
For any variable=state, if all possible combinations of other variables have prob=0, then this state can be removed. |
List |
variables()
Returns the variables that this Table contains. |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static double ZERO
public static double ONE
public static boolean FLAG_DEBUG
public static boolean FLAG_DEBUG_STATE_MODIFICATION
Constructor Detail |
---|
public Table(Table t)
public Table(TableIndex index)
public Table(TableIndex index, double[] values)
index
- This is used directly (not copied).values
- These are used directly (not copied).public Table(TableIndex index, double[] values, boolean strict)
public Table(List variables, double[] values)
values
- These are used directly (not copied).public Table(List variables)
public Table(FiniteVariable[] vars)
public Table(Object[] vars, double[] values)
values
- These are used directly (not copied).Method Detail |
---|
public double scalar()
public double getCPScaled(int ind)
public double getCPScaled(int[] indices)
public boolean isValidProbability()
public void normalize() throws Exception
Exception
public void normalize(int conditionIndex) throws Exception
Exception
public static double sum(double[] values, int startindex, int endindex) throws Exception
Exception
public void ensureNonsingular()
public boolean isSingular()
public void makeUniform()
public Object clone()
clone
in interface Potential
clone
in class Object
public void replaceVariables(Map old2new)
public void replaceVariables(Map old2new, boolean partial)
public static void printArr(double[] array, PrintWriter stream)
public static void printArr(double[] array, PrintStream stream)
public static void printArr(Table t, PrintWriter stream)
public static void printArr(Table t, PrintStream stream)
public static void printArrScaled(double[] array, double scalar)
public static void printArrUnScaled(double[] array, double scalar)
public void setValues(double[] valuesToSet)
public double[] dataclone()
public int getCPLength()
getCPLength
in interface CPTInfo.ReadableWritableTable
public double getCP(int ind)
getCP
in interface CPTInfo.ReadableWritableTable
public void setCP(int indx, double val)
setCP
in interface CPTInfo.ReadableWritableTable
public double max()
public double min()
public int random(Map mapInstantions)
public double value(int[] ind)
ind
- The the instance of each variable in the table.public double value(Object[] instantiations)
public void setValue(int[] ind, double val)
ind
- The the instance of each variable in the table.val
- The value to set the entry to.public TableIndex index()
public List variables()
variables
in interface Potential
public void fill(double value)
public void set(Table t)
public String toString()
toString
in class Object
public String tableString(String tab)
public String tableString()
public void multiplyInto(Table t2)
public static Table multiply(Table t1, Table t2)
public Table multiply(Table t2)
public static Table multiplyAll(Set tables)
public Table expand(FiniteVariable var)
public Table forget(Variable var)
public Table forget(Set vars)
public Table project(Set vars)
public void addInto(Table t)
public void addIntoTrivial(Table that)
public void addIntoTrivialScale(Table that, double scalar)
public void scale(double scalar)
public Table add(Table t)
public void divideInto(Table t)
public Table divide(Table t)
public Table shrink(Map evidence)
public static Set shrinkAll(Collection tables, Map evidence)
public Table permute(FiniteVariable[] order)
public static Table normalize(Table t)
public static Table innerProduct(Table t1, Table t2)
public boolean satisfiesCPTProperty(FiniteVariable var, double epsilon)
public boolean ensureCPTProperty(FiniteVariable var)
public int maxInd()
public void insertState(int ind)
public void removeState(int ind)
public void parentStateInserted(FiniteVariable parent, int indexNewInstance)
public void parentStateRemoved(FiniteVariable parent, int indexRemovedInstance)
public ArrayList valueElimination()
public double distanceMeasure(Table table2)
public static double distanceMeasure(double[] data1, double[] data2)
public double entropy()
public static final double myLog(double arg)
public boolean epsilonEquals(Table table, double epsilon)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |