return the_row->diag != 0.0 ? 1.0 / the_row->diag : 0.0;
// Search for correct column
- for (c = 0; c < the_row->n_cols && the_row->cols[c].col_idx < col; ++c);
+ for (c = 0; c < the_row->n_cols && the_row->cols[c].col_idx < col; ++c) {
+ }
if (c >= the_row->n_cols || the_row->cols[c].col_idx > col)
return 0.0;
xfree(elems);
}
-
-void gs_matrix_self_test(int d)
-{
- int i, o;
- gs_matrix_t *m = gs_new_matrix(10, 10);
-
- for (i=0; i<d; ++i)
- for (o=0; o<d; ++o)
- gs_matrix_set(m, i, o, i*o);
-
- for (i=0; i<d; ++i)
- for (o=0; o<d; ++o)
- assert(gs_matrix_get(m, i, o) == i*o);
- gs_delete_matrix(m);
-}