68 for ( i = 0; i < csr->n; i++ ) {
69 if ( csr->nnz[i] != 0 ) {
70 memFree_null( csr->rows[i] );
73 memFree_null( csr->rows );
74 memFree_null( csr->nnz );
103 for ( i = 0; i < csr->n; i++ ) {
135 for ( i = 0, j = 0; i < n; i++, j++ ) {
136 if ( csr->nnz[i] == 0 )
141 for ( ; i < n; i++ ) {
142 if ( csr->nnz[i] > 0 ) {
144 csr->nnz[j] = csr->nnz[i];
145 csr->rows[j] = csr->rows[i];
190 baseval = graphA->colptr[0];
195 for ( i = 0; i < n; i++ ) {
198 graphPA->nnz[ip] = graphA->colptr[i + 1] - graphA->colptr[i] + 1;
202 for ( i = 0; i < n; i++ ) {
203 ip = perm[i] - baseval;
205 MALLOC_INTERN( graphPA->rows[ip], graphPA->nnz[ip],
pastix_int_t );
207 rowsPA = graphPA->rows[ip];
208 rowsA = graphA->rowptr + graphA->colptr[i] - baseval;
214 for ( j = 1; j < graphPA->nnz[ip]; j++, rowsPA++ ) {
215 *rowsPA = perm[*rowsA];
219 intSort1asc1( graphPA->rows[ip], graphPA->nnz[ip] );
272 for ( k = 0; k < cblknbr; k++ ) {
275 for ( i = rangtab[k]; i < rangtab[k + 1]; i++ ) {
280 for ( i = rangtab[k]; i < rangtab[k + 1]; i++ ) {
284 while ( ( j < graphA->nnz[i] ) && ( graphA->rows[i][j] <= i ) ) {
290 pastix_intset_union( nnznbr, tmp1, graphA->nnz[i] - j, graphA->rows[i] + j, tmp2 );
298#if !defined( NDEBUG ) && defined( PASTIX_DEBUG_SYMBOL )
303 assert( nnznbr >= ( rangtab[k + 1] - rangtab[k] ) );
304 for ( j = rangtab[k]; j < rangtab[k + 1]; j++ ) {
305 assert( tmp1[ind] == j );
308 assert( nnznbr > 0 );
313 graphL->nnz[k] = nnznbr;
315 memcpy( graphL->rows[k], tmp1,
sizeof(
pastix_int_t ) * nnznbr );
BEGIN_C_DECLS typedef int pastix_int_t
int faxCSRGenPA(const pastix_graph_t *graphA, const pastix_int_t *perm, fax_csr_t *graphPA)
Generate the graph of P*A from the graph of A and the permutation vector.
pastix_int_t faxCSRGetNNZ(const fax_csr_t *csr)
Computes the number of non zero entries in the graph.
void faxCSRClean(fax_csr_t *csr)
Free the data store in the structure.
void faxCSRCblkCompress(const fax_csr_t *graphA, const pastix_order_t *order, fax_csr_t *graphL, pastix_int_t *work)
Compact a element wise graph of a matrix A, according to the associated partition.
void faxCSRCompact(fax_csr_t *csr)
Compact a compressed graph.
void faxCSRInit(pastix_int_t n, fax_csr_t *csr)
Initialize the data structure by doing the first allocations within the structure and initializing th...
Fax blocked csr structure.