-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutil.h
58 lines (40 loc) · 1.06 KB
/
util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef __UTIL_H
#define __UTIL_H
#define BUFFSIZE 25
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
//Structure for temporary storing data from file
typedef struct LinkListTag {
int row;
int col;
int val;
struct LinkListTag *next;
} LinkList;
//Structure that represents a single matrix stored in 'Compressed sparse row'
typedef struct MatrixTag {
//Size of matrix
int rows;
int columns;
//Number of non-zero entries
int quantity;
//Content of matrix
int *val;
int *col_ind;
int *row_ptr;
} Matrix;
int numberOfLines( FILE *file );
void freeMatrixMemory( Matrix *mx );
void checkMem( void *check );
void fillWithNo(int *tmpint, char *tmpstr);
Matrix* makeDataStructure(int n, int *tempint);
//void organiseData( Matrix *matrix, LinkList *tempList);
void writeMatrixInFile( Matrix *matrix, char *fileName );
void print( Matrix *matrix, int r, int c);
void FreeLinkList( LinkList *root );
LinkList *readFile(FILE *file, int *n, int *tempint);
#endif