hex.gram
Class Gram
java.lang.Object
water.Iced
hex.gram.Gram
- All Implemented Interfaces:
- java.lang.Cloneable, Freezable
public final class Gram
- extends Iced
Constructor Summary |
Gram()
|
Gram(int N,
int diag,
int dense,
int sparse,
boolean hasIntercept)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Gram
public Gram()
Gram
public Gram(int N,
int diag,
int dense,
int sparse,
boolean hasIntercept)
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)