Skip to content
Snippets Groups Projects
Commit 02ff9ae1 authored by Paul Nitzke's avatar Paul Nitzke
Browse files

Add Multiply method for Double-Integer

* This is the important variation that is used when multiplying the
  input matrix with the seed matrix
parent 6cb87717
Branches
No related tags found
1 merge request!22Non-minor rewrites of the design spec to accomodate new requirements
......@@ -90,5 +90,28 @@ namespace DataStructures
}
return result;
}
/// <summary>
/// Multiply this matrix with another matrix
/// </summary>
/// <param name="other">second matrix</param>
/// <returns>product matrix</returns>
public DoubleMatrix Multiply(IntegerMatrix other)
{
DoubleMatrix result = new DoubleMatrix(this.RowCount, other.ColumnCount);
for (int i = 0; i < this.RowCount; i++)
{
for (int j = 0; j < other.ColumnCount; j++)
{
double s = 0;
for (int k = 0; k < this.ColumnCount; k++)
{
s += this[i, k] * other[k, j];
}
result[i, j] = s;
}
}
return result;
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment