org.grinvin
Class DefaultEmbedding
java.lang.Object
org.grinvin.DefaultEmbedding
- Embedding, EmbeddingView
public class DefaultEmbedding
extends java.lang.Object
Default implementation of
Embedding
. Stores
coordinates in a hash table.
protected int | dimension - Dimension of this embedding.
|
void | copy(EmbeddingView original) - Make this embedding a copy of the given view using the peer of the original.
|
void | copy(EmbeddingView original, GraphView newPeer) - Make this embedding a copy of the given view using the given peer.
|
double[] | getCoordinates(Vertex v) - Return the coordinates of the given vertex.
|
int | getDimension() - Returns the dimension of the Euclidian space into which this graph
is embedded.
|
GraphView | getPeer() - Returns the peer graph for this embedding.
|
void | setCoordinates(Vertex vertex, double[] coordinates) - Sets the coordinates to the given values.
|
void | setDimension(int dimension) - Set the dimension of the embedding.
|
dimension
protected int dimension
Dimension of this embedding.
DefaultEmbedding
public DefaultEmbedding(EmbeddingView original)
Create a copy of a given embedding which shares the same peer.
DefaultEmbedding
public DefaultEmbedding(GraphView peer,
int dimension)
Create an embedding of the given dimension for the given peer graph.
copy
public void copy(EmbeddingView original)
Make this embedding a copy of the given view using the peer of the original.
- copy in interface Embedding
getDimension
public int getDimension()
Returns the dimension of the Euclidian space into which this graph
is embedded.
- getDimension in interface EmbeddingView
setCoordinates
public void setCoordinates(Vertex vertex,
double[] coordinates)
Sets the coordinates to the given values.
- setCoordinates in interface Embedding
vertex
- Vertex (of the peer) whose coordinates should be changedcoordinates
- Array of coordinates which must be copied.
setDimension
public void setDimension(int dimension)
Set the dimension of the embedding. If this new dimension is different
from the current dimension then coordinates
of embedded vertices should be reasigned to conform to this new value.
- setDimension in interface Embedding