Package elki.visualization.projections
Class SimpleParallel
- java.lang.Object
-
- elki.visualization.projections.SimpleParallel
-
- All Implemented Interfaces:
Projection,ProjectionParallel,VisualizationItem
public class SimpleParallel extends java.lang.Object implements ProjectionParallel
Simple parallel projection Scaled space: reordered, scaled and inverted. Lower dimensionality! [0:1] Render space: not used here; no recentering needed.- Since:
- 0.5.0
- Author:
- Robert Rödler, Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int[]dimOrderOrdering of dimensions(package private) static byteFLAG_HIDDENFlag for visibility(package private) static byteFLAG_INVERTEDFlag for inverted dimensions TODO: handle inversions via scales?(package private) byte[]flagsFlags for the dimensionsprivate ProjectorpProjectorprivate LinearScale[]scalesScales(package private) intvisDimsNumber of visible dimensions-
Fields inherited from interface elki.visualization.projections.Projection
INVSCALE, SCALE
-
-
Constructor Summary
Constructors Constructor Description SimpleParallel(Projector p, LinearScale[] scales)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]fastProjectDataToRenderSpace(double[] data)Fast project a vector from data to render spacedoublefastProjectDataToRenderSpace(double value, int dim)Project the value of a single axis to its display valuedouble[]fastProjectDataToRenderSpace(NumberVector data)Fast project a vector from data to render spacedoublefastProjectRenderToDataSpace(double v, int projdim)Project a display value back to the original data spaceintgetAxisForDim(int truedim)Find the axis assigned to the given dimension.LinearScalegetAxisScale(int axis)Get scale for the given axisintgetDimForAxis(int pos)Get the dimension for the given axis numberintgetDimForVisibleAxis(int pos)Get the dimension for the given visible axisintgetInputDimensionality()Get the input dimensionality of the projection.java.lang.StringgetMenuName()Name to display in the menu.ProjectorgetProjector()Projector used for generating this projection.LinearScalegetScale(int dim)Get the scale class for a particular dimension.intgetVisibleDimensions()Get the number of visible dimension.booleanisAxisInverted(int axis)Get inversion flag of axis.booleanisAxisVisible(int dim)Test whether the current axis is visibleprotected booleanisDimHidden(int truedim)booleanisDimInverted(int truedim)Get inversion flag of dimension.voidmoveAxis(int src, int dest)shift a dimension to another positionvoidsetAxisInverted(int axis, boolean bool)Set inversion flag of axis.voidsetAxisVisible(int dim, boolean vis)Set the visibility of the axis.voidsetDimInverted(int truedim, boolean bool)Set inversion flag of a dimension.voidswapAxes(int a, int b)Exchange axes A and BvoidtoggleAxisInverted(int axis)Toggle inverted flag of axis.voidtoggleAxisVisible(int dim)Toggle visibility of the axis.voidtoggleDimInverted(int truedim)Toggle inverted flag of dimension.
-
-
-
Field Detail
-
visDims
int visDims
Number of visible dimensions
-
flags
byte[] flags
Flags for the dimensions
-
dimOrder
int[] dimOrder
Ordering of dimensions
-
scales
private LinearScale[] scales
Scales
-
p
private Projector p
Projector
-
FLAG_HIDDEN
static final byte FLAG_HIDDEN
Flag for visibility- See Also:
- Constant Field Values
-
FLAG_INVERTED
static final byte FLAG_INVERTED
Flag for inverted dimensions TODO: handle inversions via scales?- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SimpleParallel
public SimpleParallel(Projector p, LinearScale[] scales)
Constructor.- Parameters:
p- Projectorscales- Scales to use
-
-
Method Detail
-
getScale
public LinearScale getScale(int dim)
Description copied from interface:ProjectionGet the scale class for a particular dimension.- Specified by:
getScalein interfaceProjection- Parameters:
dim- Dimension- Returns:
- Scale class
-
isAxisInverted
public boolean isAxisInverted(int axis)
Description copied from interface:ProjectionParallelGet inversion flag of axis.- Specified by:
isAxisInvertedin interfaceProjectionParallel- Parameters:
axis- Axis (reordered) position- Returns:
- Inversion flag
-
setAxisInverted
public void setAxisInverted(int axis, boolean bool)Description copied from interface:ProjectionParallelSet inversion flag of axis.- Specified by:
setAxisInvertedin interfaceProjectionParallel- Parameters:
axis- Axis (reordered) positionbool- Value of inversion flag
-
toggleAxisInverted
public void toggleAxisInverted(int axis)
Description copied from interface:ProjectionParallelToggle inverted flag of axis.- Specified by:
toggleAxisInvertedin interfaceProjectionParallel- Parameters:
axis- Axis (reordered) position
-
isDimInverted
public boolean isDimInverted(int truedim)
Description copied from interface:ProjectionParallelGet inversion flag of dimension.- Specified by:
isDimInvertedin interfaceProjectionParallel- Parameters:
truedim- Dimension in original numbering- Returns:
- Inversion flag
-
setDimInverted
public void setDimInverted(int truedim, boolean bool)Description copied from interface:ProjectionParallelSet inversion flag of a dimension.- Specified by:
setDimInvertedin interfaceProjectionParallel- Parameters:
truedim- Dimension in original numberingbool- Value of inversion flag
-
toggleDimInverted
public void toggleDimInverted(int truedim)
Description copied from interface:ProjectionParallelToggle inverted flag of dimension.- Specified by:
toggleDimInvertedin interfaceProjectionParallel- Parameters:
truedim- Dimension in original numbering
-
getAxisScale
public LinearScale getAxisScale(int axis)
Description copied from interface:ProjectionParallelGet scale for the given axis- Specified by:
getAxisScalein interfaceProjectionParallel- Parameters:
axis- Axis (reordered) position- Returns:
- Axis scale
-
isDimHidden
protected boolean isDimHidden(int truedim)
-
isAxisVisible
public boolean isAxisVisible(int dim)
Description copied from interface:ProjectionParallelTest whether the current axis is visible- Specified by:
isAxisVisiblein interfaceProjectionParallel- Parameters:
dim- Axis (reordered) position- Returns:
- Visibility of axis
-
setAxisVisible
public void setAxisVisible(int dim, boolean vis)Description copied from interface:ProjectionParallelSet the visibility of the axis.- Specified by:
setAxisVisiblein interfaceProjectionParallel- Parameters:
dim- Axis numbervis- Visibility status
-
toggleAxisVisible
public void toggleAxisVisible(int dim)
Description copied from interface:ProjectionParallelToggle visibility of the axis.- Specified by:
toggleAxisVisiblein interfaceProjectionParallel- Parameters:
dim- Axis number
-
getVisibleDimensions
public int getVisibleDimensions()
Description copied from interface:ProjectionParallelGet the number of visible dimension.- Specified by:
getVisibleDimensionsin interfaceProjectionParallel- Returns:
- Number of visible dimensions
-
getDimForAxis
public int getDimForAxis(int pos)
Description copied from interface:ProjectionParallelGet the dimension for the given axis number- Specified by:
getDimForAxisin interfaceProjectionParallel- Parameters:
pos- Axis number- Returns:
- Dimension
-
getDimForVisibleAxis
public int getDimForVisibleAxis(int pos)
Description copied from interface:ProjectionParallelGet the dimension for the given visible axis- Specified by:
getDimForVisibleAxisin interfaceProjectionParallel- Parameters:
pos- Axis number (visible axes only)- Returns:
- Dimension
-
swapAxes
public void swapAxes(int a, int b)Description copied from interface:ProjectionParallelExchange axes A and B- Specified by:
swapAxesin interfaceProjectionParallel- Parameters:
a- First axisb- Second axis
-
moveAxis
public void moveAxis(int src, int dest)Description copied from interface:ProjectionParallelshift a dimension to another position- Specified by:
moveAxisin interfaceProjectionParallel- Parameters:
src- axis to shiftdest- new position
-
fastProjectDataToRenderSpace
public double[] fastProjectDataToRenderSpace(NumberVector data)
Description copied from interface:ProjectionParallelFast project a vector from data to render space- Specified by:
fastProjectDataToRenderSpacein interfaceProjectionParallel- Parameters:
data- Input vector- Returns:
- Vector with reordering, inversions and scales applied.
-
fastProjectDataToRenderSpace
public double[] fastProjectDataToRenderSpace(double[] data)
Description copied from interface:ProjectionParallelFast project a vector from data to render space- Specified by:
fastProjectDataToRenderSpacein interfaceProjectionParallel- Parameters:
data- Input vector- Returns:
- Vector with reordering, inversions and scales applied.
-
fastProjectRenderToDataSpace
public double fastProjectRenderToDataSpace(double v, int projdim)Description copied from interface:ProjectionParallelProject a display value back to the original data space- Specified by:
fastProjectRenderToDataSpacein interfaceProjectionParallel- Parameters:
v- transformed valueprojdim- Axis to use for scaling and inversion- Returns:
- Original value
-
fastProjectDataToRenderSpace
public double fastProjectDataToRenderSpace(double value, int dim)Description copied from interface:ProjectionParallelProject the value of a single axis to its display value- Specified by:
fastProjectDataToRenderSpacein interfaceProjectionParallel- Parameters:
value- Input valuedim- Axis to use for scaling and inversion- Returns:
- Transformed value
-
getAxisForDim
public int getAxisForDim(int truedim)
Description copied from interface:ProjectionParallelFind the axis assigned to the given dimension.- Specified by:
getAxisForDimin interfaceProjectionParallel- Parameters:
truedim- Dimension- Returns:
- Axis number
-
getInputDimensionality
public int getInputDimensionality()
Description copied from interface:ProjectionGet the input dimensionality of the projection.- Specified by:
getInputDimensionalityin interfaceProjection- Returns:
- Input dimensionality
-
getMenuName
public java.lang.String getMenuName()
Description copied from interface:VisualizationItemName to display in the menu. May benullor empty string.- Specified by:
getMenuNamein interfaceVisualizationItem- Returns:
- Menu name.
-
getProjector
public Projector getProjector()
Description copied from interface:ProjectionProjector used for generating this projection.- Specified by:
getProjectorin interfaceProjection- Returns:
- Projector
-
-