Class DenseSolver
- Namespace
- NVMathNet.Solver
- Assembly
- NVMath.Net.dll
Stateless helpers for cuSOLVER dense operations: LU, Cholesky, SVD, eigenvalue decomposition, and QR factorisation. All matrices use column-major layout.
public static class DenseSolverInheritance
Inherited Members
Methods
CholeskyAsync(DeviceBuffer<Complex>, int, bool, CudaStream?, CancellationToken)
Cholesky factorisation of a Hermitian positive-definite matrix, in place. Throws System.InvalidOperationException if the matrix is not positive definite.
public static Task CholeskyAsync(DeviceBuffer<Complex> a, int n, bool upper = false, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer for the n×n matrix (overwritten with the factor).
nint-
Order of the matrix.
upperbool-
Compute the upper factor instead of the lower.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
CholeskyAsync(DeviceBuffer<float>, int, bool, CudaStream?, CancellationToken)
Computes the Cholesky factorisation of a symmetric positive-definite matrix (single-precision). A is overwritten with the factor L (lower) or U (upper).
public static Task CholeskyAsync(DeviceBuffer<float> a, int n, bool upper = false, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<float>-
Device buffer for n×n SPD matrix A (overwritten).
nint-
Order of the matrix.
upperbool-
If true, compute upper factor; otherwise lower.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
CholeskyAsync(DeviceBuffer<double>, int, bool, CudaStream?, CancellationToken)
Computes the Cholesky factorisation (double-precision).
public static Task CholeskyAsync(DeviceBuffer<double> a, int n, bool upper = false, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<double>nintupperboolstreamCudaStream?ctCancellationToken
Returns
CholeskyBatchedAsync(DeviceBuffer<Complex>, int, int, bool, CudaStream?, CancellationToken)
Cholesky factorisation of a batch of independent Hermitian positive-definite matrices, packed back-to-back.
public static Task<int[]> CholeskyBatchedAsync(DeviceBuffer<Complex> a, int n, int batchCount, bool upper = false, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer of
batchCount·n·nelements; each matrix is overwritten with its factor. nint-
Order of each matrix.
batchCountint-
Number of matrices.
upperbool-
Compute the upper factor instead of the lower.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
- Task<int[]>
-
Per-matrix status: 0 = success; a positive value means the matrix is not positive definite.
CholeskyBatchedAsync<T>(DeviceBuffer<T>, int, int, bool, CudaStream?, CancellationToken)
Cholesky factorisation of a batch of independent symmetric positive-definite matrices,
stored back-to-back (matrix i starts at element i·n·n). Each matrix is
overwritten with its factor.
public static Task<int[]> CholeskyBatchedAsync<T>(DeviceBuffer<T> a, int n, int batchCount, bool upper = false, CudaStream? stream = null, CancellationToken ct = default) where T : unmanaged, INumberBase<T>Parameters
aDeviceBuffer<T>-
Device buffer of
batchCount·n·nelements. nint-
Order of each matrix.
batchCountint-
Number of matrices.
upperbool-
Compute the upper factor instead of the lower.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
- Task<int[]>
-
Per-matrix status: 0 = success; a positive value means the matrix is not positive definite.
Type Parameters
T
EigAsync(DeviceBuffer<float>, DeviceBuffer<float>, int, bool, bool, CudaStream?, CancellationToken)
Computes eigenvalues (and optionally eigenvectors) of a symmetric matrix (single-precision). A is overwritten with eigenvectors (if requested); W receives eigenvalues in ascending order.
public static Task EigAsync(DeviceBuffer<float> a, DeviceBuffer<float> w, int n, bool computeVectors = true, bool upper = false, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<float>-
Device buffer for n×n symmetric matrix A (overwritten with eigenvectors if computeVectors=true).
wDeviceBuffer<float>-
Device buffer for n eigenvalues.
nint-
Order of the matrix.
computeVectorsbool-
If true, compute eigenvectors in A.
upperbool-
If true, read upper triangle; otherwise lower.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
EigAsync(DeviceBuffer<double>, DeviceBuffer<double>, int, bool, bool, CudaStream?, CancellationToken)
Computes eigenvalues (and optionally eigenvectors) of a symmetric matrix (double-precision).
public static Task EigAsync(DeviceBuffer<double> a, DeviceBuffer<double> w, int n, bool computeVectors = true, bool upper = false, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<double>wDeviceBuffer<double>nintcomputeVectorsboolupperboolstreamCudaStream?ctCancellationToken
Returns
HermitianEigAsync(DeviceBuffer<Complex>, DeviceBuffer<double>, int, bool, bool, CudaStream?, CancellationToken)
Eigenvalue decomposition of a Hermitian matrix: eigenvalues (real, ascending) in
w and, if requested, orthonormal eigenvectors overwriting a.
public static Task HermitianEigAsync(DeviceBuffer<Complex> a, DeviceBuffer<double> w, int n, bool computeVectors = true, bool upper = false, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer for the n×n Hermitian matrix.
wDeviceBuffer<double>-
Device buffer of n real eigenvalues (output).
nint-
Order of the matrix.
computeVectorsbool-
Whether to compute eigenvectors.
upperbool-
Whether the upper triangle is referenced instead of the lower.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
LeastSquaresAsync(DeviceBuffer<Complex>, DeviceBuffer<Complex>, int, int, int, CudaStream?, CancellationToken)
Solves the overdetermined least-squares problem min ‖A·X − B‖₂ via QR
(m ≥ n, A of full column rank).
public static Task LeastSquaresAsync(DeviceBuffer<Complex> a, DeviceBuffer<Complex> b, int m, int n, int nrhs = 1, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer for the m×n matrix A; overwritten with its QR factorisation.
bDeviceBuffer<Complex>-
Device buffer for the m×nrhs right-hand sides (leading dimension m). On return the first n rows of each column hold the solution; the remaining rows hold the transformed residual.
mint-
Number of rows of A.
nint-
Number of columns of A (≤ m).
nrhsint-
Number of right-hand sides.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
LeastSquaresAsync<T>(DeviceBuffer<T>, DeviceBuffer<T>, int, int, int, CudaStream?, CancellationToken)
Solves the overdetermined least-squares problem min ‖A·X − B‖₂ via QR
(m ≥ n, A of full column rank).
public static Task LeastSquaresAsync<T>(DeviceBuffer<T> a, DeviceBuffer<T> b, int m, int n, int nrhs = 1, CudaStream? stream = null, CancellationToken ct = default) where T : unmanaged, INumberBase<T>Parameters
aDeviceBuffer<T>-
Device buffer for the m×n matrix A; overwritten with its QR factorisation.
bDeviceBuffer<T>-
Device buffer for the m×nrhs right-hand sides (leading dimension m). On return the first n rows of each column hold the solution; the remaining rows hold the transformed residual.
mint-
Number of rows of A.
nint-
Number of columns of A (≤ m).
nrhsint-
Number of right-hand sides.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
Type Parameters
T
LuFactorAsync(DeviceBuffer<Complex>, DeviceBuffer<int>, int, int, CudaStream?, CancellationToken)
Computes the LU factorisation with partial pivoting P·A = L·U in place.
public static Task<int> LuFactorAsync(DeviceBuffer<Complex> a, DeviceBuffer<int> ipiv, int m, int n, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer for the m×n matrix A; overwritten with the L\U factors.
ipivDeviceBuffer<int>-
Device buffer of
min(m, n)pivot indices (output). mint-
Number of rows.
nint-
Number of columns.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
LuFactorAsync<T>(DeviceBuffer<T>, DeviceBuffer<int>, int, int, CudaStream?, CancellationToken)
Computes the LU factorisation with partial pivoting P·A = L·U in place.
public static Task<int> LuFactorAsync<T>(DeviceBuffer<T> a, DeviceBuffer<int> ipiv, int m, int n, CudaStream? stream = null, CancellationToken ct = default) where T : unmanaged, INumberBase<T>Parameters
aDeviceBuffer<T>-
Device buffer for the m×n matrix A; overwritten with the L\U factors.
ipivDeviceBuffer<int>-
Device buffer of
min(m, n)pivot indices (output). mint-
Number of rows.
nint-
Number of columns.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
Type Parameters
T
LuFactorBatchedAsync<T>(DeviceBuffer<T>, DeviceBuffer<int>, int, int, CudaStream?, CancellationToken)
LU factorisation with partial pivoting of a batch of independent n×n matrices, in place.
public static Task<int[]> LuFactorBatchedAsync<T>(DeviceBuffer<T> a, DeviceBuffer<int> ipiv, int n, int batchCount, CudaStream? stream = null, CancellationToken ct = default) where T : unmanaged, INumberBase<T>Parameters
aDeviceBuffer<T>-
Device buffer of
batchCount·n·nelements; overwritten with the L\U factors. ipivDeviceBuffer<int>-
Device buffer of
batchCount·npivot indices (output). nint-
Order of each matrix.
batchCountint-
Number of matrices.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
Type Parameters
T
LuFactorBatchedAsync(DeviceBuffer<Complex>, DeviceBuffer<int>, int, int, CudaStream?, CancellationToken)
LU factorisation with partial pivoting of a batch of independent complex n×n matrices, in place.
public static Task<int[]> LuFactorBatchedAsync(DeviceBuffer<Complex> a, DeviceBuffer<int> ipiv, int n, int batchCount, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer of
batchCount·n·nelements; overwritten with the L\U factors. ipivDeviceBuffer<int>-
Device buffer of
batchCount·npivot indices (output). nint-
Order of each matrix.
batchCountint-
Number of matrices.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
LuSolveAsync(DeviceBuffer<Complex>, DeviceBuffer<int>, DeviceBuffer<Complex>, int, int, bool, CudaStream?, CancellationToken)
Solves op(A)·X = B from a complex LU factorisation, where op is the identity or, with
transpose, the plain transpose. Use the overload with a conjugate argument for the
conjugate transpose.
public static Task LuSolveAsync(DeviceBuffer<Complex> a, DeviceBuffer<int> ipiv, DeviceBuffer<Complex> b, int n, int nrhs = 1, bool transpose = false, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer holding the n×n L\U factors.
ipivDeviceBuffer<int>-
Pivot indices from the factorisation.
bDeviceBuffer<Complex>-
Device buffer for the n×nrhs right-hand sides; overwritten with the solution.
nint-
Order of A.
nrhsint-
Number of right-hand sides.
transposebool-
Solve with the transpose of A.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
LuSolveAsync(DeviceBuffer<Complex>, DeviceBuffer<int>, DeviceBuffer<Complex>, int, int, bool, bool, CudaStream?, CancellationToken)
Solves op(A)·X = B from the factors produced by
NVMathNet.Solver.DenseSolver.LuFactorAsync(NVMathNet.DeviceBuffer{System.Numerics.Complex},NVMathNet.DeviceBuffer{System.Int32},System.Int32,System.Int32,NVMathNet.CudaStream,System.Threading.CancellationToken).
public static Task LuSolveAsync(DeviceBuffer<Complex> a, DeviceBuffer<int> ipiv, DeviceBuffer<Complex> b, int n, int nrhs, bool transpose, bool conjugate, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer holding the n×n L\U factors.
ipivDeviceBuffer<int>-
Pivot indices from the factorisation.
bDeviceBuffer<Complex>-
Device buffer for the n×nrhs right-hand sides; overwritten with the solution.
nint-
Order of A.
nrhsint-
Number of right-hand sides.
transposebool-
Solve with the transpose of A.
conjugatebool-
With
transpose, solve with the conjugate transpose. streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
LuSolveAsync<T>(DeviceBuffer<T>, DeviceBuffer<int>, DeviceBuffer<T>, int, int, bool, CudaStream?, CancellationToken)
Solves op(A)·X = B using a factorisation produced by NVMathNet.Solver.DenseSolver.LuFactorAsync``1(NVMathNet.DeviceBuffer{``0},NVMathNet.DeviceBuffer{System.Int32},System.Int32,System.Int32,NVMathNet.CudaStream,System.Threading.CancellationToken).
public static Task LuSolveAsync<T>(DeviceBuffer<T> a, DeviceBuffer<int> ipiv, DeviceBuffer<T> b, int n, int nrhs = 1, bool transpose = false, CudaStream? stream = null, CancellationToken ct = default) where T : unmanaged, INumberBase<T>Parameters
aDeviceBuffer<T>-
Device buffer holding the n×n L\U factors.
ipivDeviceBuffer<int>-
Pivot indices from NVMathNet.Solver.DenseSolver.LuFactorAsync``1(NVMathNet.DeviceBuffer{``0},NVMathNet.DeviceBuffer{System.Int32},System.Int32,System.Int32,NVMathNet.CudaStream,System.Threading.CancellationToken).
bDeviceBuffer<T>-
Device buffer for the n×nrhs right-hand sides; overwritten with the solution.
nint-
Order of A.
nrhsint-
Number of right-hand sides.
transposebool-
Solve with the transpose of A.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
Type Parameters
T
LuSolveBatchedAsync<T>(DeviceBuffer<T>, DeviceBuffer<int>, DeviceBuffer<T>, int, int, int, bool, CudaStream?, CancellationToken)
Solves op(A_i)·X_i = B_i for every matrix of a batch from the factors produced by
NVMathNet.Solver.DenseSolver.LuFactorBatchedAsync``1(NVMathNet.DeviceBuffer{``0},NVMathNet.DeviceBuffer{System.Int32},System.Int32,System.Int32,NVMathNet.CudaStream,System.Threading.CancellationToken).
public static Task LuSolveBatchedAsync<T>(DeviceBuffer<T> a, DeviceBuffer<int> ipiv, DeviceBuffer<T> b, int n, int nrhs, int batchCount, bool transpose = false, CudaStream? stream = null, CancellationToken ct = default) where T : unmanaged, INumberBase<T>Parameters
aDeviceBuffer<T>-
Device buffer holding the batch of L\U factors.
ipivDeviceBuffer<int>-
Pivot indices from NVMathNet.Solver.DenseSolver.LuFactorBatchedAsync``1(NVMathNet.DeviceBuffer{``0},NVMathNet.DeviceBuffer{System.Int32},System.Int32,System.Int32,NVMathNet.CudaStream,System.Threading.CancellationToken).
bDeviceBuffer<T>-
Device buffer of
batchCount·n·nrhsright-hand sides; overwritten with the solutions. nint-
Order of each matrix.
nrhsint-
Right-hand sides per matrix.
batchCountint-
Number of matrices.
transposebool-
Solve with the transpose of each A.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
Type Parameters
T
LuSolveBatchedAsync(DeviceBuffer<Complex>, DeviceBuffer<int>, DeviceBuffer<Complex>, int, int, int, bool, CudaStream?, CancellationToken)
Solves op(A_i)·X_i = B_i for every matrix of a complex batch, where op is the identity or, with
transpose, the plain transpose. Use the overload with a conjugate argument for the
conjugate transpose.
public static Task LuSolveBatchedAsync(DeviceBuffer<Complex> a, DeviceBuffer<int> ipiv, DeviceBuffer<Complex> b, int n, int nrhs, int batchCount, bool transpose = false, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer holding the batch of L\U factors.
ipivDeviceBuffer<int>-
Pivot indices from the factorisation.
bDeviceBuffer<Complex>-
Device buffer of
batchCount·n·nrhsright-hand sides; overwritten with the solutions. nint-
Order of each matrix.
nrhsint-
Right-hand sides per matrix.
batchCountint-
Number of matrices.
transposebool-
Solve with the transpose of each A.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
LuSolveBatchedAsync(DeviceBuffer<Complex>, DeviceBuffer<int>, DeviceBuffer<Complex>, int, int, int, bool, bool, CudaStream?, CancellationToken)
Solves op(A_i)·X_i = B_i for every matrix of a complex batch from the factors produced by
NVMathNet.Solver.DenseSolver.LuFactorBatchedAsync(NVMathNet.DeviceBuffer{System.Numerics.Complex},NVMathNet.DeviceBuffer{System.Int32},System.Int32,System.Int32,NVMathNet.CudaStream,System.Threading.CancellationToken).
public static Task LuSolveBatchedAsync(DeviceBuffer<Complex> a, DeviceBuffer<int> ipiv, DeviceBuffer<Complex> b, int n, int nrhs, int batchCount, bool transpose, bool conjugate, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer holding the batch of L\U factors.
ipivDeviceBuffer<int>-
Pivot indices from the factorisation.
bDeviceBuffer<Complex>-
Device buffer of
batchCount·n·nrhsright-hand sides; overwritten with the solutions. nint-
Order of each matrix.
nrhsint-
Right-hand sides per matrix.
batchCountint-
Number of matrices.
transposebool-
Solve with the transpose of each A.
conjugatebool-
With
transpose, solve with the conjugate transpose. streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
QrAsync(DeviceBuffer<Complex>, DeviceBuffer<Complex>, int, int, CudaStream?, CancellationToken)
Computes the QR factorisation A = Q·R in place. On return the upper triangle of A
holds R and the part below the diagonal, together with tau,
encodes the Householder reflectors of Q.
public static Task QrAsync(DeviceBuffer<Complex> a, DeviceBuffer<Complex> tau, int m, int n, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer for the m×n matrix A.
tauDeviceBuffer<Complex>-
Device buffer of
min(m, n)scalars (output). mint-
Number of rows.
nint-
Number of columns.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
QrAsync<T>(DeviceBuffer<T>, DeviceBuffer<T>, int, int, CudaStream?, CancellationToken)
Computes the QR factorisation A = Q·R in place. On return the upper triangle of A
holds R and the part below the diagonal, together with tau,
encodes the Householder reflectors of Q.
public static Task QrAsync<T>(DeviceBuffer<T> a, DeviceBuffer<T> tau, int m, int n, CudaStream? stream = null, CancellationToken ct = default) where T : unmanaged, INumberBase<T>Parameters
aDeviceBuffer<T>-
Device buffer for the m×n matrix A.
tauDeviceBuffer<T>-
Device buffer of
min(m, n)scalars (output). mint-
Number of rows.
nint-
Number of columns.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
Type Parameters
T
QrFormQAsync(DeviceBuffer<Complex>, DeviceBuffer<Complex>, int, int, CudaStream?, CancellationToken)
Forms the explicit orthonormal factor Q (first n columns, m×n) from a
factorisation produced by NVMathNet.Solver.DenseSolver.QrAsync``1(NVMathNet.DeviceBuffer{``0},NVMathNet.DeviceBuffer{``0},System.Int32,System.Int32,NVMathNet.CudaStream,System.Threading.CancellationToken). a is overwritten with Q.
Requires m ≥ n.
public static Task QrFormQAsync(DeviceBuffer<Complex> a, DeviceBuffer<Complex> tau, int m, int n, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer holding the output of NVMathNet.Solver.DenseSolver.QrAsync``1(NVMathNet.DeviceBuffer{``0},NVMathNet.DeviceBuffer{``0},System.Int32,System.Int32,NVMathNet.CudaStream,System.Threading.CancellationToken); overwritten with Q.
tauDeviceBuffer<Complex>-
Scalars from NVMathNet.Solver.DenseSolver.QrAsync``1(NVMathNet.DeviceBuffer{``0},NVMathNet.DeviceBuffer{``0},System.Int32,System.Int32,NVMathNet.CudaStream,System.Threading.CancellationToken).
mint-
Number of rows.
nint-
Number of columns of Q (≤ m).
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
QrFormQAsync<T>(DeviceBuffer<T>, DeviceBuffer<T>, int, int, CudaStream?, CancellationToken)
Forms the explicit orthonormal factor Q (first n columns, m×n) from a
factorisation produced by NVMathNet.Solver.DenseSolver.QrAsync``1(NVMathNet.DeviceBuffer{``0},NVMathNet.DeviceBuffer{``0},System.Int32,System.Int32,NVMathNet.CudaStream,System.Threading.CancellationToken). a is overwritten with Q.
Requires m ≥ n.
public static Task QrFormQAsync<T>(DeviceBuffer<T> a, DeviceBuffer<T> tau, int m, int n, CudaStream? stream = null, CancellationToken ct = default) where T : unmanaged, INumberBase<T>Parameters
aDeviceBuffer<T>-
Device buffer holding the output of NVMathNet.Solver.DenseSolver.QrAsync``1(NVMathNet.DeviceBuffer{``0},NVMathNet.DeviceBuffer{``0},System.Int32,System.Int32,NVMathNet.CudaStream,System.Threading.CancellationToken); overwritten with Q.
tauDeviceBuffer<T>-
Scalars from NVMathNet.Solver.DenseSolver.QrAsync``1(NVMathNet.DeviceBuffer{``0},NVMathNet.DeviceBuffer{``0},System.Int32,System.Int32,NVMathNet.CudaStream,System.Threading.CancellationToken).
mint-
Number of rows.
nint-
Number of columns of Q (≤ m).
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
Type Parameters
T
SolveAsync(DeviceBuffer<float>, DeviceBuffer<float>, int, int, CudaStream?, CancellationToken)
Solves A*X = B using LU factorisation (single-precision). A is overwritten with L\U factors; B is overwritten with the solution X.
public static Task SolveAsync(DeviceBuffer<float> a, DeviceBuffer<float> b, int n, int nrhs = 1, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<float>-
Device buffer for n×n matrix A (overwritten with LU factors).
bDeviceBuffer<float>-
Device buffer for n×nrhs matrix B (overwritten with solution X).
nint-
Order of the square matrix A.
nrhsint-
Number of right-hand sides (columns of B).
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
SolveAsync(DeviceBuffer<double>, DeviceBuffer<double>, int, int, CudaStream?, CancellationToken)
Solves A*X = B using LU factorisation (double-precision).
public static Task SolveAsync(DeviceBuffer<double> a, DeviceBuffer<double> b, int n, int nrhs = 1, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<double>bDeviceBuffer<double>nintnrhsintstreamCudaStream?ctCancellationToken
Returns
SvdAsync(DeviceBuffer<Complex>, DeviceBuffer<double>, DeviceBuffer<Complex>, DeviceBuffer<Complex>, int, int, CudaStream?, CancellationToken)
Singular value decomposition of a complex matrix, A = U · diag(S) · VH, where
VH = Vᴴ is the conjugate transpose of the right singular vectors. Requires m ≥ n.
public static Task SvdAsync(DeviceBuffer<Complex> a, DeviceBuffer<double> s, DeviceBuffer<Complex> u, DeviceBuffer<Complex> vh, int m, int n, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer for the m×n matrix A; destroyed on return.
sDeviceBuffer<double>-
Device buffer of
min(m, n)real singular values in descending order (output). uDeviceBuffer<Complex>-
Device buffer for the m×m left singular vectors (output).
vhDeviceBuffer<Complex>-
Device buffer for the n×n matrix
Vᴴ(output). mint-
Rows of A.
nint-
Columns of A (≤ m).
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
SvdAsync(DeviceBuffer<float>, DeviceBuffer<float>, DeviceBuffer<float>, DeviceBuffer<float>, int, int, CudaStream?, CancellationToken)
Computes the singular value decomposition A = U*diag(S)*VT (single-precision). Requires m >= n (cuSOLVER gesvd); for a wide matrix decompose its transpose.
public static Task SvdAsync(DeviceBuffer<float> a, DeviceBuffer<float> s, DeviceBuffer<float> u, DeviceBuffer<float> vt, int m, int n, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<float>-
Device buffer for m×n matrix A (overwritten).
sDeviceBuffer<float>-
Device buffer for min(m,n) singular values.
uDeviceBuffer<float>-
Device buffer for m×m unitary matrix U.
vtDeviceBuffer<float>-
Device buffer for n×n unitary matrix VT.
mint-
Rows of A.
nint-
Columns of A.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
SvdAsync(DeviceBuffer<double>, DeviceBuffer<double>, DeviceBuffer<double>, DeviceBuffer<double>, int, int, CudaStream?, CancellationToken)
Computes the singular value decomposition A = U*diag(S)*VT (double-precision). Requires m >= n (cuSOLVER gesvd); for a wide matrix decompose its transpose.
public static Task SvdAsync(DeviceBuffer<double> a, DeviceBuffer<double> s, DeviceBuffer<double> u, DeviceBuffer<double> vt, int m, int n, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<double>sDeviceBuffer<double>uDeviceBuffer<double>vtDeviceBuffer<double>mintnintstreamCudaStream?ctCancellationToken
Returns
SvdBatchedAsync(DeviceBuffer<Complex>, DeviceBuffer<double>, DeviceBuffer<Complex>?, DeviceBuffer<Complex>?, int, int, int, bool, CudaStream?, CancellationToken)
Singular value decomposition A_i = U_i · diag(S_i) · V_iᴴ of a batch of small complex matrices
(m and n at most 32) using the Jacobi method; matrices are packed back-to-back and column-major.
public static Task<int[]> SvdBatchedAsync(DeviceBuffer<Complex> a, DeviceBuffer<double> s, DeviceBuffer<Complex>? u, DeviceBuffer<Complex>? v, int m, int n, int batchCount, bool computeVectors = true, CudaStream? stream = null, CancellationToken ct = default)Parameters
aDeviceBuffer<Complex>-
Device buffer of
batchCount·m·nelements; destroyed on return. sDeviceBuffer<double>-
Device buffer of
batchCount·min(m,n)real singular values, descending (output). uDeviceBuffer<Complex>?-
Device buffer of
batchCount·m·mleft vectors; may benullwhencomputeVectorsisfalse(a scratch buffer is used). vDeviceBuffer<Complex>?-
Device buffer of
batchCount·n·nright vectors — V, not Vᴴ; may benullwhencomputeVectorsisfalse. mint-
Rows of each matrix.
nint-
Columns of each matrix.
batchCountint-
Number of matrices.
computeVectorsbool-
Whether to compute U and V.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
SvdBatchedAsync<T>(DeviceBuffer<T>, DeviceBuffer<T>, DeviceBuffer<T>?, DeviceBuffer<T>?, int, int, int, bool, CudaStream?, CancellationToken)
Singular value decomposition A_i = U_i · diag(S_i) · V_i^T of a batch of small
matrices (m and n at most 32) using the Jacobi method. Matrices are packed
back-to-back and column-major.
public static Task<int[]> SvdBatchedAsync<T>(DeviceBuffer<T> a, DeviceBuffer<T> s, DeviceBuffer<T>? u, DeviceBuffer<T>? v, int m, int n, int batchCount, bool computeVectors = true, CudaStream? stream = null, CancellationToken ct = default) where T : unmanaged, INumberBase<T>Parameters
aDeviceBuffer<T>-
Device buffer of
batchCount·m·nelements; destroyed on return. sDeviceBuffer<T>-
Device buffer of
batchCount·min(m,n)singular values, sorted descending (output). uDeviceBuffer<T>?-
Device buffer of
batchCount·m·mleft vectors (output); may benullwhencomputeVectorsisfalse(a scratch buffer is used). vDeviceBuffer<T>?-
Device buffer of
batchCount·n·nright vectors — V, not V^T (output); may benullwhencomputeVectorsisfalse(a scratch buffer is used). mint-
Rows of each matrix.
nint-
Columns of each matrix.
batchCountint-
Number of matrices.
computeVectorsbool-
Whether to compute U and V.
streamCudaStream?-
Optional CUDA stream.
ctCancellationToken-
Cancellation token.
Returns
Type Parameters
T