/**
+ * Author: Daniel Grund
+ * Date: 07.04.2005
+ * Copyright: (c) Universitaet Karlsruhe
+ * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+
* Sparse matrix storage with linked lists for rows and cols.
- * I did not need floats, so this is all integer.
- * @author Daniel Grund
- * @date 07.04.2005
*/
#ifdef HAVE_CONFIG_H
free(m);
}
-void matrix_set(sp_matrix_t *m, int row, int col, int val) {
+void matrix_set(sp_matrix_t *m, int row, int col, matrix_type val) {
matrix_elem_t *me = NULL;
entry_t *entr;
struct list_head *leftof, *above;
m->entries++;
}
-int matrix_get(const sp_matrix_t *m, int row, int col) {
+matrix_type matrix_get(const sp_matrix_t *m, int row, int col) {
struct list_head *dummy;
matrix_elem_t *me;
matrix_foreach_in_row(m, i, e) {
for (o=last_idx+1; o<e->col; ++o)
fprintf(out, "0");
- fprintf(out, "%d", factor*e->val);
+ fprintf(out, "%f", factor*e->val);
last_idx = e->col;
}
for (o=last_idx+1; o<=m->maxcol; ++o)