source: trunk/anuga_core/source/anuga/utilities/sparse_csr.c @ 8813

Last change on this file since 8813 was 8758, checked in by steve, 12 years ago

Just adding end of file line

File size: 699 bytes
Line 
1#include "sparse_csr.h"
2
3// **************** UTILITIES ***********************
4
5static void *emalloc(size_t amt,char * location)
6{
7    void *v = malloc(amt); 
8    if(!v){
9        fprintf(stderr, "out of mem in quad_tree: %s\n",location);
10        exit(EXIT_FAILURE);
11    }
12    return v;
13};
14
15// ***************************************************
16
17// 'Constructor'
18sparse_csr * make_csr(){
19
20    sparse_csr * ret = emalloc(sizeof(sparse_csr),"make_csr");
21    ret->data=NULL;
22        ret->colind=NULL;
23        ret->row_ptr=NULL;
24        ret->num_rows=0;
25        ret->num_entries=0;
26    return ret;
27}
28
29void delete_csr_matrix(sparse_csr * mat){
30
31        free(mat->data);
32        free(mat->colind);
33        free(mat->row_ptr);
34        free(mat);
35        mat=NULL;
36
37}
38
Note: See TracBrowser for help on using the repository browser.