protected override void DoTransposeAndMultiply(Matrix<double> other, Matrix<double> result)
{
var denseOther = other as DenseMatrix;
var denseResult = result as DenseMatrix;
if (denseOther != null && denseResult != null)
{
Control.LinearAlgebraProvider.MatrixMultiplyWithUpdate(
Providers.LinearAlgebra.Transpose.DontTranspose,
Providers.LinearAlgebra.Transpose.Transpose,
1.0,
_values,
_rowCount,
_columnCount,
denseOther._values,
denseOther._rowCount,
denseOther._columnCount,
0.0,
denseResult._values);
return;
}
var diagonalOther = other.Storage as DiagonalMatrixStorage<double>;
if (diagonalOther != null)
{
var diagonal = diagonalOther.Data;
var d = Math.Min(ColumnCount, other.RowCount);
if (d < other.RowCount)
{
result.ClearSubMatrix(0, RowCount, ColumnCount, other.RowCount - ColumnCount);
}
int index = 0;
for (int j = 0; j < d; j++)
{
for (int i = 0; i < RowCount; i++)
{
result.At(i, j, _values[index]*diagonal[j]);
index++;
}
}
return;
}
base.DoTransposeAndMultiply(other, result);
}