update QEXT to new dynamic version

This commit is contained in:
Florian Stecker
2022-06-11 17:36:32 +02:00
parent 2e516e718d
commit 1a85a5ef14
6 changed files with 106 additions and 64 deletions

12
mat.c
View File

@@ -1,11 +1,11 @@
#include "mat.h"
mat_workspace *mat_workspace_init(int n)
mat_workspace *mat_workspace_init(int n, TYPE t)
{
mat_workspace *ws = (mat_workspace*)malloc(sizeof(mat_workspace));
mat_init(ws->tmp_mat, n);
INIT(ws->tmp_num);
INIT(ws->tmp_num2);
mat_init(ws->tmp_mat, n, t);
INIT(ws->tmp_num, t);
INIT(ws->tmp_num2, t);
return ws;
}
@@ -17,11 +17,11 @@ void mat_workspace_clear(mat_workspace *ws)
free(ws);
}
void mat_init(mat m, int n)
void mat_init(mat m, int n, TYPE t)
{
m->n = n;
m->x = malloc(n*n*sizeof(NUMBER));
LOOP(i,n) LOOP(j,n) INIT(m->x[i+j*n]);
LOOP(i,n) LOOP(j,n) INIT(m->x[i+j*n], t);
}
void mat_get(NUMBER out, mat m, int i, int j)