|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectVArray
public class VArray
A wrapper of a bit array related to the random variables in a Bayesian network.
Field Summary | |
---|---|
(package private) boolean[] |
array
Bit array. |
(package private) BayesNet |
bayesNet
Target Bayesian network. |
Constructor Summary | |
---|---|
VArray(BayesNet bn)
Initializes all bits as false. |
|
VArray(BayesNet bn,
boolean b)
Initializes all bits as b. |
|
VArray(BayesNet bn,
Variable v)
Sets true to the bits corresponding to the variables included in the CPT at which the variable v appears. |
Method Summary | |
---|---|
VArray |
copy()
Returns a copy of this object. |
boolean |
get(int i)
Returns the i -th element of the bit array. |
boolean[] |
getArray()
|
void |
intersect(VArray va)
Takes the bit-wise intersection of the bit array and va . |
static VArray |
intersect(VArray va1,
VArray va2)
Returns the bit-wise exclusive OR of va1 and va2 . |
void |
set(int i,
boolean b)
Sets the i -th element of the bit array as b . |
void |
setAll(boolean b)
Sets all elements of the bit array as b . |
void |
setArray(boolean[] a)
Makes a deep copy of a to the bit array. |
int |
size()
Returns the size of the bit array. |
java.lang.String |
toString()
Returns a string representation of the bit array. |
void |
union(VArray va)
Takes the bit-wise union of the bit array and va . |
static VArray |
union(VArray va1,
VArray va2)
Returns the bit-wise union of va1 and va2 . |
void |
xor(VArray va)
Takes the bit-wise exclusive OR of the bit array and va . |
static VArray |
xor(VArray va1,
VArray va2)
Returns the bit-wise exclusive OR of va1 and va2 . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
BayesNet bayesNet
boolean[] array
Constructor Detail |
---|
VArray(BayesNet bn, boolean b)
b
- initial value for the bit array.VArray(BayesNet bn)
bn
- a Bayesian networkVArray(BayesNet bn, Variable v)
bn
- a Bayesian networkMethod Detail |
---|
public boolean[] getArray()
public void setArray(boolean[] a) throws B2PException
a
to the bit array.
B2PException
public VArray copy() throws B2PException
B2PException
public boolean get(int i)
i
-th element of the bit array.
public void set(int i, boolean b)
i
-th element of the bit array as b
.
public void setAll(boolean b)
b
.
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
public void intersect(VArray va) throws B2PException
va
.
B2PException
public void union(VArray va) throws B2PException
va
.
B2PException
public void xor(VArray va) throws B2PException
va
.
B2PException
public static VArray intersect(VArray va1, VArray va2) throws B2PException
va1
and va2
.
B2PException
public static VArray union(VArray va1, VArray va2) throws B2PException
va1
and va2
.
B2PException
public static VArray xor(VArray va1, VArray va2) throws B2PException
va1
and va2
.
B2PException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |