final double [][] matrix = kernel.getKernelMatrix(listOfExamples);
if(lambda_matrix == null)
lambda_matrix = new double[matrix.length][matrix.length];
debug.println(3, "+ update lambda matrix");
ThreadedMatrixOperator factory = new ThreadedMatrixOperator()
{
@Override
public void doLines(double[][] m , int from , int to) {
for(int index = from ; index < to ; index++)
{
if(a[index] == 0) {
m[index] = null;
continue;
}
if(m[index] == null)
m[index] = new double[matrix.length];
int l1 = listOfExamples.get(index).label;
double al1 = a[index]*l1;
for(int j = 0 ; j < m[index].length ; j++)
{
int l2 = listOfExamples.get(j).label;
m[index][j] = al1 * l2 * a[j] * matrix[index][j];
}
}
}
};
lambda_matrix = factory.getMatrix(lambda_matrix);
}