hex.gram
Class Gram

java.lang.Object
  extended by water.Iced
      extended by hex.gram.Gram
All Implemented Interfaces:
java.lang.Cloneable, Freezable

public final class Gram
extends Iced


Nested Class Summary
static class Gram.Cholesky
           
static class Gram.GramTask
           
 
Constructor Summary
Gram()
           
Gram(int N, int diag, int dense, int sparse, boolean hasIntercept)
           
 
Method Summary
 void add(Gram grm)
           
 void addDiag(double d)
           
 void addRow(double[] x, int catN, int[] catIndexes, double w)
           
 Gram.Cholesky cholesky(Gram.Cholesky chol)
          Compute the cholesky decomposition.
 double[][] getXX()
           
 boolean hasNaNsOrInfs()
           
 void mul(double x)
           
 
Methods inherited from class water.Iced
clone, frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFields
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gram

public Gram()

Gram

public Gram(int N,
            int diag,
            int dense,
            int sparse,
            boolean hasIntercept)
Method Detail

addDiag

public void addDiag(double d)

cholesky

public Gram.Cholesky cholesky(Gram.Cholesky chol)
Compute the cholesky decomposition. In case our gram starts with diagonal submatrix of dimension N, we exploit this fact to reduce the complexity of the problem. We use the standard decompostion of the cholesky factorization into submatrices. We split the Gram into 3 regions (4 but we only consider lower diagonal, sparse means diagonal region in this context): diagonal diagonal*dense dense*dense Then we can solve the cholesky in 3 steps: 1. We solve the diagnonal part right away (just do the sqrt of the elements). 2. The diagonal*dense part is simply divided by the sqrt of diagonal. 3. Compute Cholesky of dense*dense - outer product of cholesky of diagonal*dense computed in previous step

Parameters:
chol -
Returns:

getXX

public double[][] getXX()

add

public void add(Gram grm)

hasNaNsOrInfs

public final boolean hasNaNsOrInfs()

addRow

public final void addRow(double[] x,
                         int catN,
                         int[] catIndexes,
                         double w)

mul

public void mul(double x)