Package elki.data.projection.random
Class AbstractRandomProjectionFamily.MatrixProjection
- java.lang.Object
-
- elki.data.projection.random.AbstractRandomProjectionFamily.MatrixProjection
-
- All Implemented Interfaces:
RandomProjectionFamily.Projection
- Enclosing class:
- AbstractRandomProjectionFamily
public static class AbstractRandomProjectionFamily.MatrixProjection extends java.lang.Object implements RandomProjectionFamily.Projection
Class to project using a matrix multiplication. This class is optimized for dense vector multiplications. In other words, the row dimensionality is the output dimensionality, the column dimensionality is the input dimensionality. It is not thread safe because it uses an internal buffer to store a local copy of the vector.- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Constructor Description MatrixProjection(double[][] matrix)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getOutputDimensionality()
Get the output dimensionality.double[]
project(NumberVector in)
Project a single vector.double[]
project(NumberVector in, double[] ret)
Project a single vector, into the given buffer.private double[]
projectSparse(SparseNumberVector in, double[] ret)
Project, exploiting sparsity; but the transposed matrix layout would have been better.
-
-
-
Method Detail
-
project
public double[] project(NumberVector in)
Description copied from interface:RandomProjectionFamily.Projection
Project a single vector.- Specified by:
project
in interfaceRandomProjectionFamily.Projection
- Parameters:
in
- Input vector- Returns:
- Projected vector
-
project
public double[] project(NumberVector in, double[] ret)
Description copied from interface:RandomProjectionFamily.Projection
Project a single vector, into the given buffer.- Specified by:
project
in interfaceRandomProjectionFamily.Projection
- Parameters:
in
- Input vectorret
- Output buffer- Returns:
buffer
-
projectSparse
private double[] projectSparse(SparseNumberVector in, double[] ret)
Project, exploiting sparsity; but the transposed matrix layout would have been better. For projections where you expect sparse input, consider the opposite.- Parameters:
in
- Input vectorret
- Projection buffer- Returns:
- Projected data.
-
getOutputDimensionality
public int getOutputDimensionality()
Description copied from interface:RandomProjectionFamily.Projection
Get the output dimensionality.- Specified by:
getOutputDimensionality
in interfaceRandomProjectionFamily.Projection
- Returns:
- Output dimensionality
-
-