⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sp_cconvert.c

📁 SuperLU is a general purpose library for the direct solution of large, sparse, nonsymmetric systems
💻 C
字号:
/* * -- SuperLU routine (version 2.0) -- * Univ. of California Berkeley, Xerox Palo Alto Research Center, * and Lawrence Berkeley National Lab. * November 15, 1997 * */#include "slu_cdefs.h"/* * Convert a full matrix into a sparse matrix format.  */intsp_cconvert(int m, int n, complex *A, int lda, int kl, int ku,	   complex *a, int *asub, int *xa, int *nnz){    int     lasta = 0;    int     i, j, ilow, ihigh;    int     *row;    complex  *val;    for (j = 0; j < n; ++j) {	xa[j] = lasta;	val = &a[xa[j]];	row = &asub[xa[j]];	ilow = SUPERLU_MAX(0, j - ku);	ihigh = SUPERLU_MIN(n-1, j + kl);	for (i = ilow; i <= ihigh; ++i) {	    val[i-ilow] = A[i + j*lda];	    row[i-ilow] = i;	}	lasta += ihigh - ilow + 1;    }    xa[n] = *nnz = lasta;    return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -