Package pointgon
Class Trie
java.lang.Object
pointgon.Trie
- All Implemented Interfaces:
Serializable
Class for a trie to store partition subproblem solutions.
- Since:
- 2005.02.18 (Christian Borgelt)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Add a subproblem to the trie.int
Add a subproblem to the trie.Get a subproblem solution.Get a subproblem solution.int[]
getStats()
Get statistics about the trie.double
Get a subproblem solution (triangulation weight).double
Get a subproblem solution (triangulation weight).
-
Constructor Details
-
Trie
public Trie(int vertcnt, boolean rev) Create a subproblem trie.- Parameters:
vertcnt
- the number of perimeter verticesrev
- whether to reverse the key direction- Since:
- 2005.02.18 (Christian Borgelt)
-
Trie
public Trie(int vertcnt, int holecnt, boolean rev) Create a subproblem trie.- Parameters:
vertcnt
- the number of perimeter verticesholecnt
- the number of hole verticesrev
- whether to reverse the key direction- Since:
- 2005.02.18 (Christian Borgelt)
-
Trie
public Trie(int vertcnt) Create a subproblem trie.- Parameters:
vertcnt
- the number of perimeter vertices- Since:
- 2005.02.18 (Christian Borgelt)
-
Trie
public Trie(int vertcnt, int holecnt) Create a subproblem trie.- Parameters:
vertcnt
- the number of perimeter verticesholecnt
- the number of hole vertices- Since:
- 2005.02.18 (Christian Borgelt)
-
-
Method Details
-
add
Add a subproblem to the trie.- Parameters:
key
- the key of the subproblemweight
- the weight of the solution of the subproblemobject
- the solution of the subproblem- Returns:
- 0 if adding the subproblem was successful, -1 if the corresponding node os already in use
- Since:
- 2005.02.18 (Christian Borgelt)
-
add
Add a subproblem to the trie.- Parameters:
key
- the key of the subproblemlen
- the size of the subproblemweight
- the weight of the solution of the subproblemobject
- the solution of the subproblem- Returns:
- 0 if adding the subproblem was successful, -1 if the corresponding node os already in use
- Since:
- 2005.02.18 (Christian Borgelt)
-
getWeight
Get a subproblem solution (triangulation weight).- Parameters:
key
- the key of the subproblem- Returns:
- the weight of the triangulation
- Since:
- 2005.02.18 (Christian Borgelt)
-
getWeight
Get a subproblem solution (triangulation weight).- Parameters:
key
- the key of the subproblemlen
- the size of the subproblem- Returns:
- the weight of the triangulation
- Since:
- 2005.02.18 (Christian Borgelt)
-
getObject
Get a subproblem solution.- Parameters:
key
- the key of the subproblem- Returns:
- the solution of the subproblem
- Since:
- 2005.02.18 (Christian Borgelt)
-
getObject
Get a subproblem solution.- Parameters:
key
- the key of the subproblemlen
- the size of the subproblem- Returns:
- the solution of the subproblem
- Since:
- 2005.02.18 (Christian Borgelt)
-
getStats
public int[] getStats()Get statistics about the trie.- Returns:
- a list of five integers with different counts
- Since:
- 2005.02.18 (Christian Borgelt)
-