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 k, int p)
           
 
Method Summary
 void accumDots(int aIndex, double aElement, double[] yRow)
           
 void computeYRow(Vector aRow, double[] yRow)
          compute YRow=ARow*Omega.
 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.
 
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 k,
             int p)
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

accumDots

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

computeYRow

public void computeYRow(Vector aRow,
                        double[] yRow)
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)

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-2011 The Apache Software Foundation. All Rights Reserved.