|
|
|
@ -42,7 +42,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="alpha">The value to scale <paramref name="x"/> by.</param>
|
|
|
|
/// <param name="x">The vector to add to <paramref name="y"/>.</param>
|
|
|
|
/// <remarks>This equivalent to the AXPY BLAS routine.</remarks>
|
|
|
|
public void AddVectorToScaledVector(Complex32[] y, Complex32 alpha, Complex32[] x) |
|
|
|
public virtual void AddVectorToScaledVector(Complex32[] y, Complex32 alpha, Complex32[] x) |
|
|
|
{ |
|
|
|
if (y == null) |
|
|
|
{ |
|
|
|
@ -80,7 +80,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="alpha">The scalar.</param>
|
|
|
|
/// <param name="x">The values to scale.</param>
|
|
|
|
/// <remarks>This is equivalent to the SCAL BLAS routine.</remarks>
|
|
|
|
public void ScaleArray(Complex32 alpha, Complex32[] x) |
|
|
|
public virtual void ScaleArray(Complex32 alpha, Complex32[] x) |
|
|
|
{ |
|
|
|
if (x == null) |
|
|
|
{ |
|
|
|
@ -102,7 +102,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="y">The vector y.</param>
|
|
|
|
/// <returns>The dot product of x and y.</returns>
|
|
|
|
/// <remarks>This is equivalent to the DOT BLAS routine.</remarks>
|
|
|
|
public Complex32 DotProduct(Complex32[] x, Complex32[] y) |
|
|
|
public virtual Complex32 DotProduct(Complex32[] x, Complex32[] y) |
|
|
|
{ |
|
|
|
if (y == null) |
|
|
|
{ |
|
|
|
@ -139,7 +139,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <remarks>There is no equivalent BLAS routine, but many libraries
|
|
|
|
/// provide optimized (parallel and/or vectorized) versions of this
|
|
|
|
/// routine.</remarks>
|
|
|
|
public void AddArrays(Complex32[] x, Complex32[] y, Complex32[] result) |
|
|
|
public virtual void AddArrays(Complex32[] x, Complex32[] y, Complex32[] result) |
|
|
|
{ |
|
|
|
if (y == null) |
|
|
|
{ |
|
|
|
@ -174,7 +174,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <remarks>There is no equivalent BLAS routine, but many libraries
|
|
|
|
/// provide optimized (parallel and/or vectorized) versions of this
|
|
|
|
/// routine.</remarks>
|
|
|
|
public void SubtractArrays(Complex32[] x, Complex32[] y, Complex32[] result) |
|
|
|
public virtual void SubtractArrays(Complex32[] x, Complex32[] y, Complex32[] result) |
|
|
|
{ |
|
|
|
if (y == null) |
|
|
|
{ |
|
|
|
@ -209,7 +209,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <remarks>There is no equivalent BLAS routine, but many libraries
|
|
|
|
/// provide optimized (parallel and/or vectorized) versions of this
|
|
|
|
/// routine.</remarks>
|
|
|
|
public void PointWiseMultiplyArrays(Complex32[] x, Complex32[] y, Complex32[] result) |
|
|
|
public virtual void PointWiseMultiplyArrays(Complex32[] x, Complex32[] y, Complex32[] result) |
|
|
|
{ |
|
|
|
if (y == null) |
|
|
|
{ |
|
|
|
@ -244,7 +244,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <remarks>There is no equivalent BLAS routine, but many libraries
|
|
|
|
/// provide optimized (parallel and/or vectorized) versions of this
|
|
|
|
/// routine.</remarks>
|
|
|
|
public void PointWiseDivideArrays(Complex32[] x, Complex32[] y, Complex32[] result) |
|
|
|
public virtual void PointWiseDivideArrays(Complex32[] x, Complex32[] y, Complex32[] result) |
|
|
|
{ |
|
|
|
if (y == null) |
|
|
|
{ |
|
|
|
@ -279,7 +279,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <returns>
|
|
|
|
/// The requested <see cref="Norm"/> of the matrix.
|
|
|
|
/// </returns>
|
|
|
|
public Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix) |
|
|
|
public virtual Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix) |
|
|
|
{ |
|
|
|
var ret = 0.0; |
|
|
|
switch (norm) |
|
|
|
@ -349,7 +349,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <returns>
|
|
|
|
/// The requested <see cref="Norm"/> of the matrix.
|
|
|
|
/// </returns>
|
|
|
|
public Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix, Complex32[] work) |
|
|
|
public virtual Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix, Complex32[] work) |
|
|
|
{ |
|
|
|
return MatrixNorm(norm, rows, columns, matrix); |
|
|
|
} |
|
|
|
@ -366,7 +366,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="result">Where to store the result of the multiplication.</param>
|
|
|
|
/// <remarks>This is a simplified version of the BLAS GEMM routine with alpha
|
|
|
|
/// set to 1.0 and beta set to 0.0, and x and y are not transposed.</remarks>
|
|
|
|
public void MatrixMultiply(Complex32[] x, int rowsX, int columnsX, Complex32[] y, int rowsY, int columnsY, Complex32[] result) |
|
|
|
public virtual void MatrixMultiply(Complex32[] x, int rowsX, int columnsX, Complex32[] y, int rowsY, int columnsY, Complex32[] result) |
|
|
|
{ |
|
|
|
// First check some basic requirement on the parameters of the matrix multiplication.
|
|
|
|
if (x == null) |
|
|
|
@ -448,7 +448,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <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 void MatrixMultiplyWithUpdate(Transpose transposeA, Transpose transposeB, Complex32 alpha, Complex32[] a, int rowsA, int columnsA, Complex32[] b, int rowsB, int columnsB, Complex32 beta, Complex32[] c) |
|
|
|
public virtual void MatrixMultiplyWithUpdate(Transpose transposeA, Transpose transposeB, Complex32 alpha, Complex32[] a, int rowsA, int columnsA, Complex32[] b, int rowsB, int columnsB, Complex32 beta, Complex32[] c) |
|
|
|
{ |
|
|
|
// Choose nonsensical values for the number of rows in c; fill them in depending
|
|
|
|
// on the operations on a and b.
|
|
|
|
@ -826,7 +826,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="order">The order of the square matrix <paramref name="data"/>.</param>
|
|
|
|
/// <param name="ipiv">On exit, it contains the pivot indices. The size of the array must be <paramref name="order"/>.</param>
|
|
|
|
/// <remarks>This is equivalent to the GETRF LAPACK routine.</remarks>
|
|
|
|
public void LUFactor(Complex32[] data, int order, int[] ipiv) |
|
|
|
public virtual void LUFactor(Complex32[] data, int order, int[] ipiv) |
|
|
|
{ |
|
|
|
if (data == null) |
|
|
|
{ |
|
|
|
@ -924,7 +924,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="a">The N by N matrix to invert. Contains the inverse On exit.</param>
|
|
|
|
/// <param name="order">The order of the square matrix <paramref name="a"/>.</param>
|
|
|
|
/// <remarks>This is equivalent to the GETRF and GETRI LAPACK routines.</remarks>
|
|
|
|
public void LUInverse(Complex32[] a, int order) |
|
|
|
public virtual void LUInverse(Complex32[] a, int order) |
|
|
|
{ |
|
|
|
if (a == null) |
|
|
|
{ |
|
|
|
@ -948,7 +948,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="order">The order of the square matrix <paramref name="a"/>.</param>
|
|
|
|
/// <param name="ipiv">The pivot indices of <paramref name="a"/>.</param>
|
|
|
|
/// <remarks>This is equivalent to the GETRI LAPACK routine.</remarks>
|
|
|
|
public void LUInverseFactored(Complex32[] a, int order, int[] ipiv) |
|
|
|
public virtual void LUInverseFactored(Complex32[] a, int order, int[] ipiv) |
|
|
|
{ |
|
|
|
if (a == null) |
|
|
|
{ |
|
|
|
@ -989,7 +989,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// but should be N*blocksize. The blocksize is machine dependent. On exit, work[0] contains the optimal
|
|
|
|
/// work size value.</param>
|
|
|
|
/// <remarks>This is equivalent to the GETRF and GETRI LAPACK routines.</remarks>
|
|
|
|
public void LUInverse(Complex32[] a, int order, Complex32[] work) |
|
|
|
public virtual void LUInverse(Complex32[] a, int order, Complex32[] work) |
|
|
|
{ |
|
|
|
LUInverse(a, order); |
|
|
|
} |
|
|
|
@ -1004,7 +1004,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// but should be N*blocksize. The blocksize is machine dependent. On exit, work[0] contains the optimal
|
|
|
|
/// work size value.</param>
|
|
|
|
/// <remarks>This is equivalent to the GETRI LAPACK routine.</remarks>
|
|
|
|
public void LUInverseFactored(Complex32[] a, int order, int[] ipiv, Complex32[] work) |
|
|
|
public virtual void LUInverseFactored(Complex32[] a, int order, int[] ipiv, Complex32[] work) |
|
|
|
{ |
|
|
|
LUInverseFactored(a, order, ipiv); |
|
|
|
} |
|
|
|
@ -1017,7 +1017,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="order">The order of the square matrix <paramref name="a"/>.</param>
|
|
|
|
/// <param name="b">The B matrix.</param>
|
|
|
|
/// <remarks>This is equivalent to the GETRF and GETRS LAPACK routines.</remarks>
|
|
|
|
public void LUSolve(int columnsOfB, Complex32[] a, int order, Complex32[] b) |
|
|
|
public virtual void LUSolve(int columnsOfB, Complex32[] a, int order, Complex32[] b) |
|
|
|
{ |
|
|
|
if (a == null) |
|
|
|
{ |
|
|
|
@ -1053,7 +1053,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="ipiv">The pivot indices of <paramref name="a"/>.</param>
|
|
|
|
/// <param name="b">The B matrix.</param>
|
|
|
|
/// <remarks>This is equivalent to the GETRS LAPACK routine.</remarks>
|
|
|
|
public void LUSolveFactored(int columnsOfB, Complex32[] a, int order, int[] ipiv, Complex32[] b) |
|
|
|
public virtual void LUSolveFactored(int columnsOfB, Complex32[] a, int order, int[] ipiv, Complex32[] b) |
|
|
|
{ |
|
|
|
if (a == null) |
|
|
|
{ |
|
|
|
@ -1149,7 +1149,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="order">The order of the square matrix <paramref name="a"/>.</param>
|
|
|
|
/// <param name="b">The B matrix.</param>
|
|
|
|
/// <remarks>This is equivalent to the GETRF and GETRS LAPACK routines.</remarks>
|
|
|
|
public void LUSolve(Transpose transposeA, int columnsOfB, Complex32[] a, int order, Complex32[] b) |
|
|
|
public virtual void LUSolve(Transpose transposeA, int columnsOfB, Complex32[] a, int order, Complex32[] b) |
|
|
|
{ |
|
|
|
if (a == null) |
|
|
|
{ |
|
|
|
@ -1186,7 +1186,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="ipiv">The pivot indices of <paramref name="a"/>.</param>
|
|
|
|
/// <param name="b">The B matrix.</param>
|
|
|
|
/// <remarks>This is equivalent to the GETRS LAPACK routine.</remarks>
|
|
|
|
public void LUSolveFactored(Transpose transposeA, int columnsOfB, Complex32[] a, int order, int[] ipiv, Complex32[] b) |
|
|
|
public virtual void LUSolveFactored(Transpose transposeA, int columnsOfB, Complex32[] a, int order, int[] ipiv, Complex32[] b) |
|
|
|
{ |
|
|
|
if (a == null) |
|
|
|
{ |
|
|
|
@ -1257,7 +1257,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// the Cholesky factorization.</param>
|
|
|
|
/// <param name="order">The number of rows or columns in the matrix.</param>
|
|
|
|
/// <remarks>This is equivalent to the POTRF LAPACK routine.</remarks>
|
|
|
|
public void CholeskyFactor(Complex32[] a, int order) |
|
|
|
public virtual void CholeskyFactor(Complex32[] a, int order) |
|
|
|
{ |
|
|
|
if (a == null) |
|
|
|
{ |
|
|
|
@ -1345,7 +1345,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <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 POTRF add POTRS LAPACK routines.</remarks>
|
|
|
|
public void CholeskySolve(Complex32[] a, int orderA, Complex32[] b, int rowsB, int columnsB) |
|
|
|
public virtual void CholeskySolve(Complex32[] a, int orderA, Complex32[] b, int rowsB, int columnsB) |
|
|
|
{ |
|
|
|
if (a == null) |
|
|
|
{ |
|
|
|
@ -1380,7 +1380,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <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 void CholeskySolveFactored(Complex32[] a, int orderA, Complex32[] b, int rowsB, int columnsB) |
|
|
|
public virtual void CholeskySolveFactored(Complex32[] a, int orderA, Complex32[] b, int rowsB, int columnsB) |
|
|
|
{ |
|
|
|
if (a == null) |
|
|
|
{ |
|
|
|
@ -1447,7 +1447,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <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 void QRFactor(Complex32[] r, int rowsR, int columnsR, Complex32[] q) |
|
|
|
public virtual void QRFactor(Complex32[] r, int rowsR, int columnsR, Complex32[] q) |
|
|
|
{ |
|
|
|
if (r == null) |
|
|
|
{ |
|
|
|
@ -1486,7 +1486,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// 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 void QRFactor(Complex32[] r, int rowsR, int columnsR, Complex32[] q, Complex32[] work) |
|
|
|
public virtual void QRFactor(Complex32[] r, int rowsR, int columnsR, Complex32[] q, Complex32[] work) |
|
|
|
{ |
|
|
|
if (r == null) |
|
|
|
{ |
|
|
|
@ -1650,7 +1650,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="b">The B matrix.</param>
|
|
|
|
/// <param name="columnsB">The number of columns of B.</param>
|
|
|
|
/// <param name="x">On exit, the solution matrix.</param>
|
|
|
|
public void QRSolve(Complex32[] r, int rowsR, int columnsR, Complex32[] q, Complex32[] b, int columnsB, Complex32[] x) |
|
|
|
public virtual void QRSolve(Complex32[] r, int rowsR, int columnsR, Complex32[] q, Complex32[] b, int columnsB, Complex32[] x) |
|
|
|
{ |
|
|
|
if (r == null) |
|
|
|
{ |
|
|
|
@ -1711,7 +1711,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <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 void QRSolve(Complex32[] r, int rowsR, int columnsR, Complex32[] q, Complex32[] b, int columnsB, Complex32[] x, Complex32[] work) |
|
|
|
public virtual void QRSolve(Complex32[] r, int rowsR, int columnsR, Complex32[] q, Complex32[] b, int columnsB, Complex32[] x, Complex32[] work) |
|
|
|
{ |
|
|
|
if (r == null) |
|
|
|
{ |
|
|
|
@ -1775,7 +1775,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="b">The B matrix.</param>
|
|
|
|
/// <param name="columnsB">The number of columns of B.</param>
|
|
|
|
/// <param name="x">On exit, the solution matrix.</param>
|
|
|
|
public void QRSolveFactored(Complex32[] q, Complex32[] r, int rowsR, int columnsR, Complex32[] b, int columnsB, Complex32[] x) |
|
|
|
public virtual void QRSolveFactored(Complex32[] q, Complex32[] r, int rowsR, int columnsR, Complex32[] b, int columnsB, Complex32[] x) |
|
|
|
{ |
|
|
|
if (r == null) |
|
|
|
{ |
|
|
|
@ -1883,7 +1883,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="vt">If <paramref name="computeVectors"/> is true, on exit VT contains the transposed
|
|
|
|
/// right singular vectors.</param>
|
|
|
|
/// <remarks>This is equivalent to the GESVD LAPACK routine.</remarks>
|
|
|
|
public void SingularValueDecomposition(bool computeVectors, Complex32[] a, int rowsA, int columnsA, Complex32[] s, Complex32[] u, Complex32[] vt) |
|
|
|
public virtual void SingularValueDecomposition(bool computeVectors, Complex32[] a, int rowsA, int columnsA, Complex32[] s, Complex32[] u, Complex32[] vt) |
|
|
|
{ |
|
|
|
if (a == null) |
|
|
|
{ |
|
|
|
@ -1941,7 +1941,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// Max(3*Min(M, N) + Max(M, N), 5*Min(M,N)). For complex matrices, 2*Min(M, N) + Max(M, N).
|
|
|
|
/// On exit, work[0] contains the optimal work size value.</param>
|
|
|
|
/// <remarks>This is equivalent to the GESVD LAPACK routine.</remarks>
|
|
|
|
public void SingularValueDecomposition(bool computeVectors, Complex32[] a, int rowsA, int columnsA, Complex32[] s, Complex32[] u, Complex32[] vt, Complex32[] work) |
|
|
|
public virtual void SingularValueDecomposition(bool computeVectors, Complex32[] a, int rowsA, int columnsA, Complex32[] s, Complex32[] u, Complex32[] vt, Complex32[] work) |
|
|
|
{ |
|
|
|
if (a == null) |
|
|
|
{ |
|
|
|
@ -2623,7 +2623,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="b">The B matrix.</param>
|
|
|
|
/// <param name="columnsB">The number of columns of B.</param>
|
|
|
|
/// <param name="x">On exit, the solution matrix.</param>
|
|
|
|
public void SvdSolve(Complex32[] a, int rowsA, int columnsA, Complex32[] s, Complex32[] u, Complex32[] vt, Complex32[] b, int columnsB, Complex32[] x) |
|
|
|
public virtual void SvdSolve(Complex32[] a, int rowsA, int columnsA, Complex32[] s, Complex32[] u, Complex32[] vt, Complex32[] b, int columnsB, Complex32[] x) |
|
|
|
{ |
|
|
|
if (a == null) |
|
|
|
{ |
|
|
|
@ -2700,7 +2700,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="work">The work array. For real matrices, the work array should be at least
|
|
|
|
/// Max(3*Min(M, N) + Max(M, N), 5*Min(M,N)). For complex matrices, 2*Min(M, N) + Max(M, N).
|
|
|
|
/// On exit, work[0] contains the optimal work size value.</param>
|
|
|
|
public void SvdSolve(Complex32[] a, int rowsA, int columnsA, Complex32[] s, Complex32[] u, Complex32[] vt, Complex32[] b, int columnsB, Complex32[] x, Complex32[] work) |
|
|
|
public virtual void SvdSolve(Complex32[] a, int rowsA, int columnsA, Complex32[] s, Complex32[] u, Complex32[] vt, Complex32[] b, int columnsB, Complex32[] x, Complex32[] work) |
|
|
|
{ |
|
|
|
if (a == null) |
|
|
|
{ |
|
|
|
@ -2783,7 +2783,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra |
|
|
|
/// <param name="b">The B matrix.</param>
|
|
|
|
/// <param name="columnsB">The number of columns of B.</param>
|
|
|
|
/// <param name="x">On exit, the solution matrix.</param>
|
|
|
|
public void SvdSolveFactored(int rowsA, int columnsA, Complex32[] s, Complex32[] u, Complex32[] vt, Complex32[] b, int columnsB, Complex32[] x) |
|
|
|
public virtual void SvdSolveFactored(int rowsA, int columnsA, Complex32[] s, Complex32[] u, Complex32[] vt, Complex32[] b, int columnsB, Complex32[] x) |
|
|
|
{ |
|
|
|
if (s == null) |
|
|
|
{ |
|
|
|
|