org.apache.mahout.math.hadoop.stochasticsvd
Class Omega

java.lang.Object
  extended by org.apache.mahout.math.hadoop.stochasticsvd.Omega

public class Omega
extends Object

simplistic implementation for Omega matrix in Stochastic SVD method


Constructor Summary
Omega(long seed, int kp)
           
 
Method Summary
protected  void accumDots(int aIndex, double aElement, double[] yRow)
           
protected  void accumDots(int aIndex, double aElement, Vector yRow)
           
 void computeYRow(Vector aRow, double[] yRow)
          Deprecated. 
 void computeYRow(Vector aRow, Vector yRowOut)
          A version to compute yRow as a sparse vector in case of extremely sparse matrices
 double getQuick(int row, int column)
          Get omega element at (x,y) uniformly distributed within [-1...1)
static long murmur64(byte[] val, int offset, int len, long seed)
           
static long murmur64(long val, int len, long seed)
          Shortened version for data < 8 bytes packed into len lowest bytes of val.
 Vector mutlithreadedTRightMultiply(Vector v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Omega

public Omega(long seed,
             int kp)
Method Detail

getQuick

public double getQuick(int row,
                       int column)
Get omega element at (x,y) uniformly distributed within [-1...1)

Parameters:
row - omega row
column - omega column

computeYRow

@Deprecated
public void computeYRow(Vector aRow,
                                   double[] yRow)
Deprecated. 

compute YRow=ARow*Omega.

Parameters:
aRow - row of matrix A (size n)
yRow - row of matrix Y (result) must be pre-allocated to size of (k+p)

computeYRow

public void computeYRow(Vector aRow,
                        Vector yRowOut)
A version to compute yRow as a sparse vector in case of extremely sparse matrices

Parameters:
aRow -
yRowOut -

mutlithreadedTRightMultiply

public Vector mutlithreadedTRightMultiply(Vector v)

accumDots

protected void accumDots(int aIndex,
                         double aElement,
                         double[] yRow)

accumDots

protected void accumDots(int aIndex,
                         double aElement,
                         Vector yRow)

murmur64

public static long murmur64(long val,
                            int len,
                            long seed)
Shortened version for data < 8 bytes packed into len lowest bytes of val.

Parameters:
val - the value
len - the length of data packed into this many low bytes of val
seed - the seed to use
Returns:
murmur hash

murmur64

public static long murmur64(byte[] val,
                            int offset,
                            int len,
                            long seed)


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.