[math] sparse matrix I/O methods
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
#define SPARSE_MATRIX_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "collections.h"
|
||||
#include "file_utils.h"
|
||||
#include "matrix.h"
|
||||
#include "vector.h"
|
||||
|
||||
@@ -39,6 +41,9 @@ int sparse_matrix_rows_dot_vector(sparse_matrix_t *self, uint32_t *rows, size_t
|
||||
|
||||
int sparse_matrix_dot_dense(sparse_matrix_t *self, matrix_t *matrix, matrix_t *result);
|
||||
|
||||
bool sparse_matrix_write(sparse_matrix_t *self, FILE *f);
|
||||
sparse_matrix_t *sparse_matrix_read(FILE *f);
|
||||
|
||||
#define sparse_matrix_foreach_row(sp, row_var, index_var, length_var, code) { \
|
||||
uint32_t _row_start = 0, _row_end = 0; \
|
||||
uint32_t *_indptr = sp->indptr->a; \
|
||||
|
||||
Reference in New Issue
Block a user