Fast Auxiliary Space Preconditioning  1.8.4 Feb/15/2016
sparse_csrl.c
Go to the documentation of this file.
1 
10 #include "fasp.h"
11 #include "fasp_functs.h"
12 
13 /*---------------------------------*/
14 /*-- Public Functions --*/
15 /*---------------------------------*/
16 
30 dCSRLmat * fasp_dcsrl_create (const INT num_rows,
31  const INT num_cols,
32  const INT num_nonzeros)
33 {
34  dCSRLmat *A = (dCSRLmat *)fasp_mem_calloc(1, sizeof(dCSRLmat));
35 
36  A -> row = num_rows;
37  A -> col = num_cols;
38  A -> nnz = num_nonzeros;
39  A -> nz_diff = NULL;
40  A -> index = NULL;
41  A -> start = NULL;
42  A -> ja = NULL;
43  A -> val = NULL;
44 
45  return A;
46 }
47 
59 {
60  if (A) {
61  if (A -> nz_diff) free(A -> nz_diff);
62  if (A -> index) free(A -> index);
63  if (A -> start) free(A -> start);
64  if (A -> ja) free(A -> ja);
65  if (A -> val) free(A -> val);
66  free(A);
67  }
68 }
69 
70 /*---------------------------------*/
71 /*-- End of File --*/
72 /*---------------------------------*/
void fasp_dcsrl_free(dCSRLmat *A)
Destroy a dCSRLmat object.
Definition: sparse_csrl.c:58
void * fasp_mem_calloc(LONGLONG size, INT type)
1M = 1024*1024
Definition: memory.c:60
#define INT
Definition: fasp.h:64
Main header file for FASP.
dCSRLmat * fasp_dcsrl_create(const INT num_rows, const INT num_cols, const INT num_nonzeros)
Create a dCSRLmat object.
Definition: sparse_csrl.c:30
Sparse matrix of REAL type in CSRL format.
Definition: fasp.h:265