uk.ac.gla.dcs.renaissance.iqir.qpr
Class EigenDecomposition

java.lang.Object
  extended by uk.ac.gla.dcs.renaissance.iqir.qpr.EigenDecomposition
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Density, Subspace

public class EigenDecomposition
extends Object
implements Serializable

Common class shared by fuzzy subspaces and densities

The underlying density/subspace is represented by U (orthonormal) and S (diagonal) such as rho = U S^2 U^T

Author:
B. Piwowarski
See Also:
Serialized Form

Field Summary
 it.unimi.dsi.fastutil.ints.Int2IntSortedMap map
          Map from global id (index-based) to local ids - the map should be ordered (this is needed for fast intersections)
 bpiwowar.maths.matrix.DiagonalDoubleMatrix mS
          The singular values
 bpiwowar.maths.matrix.DoubleMatrix2D mU
          The basis of the subspace
 
Constructor Summary
EigenDecomposition(DensityTracker tracker, boolean deepCopy)
          Construct a new eigen decomposition subspace/density based on a density tracker
EigenDecomposition(bpiwowar.maths.matrix.DoubleMatrix1D ray, boolean local)
          Creates a one dimensional eigen-decomposition representation
EigenDecomposition(bpiwowar.maths.matrix.DoubleMatrix2D u, bpiwowar.maths.matrix.DiagonalDoubleMatrix s, it.unimi.dsi.fastutil.ints.Int2IntSortedMap map)
           
EigenDecomposition(bpiwowar.maths.matrix.DoubleMatrix2D mU, bpiwowar.maths.matrix.DiagonalDoubleMatrix mS, it.unimi.dsi.fastutil.ints.Int2IntSortedMap map, boolean deepCopy)
           
EigenDecomposition(bpiwowar.maths.svd.IncrementalSVD svd, it.unimi.dsi.fastutil.ints.Int2IntSortedMap map)
           
 
Method Summary
 bpiwowar.maths.matrix.DoubleMatrix2D getGlobalMatrix(int dimension)
          Get a matrix representation of this density (mostly to be used for debugging)
 int[] getLocalToGobalTermIdMap()
          Return the reverse map
 bpiwowar.maths.matrix.DoubleMatrix2D getMatrix()
          Get a matrix representation of this density (mostly to be used for debugging)
 int getRank()
           
 bpiwowar.maths.matrix.DiagonalDoubleMatrix getS()
           
 double normalise()
          Normalise with the L2 norm
 double normalise(boolean orthonormalU)
          Normalise the decomposition so that || U x S || = 1, i.e.
 double normalise(boolean orthonormalU, cern.colt.function.DoubleFunction g, cern.colt.function.DoubleDoubleFunction aggr, cern.colt.function.DoubleFunction f)
          Normalise the decomposition by a given norm normaliser = g(aggr_{i=1..n} f(x_i) )
 void trim(int newRank)
          Trim the eigenvalue decomposition to a lower rank
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mS

public bpiwowar.maths.matrix.DiagonalDoubleMatrix mS
The singular values


mU

public bpiwowar.maths.matrix.DoubleMatrix2D mU
The basis of the subspace


map

public final it.unimi.dsi.fastutil.ints.Int2IntSortedMap map
Map from global id (index-based) to local ids - the map should be ordered (this is needed for fast intersections)

Constructor Detail

EigenDecomposition

public EigenDecomposition(bpiwowar.maths.matrix.DoubleMatrix2D u,
                          bpiwowar.maths.matrix.DiagonalDoubleMatrix s,
                          it.unimi.dsi.fastutil.ints.Int2IntSortedMap map)

EigenDecomposition

public EigenDecomposition(bpiwowar.maths.svd.IncrementalSVD svd,
                          it.unimi.dsi.fastutil.ints.Int2IntSortedMap map)

EigenDecomposition

public EigenDecomposition(DensityTracker tracker,
                          boolean deepCopy)
Construct a new eigen decomposition subspace/density based on a density tracker

Parameters:
tracker - The tracker from which to build this density
deepCopy - If all the structures underlying structures should be cloned (this is only for efficiency issues, note that at least the diagonal matrix will be cloned)

EigenDecomposition

public EigenDecomposition(bpiwowar.maths.matrix.DoubleMatrix2D mU,
                          bpiwowar.maths.matrix.DiagonalDoubleMatrix mS,
                          it.unimi.dsi.fastutil.ints.Int2IntSortedMap map,
                          boolean deepCopy)

EigenDecomposition

public EigenDecomposition(bpiwowar.maths.matrix.DoubleMatrix1D ray,
                          boolean local)
Creates a one dimensional eigen-decomposition representation

Parameters:
ray - The vector
Method Detail

normalise

public double normalise()
Normalise with the L2 norm


getS

public bpiwowar.maths.matrix.DiagonalDoubleMatrix getS()

normalise

public double normalise(boolean orthonormalU)
Normalise the decomposition so that || U x S || = 1, i.e. tr(U x S) = 1

Parameters:
orthonormalU - Should we expect U to be orthonormal (which should be the case normally)?
Returns:
The norm of the matrix

normalise

public double normalise(boolean orthonormalU,
                        cern.colt.function.DoubleFunction g,
                        cern.colt.function.DoubleDoubleFunction aggr,
                        cern.colt.function.DoubleFunction f)
Normalise the decomposition by a given norm normaliser = g(aggr_{i=1..n} f(x_i) )

Parameters:
orthonormalU - Should we expect U to be orthonormal (which should be the case normally)?
Returns:
The norm of the matrix

trim

public void trim(int newRank)
Trim the eigenvalue decomposition to a lower rank

Parameters:
newRank - The new rank of the subspace

getRank

public int getRank()

getLocalToGobalTermIdMap

public int[] getLocalToGobalTermIdMap()
Return the reverse map

Parameters:
tracker -
Returns:

getMatrix

public bpiwowar.maths.matrix.DoubleMatrix2D getMatrix()
Get a matrix representation of this density (mostly to be used for debugging)

Returns:
A matrix

getGlobalMatrix

public bpiwowar.maths.matrix.DoubleMatrix2D getGlobalMatrix(int dimension)
Get a matrix representation of this density (mostly to be used for debugging)

Returns:
A matrix


Copyright © 2011. All Rights Reserved.