|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalgo.PathByteArray
public final class PathByteArray
A Path in a graph implementd as arrays of bytes.
Field Summary | |
---|---|
double |
cost
|
Graph |
graph
|
int |
length
|
int |
maxsize
|
byte[] |
unused
|
byte[] |
used
|
Constructor Summary | |
---|---|
PathByteArray(Graph g,
byte[] u,
byte[] uu,
double c)
|
|
PathByteArray(Graph g,
byte[] u,
int pos,
byte[] uu,
double c)
|
Method Summary | |
---|---|
java.lang.Object |
clone()
Clone / copy this path. |
Path |
copyMax()
Clone / copy this path, but allocate full length used array. |
double |
cost()
|
protected static double |
cost(double c)
Dummy function. |
static PathByteArray |
emptyPath(Graph g)
Empty path, all n points unused. |
int |
length()
|
int |
maxsize()
|
Path |
nextPath(int pos)
Get next possible path reusing used array. |
Path[] |
nextPaths()
Get array of next possible paths. |
static PathByteArray |
onePath(Graph g)
One path. |
static PathByteArray |
standardPath(Graph g)
Standard path from point 0 to point n-1 to 0. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final Graph graph
public final byte[] used
public final byte[] unused
public final double cost
public final int maxsize
public final int length
Constructor Detail |
---|
public PathByteArray(Graph g, byte[] u, byte[] uu, double c)
g
- the graph.u
- used points.uu
- unused points.c
- cost of this path.public PathByteArray(Graph g, byte[] u, int pos, byte[] uu, double c)
g
- the graph.u
- used points.pos
- position of last used point in path, e.g. length.uu
- unused points.c
- cost of this path.Method Detail |
---|
public java.lang.Object clone()
clone
in interface Path
clone
in class java.lang.Object
Object.clone()
public double cost()
cost
in interface Path
public int length()
length
in interface Path
public int maxsize()
maxsize
in interface Path
public static PathByteArray emptyPath(Graph g)
g
- the graph.
public static PathByteArray onePath(Graph g)
g
- the graph.
public static PathByteArray standardPath(Graph g)
g
- the graph.
public Path copyMax()
copyMax
in interface Path
public Path nextPath(int pos)
nextPath
in interface Path
pos
- position of last valid point in used array.
public Path[] nextPaths()
nextPaths
in interface Path
public java.lang.String toString()
toString
in interface Path
toString
in class java.lang.Object
protected static double cost(double c)
c
- actual cost.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |