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 Csreigvsi(int m, int nnz, CudaSparseMatrixDescriptor descrA, CudaDeviceVariable<cuFloatComplex> csrValA, CudaDeviceVariable<int> csrRowPtrA, CudaDeviceVariable<int> csrColIndA, cuFloatComplex mu0, CudaDeviceVariable<cuFloatComplex> x0, int maxite, float tol, ref cuFloatComplex mu, CudaDeviceVariable<cuFloatComplex> x)
		{
			res = CudaSolveNativeMethods.Sparse.cusolverSpCcsreigvsi(_handle, m, nnz, descrA.Descriptor, csrValA.DevicePointer, csrRowPtrA.DevicePointer, csrColIndA.DevicePointer, mu0, x0.DevicePointer, maxite, tol, ref mu, x.DevicePointer);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cusolverSpCcsreigvsi", res));
			if (res != cusolverStatus.Success) throw new CudaSolveException(res);
		}
public void Csreigvsi ( int m , int nnz , CudaSparseMatrixDescriptor descrA , CudaDeviceVariable < cuFloatComplex > csrValA , CudaDeviceVariable < int > csrRowPtrA , CudaDeviceVariable < int > csrColIndA , cuFloatComplex mu0 , CudaDeviceVariable < cuFloatComplex > x0 , int maxite , float tol , ref cuFloatComplex mu , CudaDeviceVariable < cuFloatComplex > x ) { res = CudaSolveNativeMethods . Sparse . cusolverSpCcsreigvsi ( _handle , m , nnz , descrA . Descriptor , csrValA . DevicePointer , csrRowPtrA . DevicePointer , csrColIndA . DevicePointer , mu0 , x0 . DevicePointer , maxite , tol , ref mu , x . DevicePointer ) ; 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
CudaDeviceVariable<cuFloatComplex>
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
CudaDeviceVariable<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
CudaDeviceVariable<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
cuFloatComplex
initial guess of eigenvalue.
initial guess of eigenvalue .
x0
CudaDeviceVariable<cuFloatComplex>
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 .
cuFloatComplex
ref
x
CudaDeviceVariable<cuFloatComplex>
approximated eigenvector of size m.
approximated eigenvector of size m .
mu
approximated eigenvalue nearest mu0 under tolerance.
approximated eigenvalue nearest mu0 under tolerance .