Lines Matching refs:elem_t
27 typedef double elem_t;
44 static elem_t* new_matrix(const int rows, const int cols)
48 return malloc(rows * cols * sizeof(elem_t));
52 static void delete_matrix(elem_t* const a)
58 static void init_matrix(elem_t* const a, const int rows, const int cols)
72 const elem_t* const a, const int rows, const int cols)
87 static void copy_matrix(const elem_t* const from,
94 elem_t* const to,
123 static elem_t* multiply_matrices(const elem_t* const a1,
126 const elem_t* const a2,
131 elem_t* prod;
158 static void gj(elem_t* const a, const int rows, const int cols)
178 const elem_t t = a[i * cols + k];
202 const elem_t factor = a[j * cols + i];
217 const elem_t factor = a[j * cols + i];
229 static elem_t* invert_matrix(const elem_t* const a, const int n)
232 elem_t* const inv = new_matrix(n, n);
233 elem_t* const tmp = new_matrix(n, 2*n);
247 static double identity_error(const elem_t* const a, const int n)
250 elem_t e = 0;
255 const elem_t d = a[i * n + j] - (i == j);
262 /** Compute epsilon for the numeric type elem_t. Epsilon is defined as the
264 * one. It is assumed that the underlying representation of elem_t uses
267 static elem_t epsilon()
269 elem_t eps;
292 elem_t *a, *inv, *prod;
293 elem_t eps;