Fast Auxiliary Space Preconditioning 2.7.7 Aug/28/2022
Loading...
Searching...
No Matches
BlaSparseCSRL.c
Go to the documentation of this file.
1
19#include "fasp.h"
20#include "fasp_functs.h"
21
22/*---------------------------------*/
23/*-- Public Functions --*/
24/*---------------------------------*/
25
39dCSRLmat * fasp_dcsrl_create (const INT num_rows,
40 const INT num_cols,
41 const INT num_nonzeros)
42{
43 dCSRLmat *A = (dCSRLmat *)fasp_mem_calloc(1, sizeof(dCSRLmat));
44
45 A -> row = num_rows;
46 A -> col = num_cols;
47 A -> nnz = num_nonzeros;
48 A -> nz_diff = NULL;
49 A -> index = NULL;
50 A -> start = NULL;
51 A -> ja = NULL;
52 A -> val = NULL;
53
54 return A;
55}
56
68{
69 if (A) {
70 if (A -> nz_diff) free(A -> nz_diff);
71 if (A -> index) free(A -> index);
72 if (A -> start) free(A -> start);
73 if (A -> ja) free(A -> ja);
74 if (A -> val) free(A -> val);
75 free(A);
76 }
77}
78
79/*---------------------------------*/
80/*-- End of File --*/
81/*---------------------------------*/
void * fasp_mem_calloc(const unsigned int size, const unsigned int type)
Allocate, initiate, and check memory.
Definition: AuxMemory.c:65
void fasp_dcsrl_free(dCSRLmat *A)
Destroy a dCSRLmat object.
Definition: BlaSparseCSRL.c:67
dCSRLmat * fasp_dcsrl_create(const INT num_rows, const INT num_cols, const INT num_nonzeros)
Create a dCSRLmat object.
Definition: BlaSparseCSRL.c:39
Main header file for the FASP project.
#define INT
Definition: fasp.h:72
Sparse matrix of REAL type in CSRL format.
Definition: fasp.h:277