Home | History | Annotate | Download | only in tests

Lines Matching full:cols

36   int cols;
56 static elem_t* new_matrix(const int rows, const int cols)
59 assert(cols > 0);
60 return malloc(rows * cols * sizeof(elem_t));
70 static void init_matrix(elem_t* const a, const int rows, const int cols)
77 a[i * cols + j] = 1.0 / (1 + abs(i-j));
84 const elem_t* const a, const int rows, const int cols)
90 for (j = 0; j < cols; j++)
92 printf("%g ", a[i * cols + j]);
175 const int cols = p->cols;
186 if (a[k * cols + i] > a[j * cols + i])
193 for (k = 0; k < cols; k++)
195 const elem_t t = a[i * cols + k];
196 a[i * cols + k] = a[j * cols + k];
197 a[j * cols + k] = t;
201 aii = a[i * cols + i];
203 for (k = i; k < cols; k++)
204 a[i * cols + k] /= aii;
212 const elem_t factor = a[j * cols + i];
213 for (k = 0; k < cols; k++)
215 a[j * cols + k] -= a[i * cols + k] * factor;
223 static void gj(elem_t* const a, const int rows, const int cols)
231 assert(rows <= cols);
246 t[i].cols = cols;