public class MatrixOfDistances
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected PrototypeSet |
A
One prototype set
|
protected PrototypeSet |
B
Other prototype set
|
protected java.util.HashMap<Prototype,java.util.HashSet<Prototype>> |
invertedBList
For each B-prototype, there is a hashset of all the others prototypes which point to it.
|
protected java.util.HashMap<Prototype,java.util.HashMap<Prototype,java.lang.Double>> |
matrix
Warehouse of distance between prototypes in A and prototypes in B
|
protected PrototypeSet |
orphans
Prototypes added to the set, to be compared both A and B (it is not so much used)
|
Constructor and Description |
---|
MatrixOfDistances(PrototypeSet A,
PrototypeSet B)
Construct a matrix of the distances between elements of the set A and B.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Prototype x)
Add a new prototype to the matrix of distances.
|
void |
addToA(Prototype x)
Add a new prototype to the matrix of distances (subset A).
|
void |
addToB(Prototype x)
Add a new prototype to the matrix of distances (subset B).
|
double |
get(Prototype a,
Prototype b)
Get the distance between two prototypes.
|
boolean |
remove(Prototype x)
Remove a prototype to the matrix of distances.
|
boolean |
removeFromA(Prototype a)
Remove a prototype to the matrix of distances.
|
boolean |
removeFromB(Prototype x)
Remove a prototype to the matrix of distances.
|
protected PrototypeSet A
protected PrototypeSet B
protected PrototypeSet orphans
protected java.util.HashMap<Prototype,java.util.HashMap<Prototype,java.lang.Double>> matrix
public MatrixOfDistances(PrototypeSet A, PrototypeSet B)
A
- One prototype set.B
- Other prototype set.public double get(Prototype a, Prototype b)
a
- A prototype.b
- Other prototype.public boolean removeFromA(Prototype a)
a
- prototype to be erased.public boolean removeFromB(Prototype x)
x
- prototype to be erased.public boolean remove(Prototype x)
x
- prototype to be erased.public void add(Prototype x)
x
- New prototype to be added.public void addToA(Prototype x)
x
- New prototype to be added to A set.public void addToB(Prototype x)
x
- New prototype to be added to B set.