Continued implementation of PBQP solver: Fixed errors and warnings.
[libfirm] / matrix.c
1 #include "assert.h"
2
3 #include "pbqp_t.h"
4 #include "matrix.h"
5
6 matrix *matrix_copy(pbqp *pbqp, matrix *m)
7 {
8         int i;
9         int len;
10         matrix *copy = obstack_alloc(&pbqp->obstack, sizeof(*copy));
11
12         assert(copy);
13
14         len = m->rows * m->cols;
15
16         for (i = 0; i < len; ++i) {
17                 copy->entries[i] = m->entries[i];
18         }
19
20         return copy;
21 }