All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.rubin.matching.Graph3DM

java.lang.Object
   |
   +----CH.rubin.matching.Graph3DM

public class Graph3DM
extends Object
implements Cloneable
Class containing a three dimensional matching.

Version:
$Revision: 2.4 $
Author:
Patrick Feisthammel email: pafei@rubin.ch

Constructor Index

 o Graph3DM(Graph3DM)
Constructs a graph which is a shallow copy of an existing Graph3DM
 o Graph3DM(int)
Constructs an empty graph which can become a tripartite matching graph by adding edges with setTripleXYZ(x,y,z)

Method Index

 o canTripleBeSet(int[])
Test if the triplet may be added to the graph without violating the matching.
 o canTripleXYZBeSet(int, int, int)
Test if the triplet (x,y,z) may be added to the graph without violating the matching.
 o clone(Object)
returns a shallow copy of itself
 o existsTripleXYZ(int, int, int)
checks if the triplets (x,y,z) is within this graph.
 o points()
returns the points per dimension in this graph.
 o setTriple(int[])
Sets a triplet in the graph.
 o setTripleXYZ(int, int, int)
Sets the triplets (x,y,z) in the graph.
 o toString()
String representation of the tripartite matching.
 o tripletList()
returns all triplets in the graph as a two dimensional list.
 o triplets()
returns the the number of triplets in the graph.
 o TrySettingTriple(int[])
Tries to sets a triplet in the graph.

Constructors

 o Graph3DM
 public Graph3DM(int points)
Constructs an empty graph which can become a tripartite matching graph by adding edges with setTripleXYZ(x,y,z)

Parameters:
points - how many points per dimension
 o Graph3DM
 public Graph3DM(Graph3DM graph)
Constructs a graph which is a shallow copy of an existing Graph3DM

Parameters:
graph - the Graph3DM to copy

Methods

 o clone
 public Object clone(Object graph)
returns a shallow copy of itself

Parameters:
graph - the Graph3DM to copy
 o points
 public int points()
returns the points per dimension in this graph.

 o triplets
 public int triplets()
returns the the number of triplets in the graph. Needs points() steps to count them.

Returns:
number of triplets in the graph
See Also:
points, tripletList
 o tripletList
 public int[][] tripletList()
returns all triplets in the graph as a two dimensional list. Not connected points are -1

Returns:
tripletList index is x; y==tripletList[x][0], z==tripletList[x][1]; 0<=x<=points()
See Also:
points, triplets
 o existsTripleXYZ
 public boolean existsTripleXYZ(int x,
                                int y,
                                int z)
checks if the triplets (x,y,z) is within this graph.

Parameters:
x - the x coordinat of the triple, 0<= x <= points()
y - the y coordinat of the triple, 0<= y <= points()
z - the z coordinat of the triple, 0<= z <= points()
See Also:
points
 o canTripleBeSet
 public boolean canTripleBeSet(int triplet[])
Test if the triplet may be added to the graph without violating the matching. E.g. no point has two outgoing edges after that

Parameters:
triplet - an array int[3] with x == triplet[0], y == triplet[1] and z == triplet[2]. 0<= x, y, z <= points()
See Also:
points, canTripletXYZBeSet, trySettingTriple
 o canTripleXYZBeSet
 public boolean canTripleXYZBeSet(int x,
                                  int y,
                                  int z)
Test if the triplet (x,y,z) may be added to the graph without violating the matching. E.g. no point has two outgoing edges after that

Parameters:
x - the x coordinat of the triple, 0<= x <= points()
y - the y coordinat of the triple, 0<= y <= points()
z - the z coordinat of the triple, 0<= z <= points()
See Also:
points, canTripletBeSet, trySettingTriple
 o setTriple
 public void setTriple(int triplet[])
Sets a triplet in the graph. If the triplet can not be set, because this would violate the matching, an exception is thrown.

Parameters:
triplet - an array int[3] with x == triplet[0], y == triplet[1] and z == triplet[2]. 0<= x, y, z <= points()
See Also:
points, canTripleBeSet, setTripletXYZ, trySettingTriple
 o TrySettingTriple
 public boolean TrySettingTriple(int triplet[])
Tries to sets a triplet in the graph. If the triplet can not be set, because this would violate the matching, return false, else return true.

Parameters:
triplet - an array int[3] with x == triplet[0], y == triplet[1] and z == triplet[2]. 0<= x, y, z <= points()
See Also:
points, canTripleBeSet, setTripletXYZ
 o setTripleXYZ
 public void setTripleXYZ(int x,
                          int y,
                          int z)
Sets the triplets (x,y,z) in the graph. If the triplet can not be set, because this would violate the matching, an exception is thrown.

Parameters:
x - the x coordinat of the triple, 0<= x <= points()
y - the y coordinat of the triple, 0<= y <= points()
z - the z coordinat of the triple, 0<= z <= points()
See Also:
points, canTripleXYZBeSet, setTriple
 o toString
 public String toString()
String representation of the tripartite matching. For every triple, the x, y and z coordinate is printed out

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index