You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
855 B
29 lines
855 B
6 years ago
|
#ifndef LIL_SPARSE_MATRIX_H /* Include guard */
|
||
|
#define LIL_SPARSE_MATRIX_H
|
||
|
|
||
|
#include <stdbool.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
typedef struct lilSparseMatrixElement {
|
||
|
double value;
|
||
|
int rowIndex, columnIndex;
|
||
|
struct lilSparseMatrixElement *nextElement;
|
||
|
} LilSparseMatrixElement;
|
||
|
|
||
|
typedef struct lilSparseMatrix {
|
||
|
int elements;
|
||
|
LilSparseMatrixElement *firstElement;
|
||
|
LilSparseMatrixElement *lastElement;
|
||
|
} LilSparseMatrix;
|
||
|
|
||
|
LilSparseMatrix createLilSparseMatrix();
|
||
|
void apendElement(LilSparseMatrix *sparseMatrix, double value, int row,
|
||
|
int column);
|
||
|
void lilSparseMatrixVectorMultiplication(LilSparseMatrix sparseMatrix,
|
||
|
double *vector, double **product, int vectorSize);
|
||
|
void destroyLilSparseMatrix(LilSparseMatrix *sparseMatrix);
|
||
|
void printLilSparseMatrix(LilSparseMatrix sparseMatrix);
|
||
|
|
||
|
#endif // LIL_SPARSE_MATRIX_H
|