/// <param name="transposeB">How to transpose the <paramref name="b"/> matrix.</param>
/// <param name="alpha">The value to scale <paramref name="a"/> matrix.</param>
/// <param name="a">The a matrix.</param>
/// <param name="aRows">The number of rows in the <paramref name="a"/> matrix.</param>
/// <param name="aColumns">The number of columns in the <paramref name="a"/> matrix.</param>
/// <param name="rowsA">The number of rows in the <paramref name="a"/> matrix.</param>
/// <param name="columnsA">The number of columns in the <paramref name="a"/> matrix.</param>
/// <param name="b">The b matrix</param>
/// <param name="bRows">The number of rows in the <paramref name="b"/> matrix.</param>
/// <param name="bColumns">The number of columns in the <paramref name="b"/> matrix.</param>
/// <param name="rowsB">The number of rows in the <paramref name="b"/> matrix.</param>
/// <param name="columnsB">The number of columns in the <paramref name="b"/> matrix.</param>
/// <param name="beta">The value to scale the <paramref name="c"/> matrix.</param>
/// <param name="c">The c matrix.</param>
public override void MatrixMultiplyWithUpdate(Transpose transposeA, Transpose transposeB, <#=dataType#> alpha, <#=dataType#>[] a,
int aRows, int aColumns, <#=dataType#>[] b, int bRows, int bColumns, <#=dataType#> beta, <#=dataType#>[] c)
public override void MatrixMultiplyWithUpdate(Transpose transposeA, Transpose transposeB, <#=dataType#> alpha, <#=dataType#>[] a, int rowsA, int columnsA, <#=dataType#>[] b, int rowsB, int columnsB, <#=dataType#> beta, <#=dataType#>[] c)
{
if (a == null)
{
@ -127,16 +126,16 @@
throw new ArgumentNullException("c");
}
var m = transposeA == Transpose.DontTranspose ? aRows : aColumns;
var n = transposeB == Transpose.DontTranspose ? bColumns : bRows;
var k = transposeA == Transpose.DontTranspose ? aColumns : aRows;
var m = transposeA == Transpose.DontTranspose ? rowsA : columnsA;
var n = transposeB == Transpose.DontTranspose ? columnsB : rowsB;
var k = transposeA == Transpose.DontTranspose ? columnsA : rowsA;
if( c.Length != aRows * bColumns)
if (c.Length != rowsA * columnsB)
{
throw new ArgumentException(Resources.ArgumentMatrixDimensions);
}
if (aColumns != bRows)
if (columnsA != rowsB)
{
throw new ArgumentException(Resources.ArgumentMatrixDimensions);
}
@ -144,7 +143,7 @@
SafeNativeMethods.<#=prefix#>_matrix_multiply(transposeA, transposeB, m, n, k, <#=reff#>alpha, a, b, <#=reff#>beta, c);
}
/// <summary>
/// <summary>
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
@ -176,8 +175,6 @@
throw new NotImplementedException();
}
/// <summary>
/// Computes the LUP factorization of A. P*A = L*U.
/// </summary>
@ -326,13 +323,13 @@
/// Solves A*X=B for X using Cholesky factorization.
/// <param name="aOrder">The number of rows and columns in A.</param>
/// <param name="orderA">The number of rows and columns in A.</param>
/// <param name="b">The B matrix.</param>
/// <param name="bRows">The number of rows in the B matrix.</param>
/// <param name="bColumns">The number of columns in the B matrix.</param>
/// <param name="rowsB">The number of rows in the B matrix.</param>
/// <param name="columnsB">The number of columns in the B matrix.</param>
/// <remarks>This is equivalent to the POTRS LAPACK routine.</remarks>
public override void CholeskySolveFactored(<#=dataType#>[] a, int aOrder, <#=dataType#>[] b, int bRows, int bColumns)
public override void CholeskySolveFactored(<#=dataType#>[] a, int orderA, <#=dataType#>[] b, int rowsB, int columnsB)
{
throw new NotImplementedException();
}
@ -356,12 +353,12 @@
/// </summary>
/// <param name="r">On entry, it is the M by N A matrix to factor. On exit,
/// it is overwritten with the R matrix of the QR factorization. </param>
/// <param name="rRows">The number of rows in the A matrix.</param>
/// <param name="rColumns">The number of columns in the A matrix.</param>
/// <param name="rowsR">The number of rows in the A matrix.</param>
/// <param name="columnsR">The number of columns in the A matrix.</param>
/// <param name="q">On exit, A M by M matrix that holds the Q matrix of the
/// QR factorization.</param>
/// <remarks>This is similar to the GEQRF and ORGQR LAPACK routines.</remarks>
public override void QRFactor(<#=dataType#>[] r, int rRows, int rColumns, <#=dataType#>[] q)
public override void QRFactor(<#=dataType#>[] r, int rowsR, int columnsR, <#=dataType#>[] q)
{
throw new NotImplementedException();
}
@ -371,15 +368,15 @@
/// </summary>
/// <param name="r">On entry, it is the M by N A matrix to factor. On exit,
/// it is overwritten with the R matrix of the QR factorization. </param>
/// <param name="rRows">The number of rows in the A matrix.</param>
/// <param name="rColumns">The number of columns in the A matrix.</param>
/// <param name="rowsR">The number of rows in the A matrix.</param>
/// <param name="columnsR">The number of columns in the A matrix.</param>
/// <param name="q">On exit, A M by M matrix that holds the Q matrix of the
/// QR factorization.</param>
/// <param name="work">The work array. The array must have a length of at least N,
/// but should be N*blocksize. The blocksize is machine dependent. On exit, work[0] contains the optimal
/// work size value.</param>
/// <remarks>This is similar to the GEQRF and ORGQR LAPACK routines.</remarks>
public override void QRFactor(<#=dataType#>[] r, int rRows, int rColumns, <#=dataType#>[] q, <#=dataType#>[] work)
public override void QRFactor(<#=dataType#>[] r, int rowsR, int columnsR, <#=dataType#>[] q, <#=dataType#>[] work)
{
throw new NotImplementedException();
}
@ -389,14 +386,14 @@
/// </summary>
/// <param name="r">On entry, it is the M by N A matrix to factor. On exit,
/// it is overwritten with the R matrix of the QR factorization. </param>
/// <param name="rRows">The number of rows in the A matrix.</param>
/// <param name="rColumns">The number of columns in the A matrix.</param>
/// <param name="rowsR">The number of rows in the A matrix.</param>
/// <param name="columnsR">The number of columns in the A matrix.</param>
/// <param name="q">On exit, A M by M matrix that holds the Q matrix of the
/// QR factorization.</param>
/// <param name="b">The B matrix.</param>
/// <param name="bColumns">The number of columns of B.</param>
/// <param name="columnsB">The number of columns of B.</param>
/// <param name="x">On exit, the solution matrix.</param>
public override void QRSolve(<#=dataType#>[] r, int rRows, int rColumns, <#=dataType#>[] q, <#=dataType#>[] b, int bColumns, <#=dataType#>[] x)
public override void QRSolve(<#=dataType#>[] r, int rowsR, int columnsR, <#=dataType#>[] q, <#=dataType#>[] b, int columnsB, <#=dataType#>[] x)
{
throw new NotImplementedException();
}
@ -406,17 +403,17 @@
/// </summary>
/// <param name="r">On entry, it is the M by N A matrix to factor. On exit,
/// it is overwritten with the R matrix of the QR factorization. </param>
/// <param name="rRows">The number of rows in the A matrix.</param>
/// <param name="rColumns">The number of columns in the A matrix.</param>
/// <param name="rowsR">The number of rows in the A matrix.</param>
/// <param name="columnsR">The number of columns in the A matrix.</param>
/// <param name="q">On exit, A M by M matrix that holds the Q matrix of the
/// QR factorization.</param>
/// <param name="b">The B matrix.</param>
/// <param name="bColumns">The number of columns of B.</param>
/// <param name="columnsB">The number of columns of B.</param>
/// <param name="x">On exit, the solution matrix.</param>
/// <param name="work">The work array. The array must have a length of at least N,
/// but should be N*blocksize. The blocksize is machine dependent. On exit, work[0] contains the optimal
/// work size value.</param>
public override void QRSolve(<#=dataType#>[] r, int rRows, int rColumns, <#=dataType#>[] q, <#=dataType#>[] b, int bColumns, <#=dataType#>[] x, <#=dataType#>[] work)
public override void QRSolve(<#=dataType#>[] r, int rowsR, int columnsR, <#=dataType#>[] q, <#=dataType#>[] b, int columnsB, <#=dataType#>[] x, <#=dataType#>[] work)
{
throw new NotImplementedException();
}
@ -426,12 +423,12 @@
/// </summary>
/// <param name="q">The Q matrix obtained by calling <see cref="QRFactor(<#=dataType#>[],int,int,<#=dataType#>[])"/>.</param>
/// <param name="r">The R matrix obtained by calling <see cref="QRFactor(<#=dataType#>[],int,int,<#=dataType#>[])"/>. </param>
/// <param name="rRows">The number of rows in the A matrix.</param>
/// <param name="rColumns">The number of columns in the A matrix.</param>
/// <param name="rowsR">The number of rows in the A matrix.</param>
/// <param name="columnsR">The number of columns in the A matrix.</param>
/// <param name="b">The B matrix.</param>
/// <param name="bColumns">The number of columns of B.</param>
/// <param name="columnsB">The number of columns of B.</param>
/// <param name="x">On exit, the solution matrix.</param>
public override void QRSolveFactored(<#=dataType#>[] q, <#=dataType#>[] r, int rRows, int rColumns, <#=dataType#>[] b, int bColumns, <#=dataType#>[] x)
public override void QRSolveFactored(<#=dataType#>[] q, <#=dataType#>[] r, int rowsR, int columnsR, <#=dataType#>[] b, int columnsB, <#=dataType#>[] x)
{
throw new NotImplementedException();
}
@ -441,15 +438,15 @@
/// </summary>
/// <param name="computeVectors">Compute the singular U and VT vectors or not.</param>
/// <param name="a">On entry, the M by N matrix to decompose. On exit, A may be overwritten.</param>
/// <param name="aRows">The number of rows in the A matrix.</param>
/// <param name="aColumns">The number of columns in the A matrix.</param>
/// <param name="rowsA">The number of rows in the A matrix.</param>
/// <param name="columnsA">The number of columns in the A matrix.</param>
/// <param name="s">The singular values of A in ascending value.</param>
/// <param name="u">If <paramref name="computeVectors"/> is true, on exit U contains the left
/// <param name="u">If <paramref name="computeVectors"/> is <c>true</c>, on exit U contains the left
/// singular vectors.</param>
/// <param name="vt">If <paramref name="computeVectors"/> is true, on exit VT contains the transposed
/// <param name="vt">If <paramref name="computeVectors"/> is <c>true</c>, on exit VT contains the transposed
/// right singular vectors.</param>
/// <remarks>This is equivalent to the GESVD LAPACK routine.</remarks>
public override void SingularValueDecomposition(bool computeVectors, <#=dataType#>[] a, int aRows, int aColumns, <#=dataType#>[] s, <#=dataType#>[] u, <#=dataType#>[] vt)
public override void SingularValueDecomposition(bool computeVectors, <#=dataType#>[] a, int rowsA, int columnsA, <#=dataType#>[] s, <#=dataType#>[] u, <#=dataType#>[] vt)
{
throw new NotImplementedException();
}
@ -459,18 +456,18 @@
/// </summary>
/// <param name="computeVectors">Compute the singular U and VT vectors or not.</param>
/// <param name="a">On entry, the M by N matrix to decompose. On exit, A may be overwritten.</param>
/// <param name="aRows">The number of rows in the A matrix.</param>
/// <param name="aColumns">The number of columns in the A matrix.</param>
/// <param name="rowsA">The number of rows in the A matrix.</param>
/// <param name="columnsA">The number of columns in the A matrix.</param>
/// <param name="s">The singular values of A in ascending value.</param>
/// <param name="u">If <paramref name="computeVectors"/> is true, on exit U contains the left
/// <param name="u">If <paramref name="computeVectors"/> is <c>true</c>, on exit U contains the left
/// singular vectors.</param>
/// <param name="vt">If <paramref name="computeVectors"/> is true, on exit VT contains the transposed
/// <param name="vt">If <paramref name="computeVectors"/> is <c>true</c>, on exit VT contains the transposed
/// right singular vectors.</param>
/// <param name="work">The work array. For real matrices, the work array should be at least
/// On exit, work[0] contains the optimal work size value.</param>
/// <remarks>This is equivalent to the GESVD LAPACK routine.</remarks>
public override void SingularValueDecomposition(bool computeVectors, <#=dataType#>[] a, int aRows, int aColumns, <#=dataType#>[] s, <#=dataType#>[] u, <#=dataType#>[] vt, <#=dataType#>[] work)
public override void SingularValueDecomposition(bool computeVectors, <#=dataType#>[] a, int rowsA, int columnsA, <#=dataType#>[] s, <#=dataType#>[] u, <#=dataType#>[] vt, <#=dataType#>[] work)
{
throw new NotImplementedException();
}
@ -479,15 +476,15 @@
/// Solves A*X=B for X using the singular value decomposition of A.
/// </summary>
/// <param name="a">On entry, the M by N matrix to decompose. On exit, A may be overwritten.</param>
/// <param name="aRows">The number of rows in the A matrix.</param>
/// <param name="aColumns">The number of columns in the A matrix.</param>
/// <param name="rowsA">The number of rows in the A matrix.</param>
/// <param name="columnsA">The number of columns in the A matrix.</param>
/// <param name="s">The singular values of A in ascending value.</param>
/// <param name="u">On exit U contains the left singular vectors.</param>
/// <param name="vt">On exit VT contains the transposed right singular vectors.</param>
/// <param name="b">The B matrix.</param>
/// <param name="bColumns">The number of columns of B.</param>
/// <param name="columnsB">The number of columns of B.</param>
/// <param name="x">On exit, the solution matrix.</param>
public override void SvdSolve(<#=dataType#>[] a, int aRows, int aColumns, <#=dataType#>[] s, <#=dataType#>[] u, <#=dataType#>[] vt, <#=dataType#>[] b, int bColumns, <#=dataType#>[] x)
public override void SvdSolve(<#=dataType#>[] a, int rowsA, int columnsA, <#=dataType#>[] s, <#=dataType#>[] u, <#=dataType#>[] vt, <#=dataType#>[] b, int columnsB, <#=dataType#>[] x)
{
throw new NotImplementedException();
}
@ -496,18 +493,18 @@
/// Solves A*X=B for X using the singular value decomposition of A.
/// </summary>
/// <param name="a">On entry, the M by N matrix to decompose. On exit, A may be overwritten.</param>
/// <param name="aRows">The number of rows in the A matrix.</param>
/// <param name="aColumns">The number of columns in the A matrix.</param>
/// <param name="rowsA">The number of rows in the A matrix.</param>
/// <param name="columnsA">The number of columns in the A matrix.</param>
/// <param name="s">The singular values of A in ascending value.</param>
/// <param name="u">On exit U contains the left singular vectors.</param>
/// <param name="vt">On exit VT contains the transposed right singular vectors.</param>
/// <param name="b">The B matrix.</param>
/// <param name="bColumns">The number of columns of B.</param>
/// <param name="columnsB">The number of columns of B.</param>
/// <param name="x">On exit, the solution matrix.</param>
/// <param name="work">The work array. For real matrices, the work array should be at least
/// On exit, work[0] contains the optimal work size value.</param>
public override void SvdSolve(<#=dataType#>[] a, int aRows, int aColumns, <#=dataType#>[] s, <#=dataType#>[] u, <#=dataType#>[] vt, <#=dataType#>[] b, int bColumns, <#=dataType#>[] x, <#=dataType#>[] work)
public override void SvdSolve(<#=dataType#>[] a, int rowsA, int columnsA, <#=dataType#>[] s, <#=dataType#>[] u, <#=dataType#>[] vt, <#=dataType#>[] b, int columnsB, <#=dataType#>[] x, <#=dataType#>[] work)
{
throw new NotImplementedException();
}
@ -515,15 +512,15 @@
/// <summary>
/// Solves A*X=B for X using a previously SVD decomposed matrix.
/// </summary>
/// <param name="aRows">The number of rows in the A matrix.</param>
/// <param name="aColumns">The number of columns in the A matrix.</param>
/// <param name="rowsA">The number of rows in the A matrix.</param>
/// <param name="columnsA">The number of columns in the A matrix.</param>
/// <param name="s">The s values returned by <see cref="SingularValueDecomposition(bool,<#=dataType#>[],int,int,<#=dataType#>[],<#=dataType#>[],<#=dataType#>[])"/>.</param>
/// <param name="u">The left singular vectors returned by <see cref="SingularValueDecomposition(bool,<#=dataType#>[],int,int,<#=dataType#>[],<#=dataType#>[],<#=dataType#>[])"/>.</param>
/// <param name="vt">The right singular vectors returned by <see cref="SingularValueDecomposition(bool,<#=dataType#>[],int,int,<#=dataType#>[],<#=dataType#>[],<#=dataType#>[])"/>.</param>
/// <param name="b">The B matrix.</param>
/// <param name="bColumns">The number of columns of B.</param>
/// <param name="columnsB">The number of columns of B.</param>
/// <param name="x">On exit, the solution matrix.</param>
public override void SvdSolveFactored(int aRows, int aColumns, <#=dataType#>[] s, <#=dataType#>[] u, <#=dataType#>[] vt, <#=dataType#>[] b, int bColumns, <#=dataType#>[] x)
public override void SvdSolveFactored(int rowsA, int columnsA, <#=dataType#>[] s, <#=dataType#>[] u, <#=dataType#>[] vt, <#=dataType#>[] b, int columnsB, <#=dataType#>[] x)