Interface VoronoiAlgo.IResult
- All Superinterfaces:
VoronoiAlgo.Result<Integer,
Integer>
- Enclosing interface:
VoronoiAlgo
VoronoiAlgo
computation for IntGraph
.
See VoronoiAlgo.Result
for the result object documentation.
- Author:
- Barak Ugav
-
Method Summary
Modifier and TypeMethodDescriptiondefault Integer
blockSite
(int block) Deprecated.int
blockSiteInt
(int block) Get the site vertex of a block.double
distance
(int vertex) Get the distance of a vertex from its site.default double
Deprecated.Please usedistance(int)
instead to avoid un/boxing.getPath
(int target) Get the shortest path of a vertex from its site.default IPath
Deprecated.Please usegetPath(int)
instead to avoid un/boxing.Get the partition of the graph to blocks where each block contains the vertices which are closest to a single site.int
vertexSite
(int vertex) Get the site vertex of a vertex.default Integer
vertexSite
(Integer vertex) Deprecated.Please usevertexSite(int)
instead to avoid un/boxing.
-
Method Details
-
partition
IVertexPartition partition()Description copied from interface:VoronoiAlgo.Result
Get the partition of the graph to blocks where each block contains the vertices which are closest to a single site.- Specified by:
partition
in interfaceVoronoiAlgo.Result<Integer,
Integer> - Returns:
- the partition of the graph to sites blocks
-
distance
double distance(int vertex) Get the distance of a vertex from its site.Note that the direction of the distances and paths (in case of a directed graph) is from the sites to the vertices.
- Parameters:
vertex
- a target vertex- Returns:
- the shortest distance from any site to the target vertex, or
Double.POSITIVE_INFINITY
if the target vertex is unreachable from any site
-
distance
Deprecated.Please usedistance(int)
instead to avoid un/boxing.Get the distance of a vertex from its site.Note that the direction of the distances and paths (in case of a directed graph) is from the sites to the vertices.
- Specified by:
distance
in interfaceVoronoiAlgo.Result<Integer,
Integer> - Parameters:
vertex
- a target vertex- Returns:
- the shortest distance from any site to the target vertex, or
Double.POSITIVE_INFINITY
if the target vertex is unreachable from any site
-
getPath
Get the shortest path of a vertex from its site.Note that the direction of the distances and paths (in case of a directed graph) is from the sites to the vertices.
- Parameters:
target
- a target vertex- Returns:
- the shortest path from any site to the target vertex, or
null
if the target vertex is unreachable from any site
-
getPath
Deprecated.Please usegetPath(int)
instead to avoid un/boxing.Get the shortest path of a vertex from its site.Note that the direction of the distances and paths (in case of a directed graph) is from the sites to the vertices.
- Specified by:
getPath
in interfaceVoronoiAlgo.Result<Integer,
Integer> - Parameters:
target
- a target vertex- Returns:
- the shortest path from any site to the target vertex, or
null
if the target vertex is unreachable from any site
-
blockSiteInt
int blockSiteInt(int block) Get the site vertex of a block.The Voronoi cells are defined by the sites. Each 'block' contains all the vertices that are closer to the site of the block than to any other site. This method return the site vertex of one of the blocks
[0, numberOfBlocks())
.In case some vertices are unreachable from any sites, the partition will contain an addition block with index
siteNumber+1
that contains all these vertices. This method will return-1
for this block.- Parameters:
block
- index of a block- Returns:
- the site vertex of the block, or
-1
if the block is the unreachable block
-
blockSite
Deprecated.Please useblockSiteInt(int)
instead to avoid un/boxing.Get the site vertex of a block.The Voronoi cells are defined by the sites. Each 'block' contains all the vertices that are closer to the site of the block than to any other site. This method return the site vertex of one of the blocks
[0, numberOfBlocks())
.In case some vertices are unreachable from any sites, the partition will contain an addition block with index
siteNumber+1
that contains all these vertices. This method will returnnull
for this block.- Specified by:
blockSite
in interfaceVoronoiAlgo.Result<Integer,
Integer> - Parameters:
block
- index of a block- Returns:
- the site vertex of the block, or
null
if the block is the unreachable block
-
vertexSite
int vertexSite(int vertex) Get the site vertex of a vertex.The Voronoi cells are defined by the sites. Each 'block' contains all the vertices that are closer to the site of the block than to any other site. This method return the site vertex of the block that contains the vertex, namely the site with the shortest path from any site to the vertex.
- Parameters:
vertex
- a vertex- Returns:
- the site vertex with the shortest path from any site to the vertex
-
vertexSite
Deprecated.Please usevertexSite(int)
instead to avoid un/boxing.Get the site vertex of a vertex.The Voronoi cells are defined by the sites. Each 'block' contains all the vertices that are closer to the site of the block than to any other site. This method return the site vertex of the block that contains the vertex, namely the site with the shortest path from any site to the vertex.
- Specified by:
vertexSite
in interfaceVoronoiAlgo.Result<Integer,
Integer> - Parameters:
vertex
- a vertex- Returns:
- the site vertex with the shortest path from any site to the vertex, or
null
if the block is the unreachable block
-
blockSiteInt(int)
instead to avoid un/boxing.