Library/ManagedCuda/CudaSolve/CudaSolveSparse.cs
/// <summary>
/// This function solves the simple eigenvalue problem A*x=lambda*x by shift-inverse method.
/// </summary>
/// <param name="m">number of rows and columns of matrix A.</param>
/// <param name="nnz">number of nonzeros of matrix A.</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="csrValA">array of nnz (= csrRowPtrA(n) * csrRowPtrA(0)) nonzero elements of matrix A.</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="mu0">initial guess of eigenvalue.</param>
/// <param name="x0">initial guess of eigenvector, a vecotr of size m.</param>
/// <param name="maxite">maximum iterations in shift-inverse method.</param>
/// <param name="tol">tolerance for convergence.</param>
/// <param name="mu">approximated eigenvalue nearest mu0 under tolerance.</param>
/// <param name="x">approximated eigenvector of size m.</param>
This function solves the simple eigenvalue problem A*x=lambda*x by shift-inverse method.
This function solves the simple eigenvalue problem A * x = lambda * x by shift - inverse method .
public void CsreigvsiHost(int m, int nnz, CudaSparseMatrixDescriptor descrA, float[] csrValA, int[] csrRowPtrA, int[] csrColIndA, float mu0, float[] x0, int maxite, float tol, ref float mu, float[] x)
		{
			res = CudaSolveNativeMethods.Sparse.cusolverSpScsreigvsiHost(_handle, m, nnz, descrA.Descriptor, csrValA, csrRowPtrA, csrColIndA, mu0, x0, maxite, tol, ref mu, x);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cusolverSpScsreigvsiHost", res));
			if (res != cusolverStatus.Success) throw new CudaSolveException(res);
		}
public void CsreigvsiHost ( int m , int nnz , CudaSparseMatrixDescriptor descrA , float [ ] csrValA , int [ ] csrRowPtrA , int [ ] csrColIndA , float mu0 , float [ ] x0 , int maxite , float tol , ref float mu , float [ ] x ) { res = CudaSolveNativeMethods . Sparse . cusolverSpScsreigvsiHost ( _handle , m , nnz , descrA . Descriptor , csrValA , csrRowPtrA , csrColIndA , mu0 , x0 , maxite , tol , ref mu , x ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cusolverStatus . Success ) throw new CudaSolveException ( res ) ; }
This function solves the simple eigenvalue problem A*x=lambda*x by shift-inverse method.
This function solves the simple eigenvalue problem A * x = lambda * x by shift - inverse method .
m
int
number of rows and columns of matrix A.
number of rows and columns of matrix A .
nnz
int
number of nonzeros of matrix A.
number of nonzeros of matrix A .
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 .
csrValA
float[]
array of nnz (= csrRowPtrA(n) * csrRowPtrA(0)) nonzero elements of matrix A.
array of nnz ( = csrRowPtrA ( n ) * csrRowPtrA ( 0 )) nonzero elements of matrix A .
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 .
mu0
float
initial guess of eigenvalue.
initial guess of eigenvalue .
x0
float[]
initial guess of eigenvector, a vecotr of size m.
initial guess of eigenvector a vecotr of size m .
maxite
int
maximum iterations in shift-inverse method.
maximum iterations in shift - inverse method .
tol
float
tolerance for convergence.
tolerance for convergence .
float
ref
<not_specific>
x
float[]
approximated eigenvector of size m.
approximated eigenvector of size m .
mu
<not_specific>
approximated eigenvalue nearest mu0 under tolerance.
approximated eigenvalue nearest mu0 under tolerance .