public class pnPair
extends java.lang.Object
This class lets to handle pnPair structure
Constructor and Description |
---|
pnPair(int e1,
int e2)
Constructor of the class
|
Modifier and Type | Method and Description |
---|---|
int |
getNegEx()
It returns the negEx value
|
static java.util.Vector<pnPair> |
getPNpairs(IntegerSet E,
Instance[] instances,
int positiveClass)
Returns the PN pairs with the integer set and instances given.
|
int |
getPosEx()
It returns the posEx value
|
double |
getWeight()
It returns the weight value
|
java.util.Vector<java.lang.Integer> |
indexLiterals(boolean[][] literals,
int numlit)
It computes the indexes of the literals that cover the pnPair
|
boolean |
isCovered(boolean[][] literals,
int lit)
It checks if only the literal lit covers the pnPair and the other do not
|
int |
numliteralCovers(boolean[][] literals,
int numlit)
It computes the number of literals that covers the pnPair
|
boolean |
onlyOneLiteral(boolean[][] literals,
java.util.Vector<java.lang.Integer> L,
int lit)
It checks if only the literal lit covers the pnPair and the other do not
|
void |
print()
Prints on the standard output a representation of the pnPair.
|
void |
setNegEx(int index)
It sets the negEx value
|
void |
setPosEx(int index)
It sets the posEx value
|
void |
setWeight(double w)
It sets the new weight for the pnPair
|
public pnPair(int e1, int e2)
Constructor of the class
e1
- index of the positive examplee2
- index of the negative examplepublic void setPosEx(int index)
It sets the posEx value
index
- the new posEx valuepublic int getPosEx()
It returns the posEx value
public void setNegEx(int index)
It sets the negEx value
index
- the new negEx valuepublic int getNegEx()
It returns the negEx value
public void setWeight(double w)
It sets the new weight for the pnPair
w
- the new weightpublic double getWeight()
It returns the weight value
public int numliteralCovers(boolean[][] literals, int numlit)
It computes the number of literals that covers the pnPair
literals
- numlit
- public java.util.Vector<java.lang.Integer> indexLiterals(boolean[][] literals, int numlit)
It computes the indexes of the literals that cover the pnPair
literals
- numlit
- public boolean onlyOneLiteral(boolean[][] literals, java.util.Vector<java.lang.Integer> L, int lit)
It checks if only the literal lit covers the pnPair and the other do not
literals
- L
- lit
- public boolean isCovered(boolean[][] literals, int lit)
It checks if only the literal lit covers the pnPair and the other do not
literals
- lit
- public static java.util.Vector<pnPair> getPNpairs(IntegerSet E, Instance[] instances, int positiveClass)
E
- integer set.instances
- instances set.positiveClass
- positive class id.public void print()