Library/ManagedCuda/CudaSolve/CudaSolveSparse.cs
/// <summary>
/// Given a left permutation vector p which corresponds to permutation matrix P and a
/// right permutation vector q which corresponds to permutation matrix Q, this function
/// computes permutation of matrix A by B = P*A*Q^T
/// </summary>
/// <param name="m">number of rows of matrix A.</param>
/// <param name="n">number of columns of matrix A.</param>
/// <param name="nnzA">number of nonzeros of matrix A. It is the size of csrValA and csrColIndA.</param>
/// <param name="descrA">the descriptor of matrix A. The supported matrix type is
/// CUSPARSE_MATRIX_TYPE_GENERAL. Also, the supported index bases are CUSPARSE_INDEX_BASE_ZERO and CUSPARSE_INDEX_BASE_ONE.</param>
/// <param name="csrRowPtrA">integer array of n + 1 elements that contains the start of every row and the end of the last row plus one.</param>
/// <param name="csrColIndA">integer array of nnz (=csrRowPtrA(n) * csrRowPtrA(0)) column indices of the nonzero elements of matrix A.</param>
/// <param name="p">left permutation vector of size m.</param>
/// <param name="q">right permutation vector of size n.</param>
/// <param name="map">integer array of nnzA indices. If the user wants to
/// get relationship between A and B, map must be set 0:1:(nnzA-1).</param>
/// <param name="pBuffer">buffer allocated by the user, the size is returned by csrperm_bufferSize().</param>
Given a left permutation vector p which corresponds to permutation matrix P and a
right permutation vector q which corresponds to permutation matrix Q, this function
computes permutation of matrix A by B = P*A*Q^T
Given a left permutation vector p which corresponds to permutation matrix P and a right permutation vector q which corresponds to permutation matrix Q this function computes permutation of matrix A by B = P * A * Q^T
public void CsrpermHost(int m, int n, int nnzA, CudaSparseMatrixDescriptor descrA, int[] csrRowPtrA, int[] csrColIndA, int[] p, int[] q, int[] map, byte[] pBuffer)
		{
			res = CudaSolveNativeMethods.Sparse.cusolverSpXcsrpermHost(_handle, m, n, nnzA, descrA.Descriptor, csrRowPtrA, csrColIndA, p, q, map, pBuffer);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cusolverSpXcsrpermHost", res));
			if (res != cusolverStatus.Success) throw new CudaSolveException(res);
		}
public void CsrpermHost ( int m , int n , int nnzA , CudaSparseMatrixDescriptor descrA , int [ ] csrRowPtrA , int [ ] csrColIndA , int [ ] p , int [ ] q , int [ ] map , byte [ ] pBuffer ) { res = CudaSolveNativeMethods . Sparse . cusolverSpXcsrpermHost ( _handle , m , n , nnzA , descrA . Descriptor , csrRowPtrA , csrColIndA , p , q , map , pBuffer ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cusolverStatus . Success ) throw new CudaSolveException ( res ) ; }
Given a left permutation vector p which corresponds to permutation matrix P and a
right permutation vector q which corresponds to permutation matrix Q, this function
computes permutation of matrix A by B = P*A*Q^T
Given a left permutation vector p which corresponds to permutation matrix P and a right permutation vector q which corresponds to permutation matrix Q this function computes permutation of matrix A by B = P * A * Q^T
m
int
number of rows of matrix A.
number of rows of matrix A .
n
int
number of columns of matrix A.
number of columns of matrix A .
nnzA
int
number of nonzeros of matrix A. It is the size of csrValA and csrColIndA.
number of nonzeros of matrix A . It is the size of csrValA and csrColIndA .
descrA
CudaSparseMatrixDescriptor
the descriptor of matrix A. The supported matrix type is
CUSPARSE_MATRIX_TYPE_GENERAL. Also, the supported index bases are CUSPARSE_INDEX_BASE_ZERO and CUSPARSE_INDEX_BASE_ONE.
the descriptor of matrix A . The supported matrix type is CUSPARSE_MATRIX_TYPE_GENERAL . Also the supported index bases are CUSPARSE_INDEX_BASE_ZERO and CUSPARSE_INDEX_BASE_ONE .
csrRowPtrA
int[]
integer array of n + 1 elements that contains the start of every row and the end of the last row plus one.
integer array of n + 1 elements that contains the start of every row and the end of the last row plus one .
csrColIndA
int[]
integer array of nnz (=csrRowPtrA(n) * csrRowPtrA(0)) column indices of the nonzero elements of matrix A.
integer array of nnz ( = csrRowPtrA ( n ) * csrRowPtrA ( 0 )) column indices of the nonzero elements of matrix A .
p
int[]
left permutation vector of size m.
left permutation vector of size m .
q
int[]
right permutation vector of size n.
right permutation vector of size n .
map
int[]
integer array of nnzA indices. If the user wants to
get relationship between A and B, map must be set 0:1:(nnzA-1).
integer array of nnzA indices . If the user wants to get relationship between A and B map must be set 0 : 1 : ( nnzA - 1 ) .
pBuffer
byte[]
buffer allocated by the user, the size is returned by csrperm_bufferSize().
buffer allocated by the user the size is returned by csrperm_bufferSize () .