private static Matrix<double> ComputeMatrixCrossproduct(Matrix<double> matrix, IList<int> columnIndexes)
{
var result = new DenseMatrix(columnIndexes.Count, columnIndexes.Count);
for (int iRow = 0; iRow < columnIndexes.Count; iRow++)
{
for (int iCol = 0; iCol < columnIndexes.Count; iCol++)
{
result[iRow, iCol] = matrix.Column(columnIndexes[iRow]).DotProduct(matrix.Column(columnIndexes[iCol]));
}
}
return result;
}