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

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

public class Subspace
extends EigenDecomposition
implements Serializable

A document subspace is defined by the basis vectors (matrix EigenDecomposition.mU ). A diagonal matrix (EigenDecomposition.mS) defines the weights associated to the basis vectors

Author:
bpiwowar
See Also:
Serialized Form

Field Summary
 
Fields inherited from class uk.ac.gla.dcs.renaissance.iqir.qpr.EigenDecomposition
map, mS, mU
 
Constructor Summary
Subspace(Density density)
          Shallow copy of a density
Subspace(DensityTracker tracker)
           
Subspace(DensityTracker tracker, boolean deepCopy)
           
Subspace(bpiwowar.maths.matrix.DoubleMatrix1D ray, boolean local)
          Constructs a one-dimensional subspace
Subspace(bpiwowar.maths.matrix.DoubleMatrix2D u, bpiwowar.maths.matrix.DiagonalDoubleMatrix s, it.unimi.dsi.fastutil.ints.Int2IntSortedMap map)
           
Subspace(bpiwowar.maths.svd.IncrementalSVD svd, it.unimi.dsi.fastutil.ints.Int2IntSortedMap map)
           
Subspace(SubspaceTracker tracker)
          Builds the subspace from a tracker
 
Method Summary
 Density project(Density density, boolean orthogonal)
           
 Density project(Density density, boolean orthogonal, boolean fuzzy)
          Project a density onto the (fuzzy) subspace or its orthogonal.
 Density project(Density density, boolean orthogonal, boolean fuzzy, bpiwowar.utils.holders.DoubleHolder norm)
          Project a density onto the (fuzzy) subspace or its orthogonal.
 bpiwowar.maths.matrix.DoubleMatrix1D project(bpiwowar.maths.matrix.DoubleMatrix1D v, boolean orthogonal)
           
 bpiwowar.maths.matrix.DoubleMatrix1D project(bpiwowar.maths.matrix.DoubleMatrix1D v, boolean orthogonal, boolean fuzzy)
          Project a vector into this subspace (or its orthogonal)
 Density projectLocal(Density density, boolean orthogonal, boolean fuzzy, bpiwowar.utils.holders.DoubleHolder norm)
          Project a density onto the (fuzzy) subspace or its orthogonal.
 bpiwowar.maths.matrix.DenseDoubleMatrix1D projectLocal(bpiwowar.maths.matrix.DoubleMatrix1D v, boolean orthogonal, boolean fuzzy)
          Project a vector which components in the local term space
 bpiwowar.maths.matrix.DoubleMatrix1D projectLocalToGlobal(bpiwowar.maths.matrix.DoubleMatrix1D local2Vector, int[] local2ToGlobalMap, boolean orthogonal, boolean fuzzy)
           
 
Methods inherited from class uk.ac.gla.dcs.renaissance.iqir.qpr.EigenDecomposition
getGlobalMatrix, getLocalToGobalTermIdMap, getMatrix, getRank, getS, normalise, normalise, normalise, trim
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Subspace

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

Subspace

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

Subspace

public Subspace(SubspaceTracker tracker)
Builds the subspace from a tracker

Parameters:
tracker -

Subspace

public Subspace(DensityTracker tracker)

Subspace

public Subspace(DensityTracker tracker,
                boolean deepCopy)

Subspace

public Subspace(Density density)
Shallow copy of a density

Parameters:
density -

Subspace

public Subspace(bpiwowar.maths.matrix.DoubleMatrix1D ray,
                boolean local)
Constructs a one-dimensional subspace

Parameters:
ray - The vector that defines the subspace
Method Detail

projectLocal

public bpiwowar.maths.matrix.DenseDoubleMatrix1D projectLocal(bpiwowar.maths.matrix.DoubleMatrix1D v,
                                                              boolean orthogonal,
                                                              boolean fuzzy)
Project a vector which components in the local term space

Parameters:
v - The vector to project
orthogonal - True if we want to project v on the orthogonal
Returns:
The new vector

projectLocal

public Density projectLocal(Density density,
                            boolean orthogonal,
                            boolean fuzzy,
                            bpiwowar.utils.holders.DoubleHolder norm)
Project a density onto the (fuzzy) subspace or its orthogonal. If A is a (fuzzy) projector on the subspace, then A^1/2 rho A^1/2 is the unnormalised projected density.

Parameters:
density - The density to be projected
orthogonal - True if the density should be projected in the orthogonal subspace
fuzzy - True if this subspace should fuzzy
norm - The norm of the density before normalisation will be set in this holder (if not null)
Returns:
A new density

projectLocalToGlobal

public bpiwowar.maths.matrix.DoubleMatrix1D projectLocalToGlobal(bpiwowar.maths.matrix.DoubleMatrix1D local2Vector,
                                                                 int[] local2ToGlobalMap,
                                                                 boolean orthogonal,
                                                                 boolean fuzzy)
Parameters:
local2Vector - a vector in its local termspace (called local2)
local2ToGlobalMap - the reverse map from the vector's local termspace to the global one
orthogonal - if we should project to the orthogonal subspace
fuzzy - True if the projection should be on the "fuzzy" subspace
Returns:
the projected vector in the global termspace

project

public Density project(Density density,
                       boolean orthogonal)
Parameters:
density - the density to be projected
orthogonal - if we want to project to the orthogonal subspace
Returns:
the projected normalised density

project

public bpiwowar.maths.matrix.DoubleMatrix1D project(bpiwowar.maths.matrix.DoubleMatrix1D v,
                                                    boolean orthogonal)

project

public bpiwowar.maths.matrix.DoubleMatrix1D project(bpiwowar.maths.matrix.DoubleMatrix1D v,
                                                    boolean orthogonal,
                                                    boolean fuzzy)
Project a vector into this subspace (or its orthogonal)

Parameters:
v - A vector (in the global term id space)
orthogonal - If we should project to the orthogonal
Fuzzy -
Returns:

project

public Density project(Density density,
                       boolean orthogonal,
                       boolean fuzzy)
Project a density onto the (fuzzy) subspace or its orthogonal. If A is a (fuzzy) projector on the subspace, then A^1/2 rho A^1/2 is the unnormalised projected density.

Parameters:
density - The density to be projected
orthogonal - True if the density should be projected in the orthogonal subspace
fuzzy - True if this subspace should fuzzy
Returns:
A new density

project

public Density project(Density density,
                       boolean orthogonal,
                       boolean fuzzy,
                       bpiwowar.utils.holders.DoubleHolder norm)
Project a density onto the (fuzzy) subspace or its orthogonal. If A is a (fuzzy) projector on the subspace, then A^1/2 rho A^1/2 is the unnormalised projected density.

Parameters:
density - The density to be projected
orthogonal - True if the density should be projected in the orthogonal subspace
fuzzy - True if this subspace should fuzzy
norm - The norm of the density before normalisation will be set in this holder (if not null)
Returns:
A new density


Copyright © 2011. All Rights Reserved.