Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 1f52255

Browse files
committed
introduce minimal interface for using ZZ[x] matrices in Flint
1 parent e2dcdee commit 1f52255

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

src/sage/libs/flint/flint_wrap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <flint/fmpq_poly.h>
3838
#include <flint/fmpz.h>
3939
#include <flint/fmpz_mat.h>
40+
#include <flint/fmpz_poly_mat.h>
4041
#include <flint/fmpz_mod_poly.h>
4142
#include <flint/fmpz_poly.h>
4243
#include <flint/fmpz_poly_q.h>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# distutils: libraries = flint
2+
# distutils: depends = flint/fmpz_poly_mat.h
3+
4+
from sage.libs.flint.types cimport fmpz_poly_mat_t, fmpz_poly_t, fmpz_t, slong, fmpz_mat_t
5+
6+
# flint/fmpz_poly_mat.h
7+
cdef extern from "flint_wrap.h":
8+
9+
void fmpz_poly_mat_init(fmpz_poly_mat_t mat, slong rows, slong cols)
10+
void fmpz_poly_mat_init_set(fmpz_poly_mat_t mat, const fmpz_poly_mat_t src)
11+
void fmpz_poly_mat_clear(fmpz_poly_mat_t mat)
12+
fmpz_poly_t fmpz_poly_mat_entry(fmpz_poly_mat_t mat, long i, long j)
13+
slong fmpz_poly_mat_nrows(const fmpz_poly_mat_t mat)
14+
slong fmpz_poly_mat_ncols(const fmpz_poly_mat_t mat)
15+
16+
void fmpz_poly_mat_set(fmpz_poly_mat_t mat1, const fmpz_poly_mat_t mat2)
17+
18+
void fmpz_poly_mat_swap(fmpz_poly_mat_t mat1, fmpz_poly_mat_t mat2)
19+
20+
void fmpz_poly_mat_transpose(fmpz_poly_mat_t B, const fmpz_poly_mat_t A)
21+
22+
void fmpz_poly_mat_evaluate_fmpz(fmpz_mat_t B, const fmpz_poly_mat_t A,
23+
const fmpz_t x)
24+
25+
void fmpz_poly_mat_trace(fmpz_poly_t trace, const fmpz_poly_mat_t mat)
26+
27+
void fmpz_poly_mat_det(fmpz_poly_t det, const fmpz_poly_mat_t A)

src/sage/libs/flint/types.pxd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ cdef extern from "flint_wrap.h":
7979

8080
ctypedef fmpq_mat_struct fmpq_mat_t[1]
8181

82+
# flint/fmpz_poly_mat.h:
83+
cdef extern from "flint_wrap.h":
84+
ctypedef struct fmpz_poly_mat_struct:
85+
pass
86+
87+
ctypedef fmpz_poly_mat_struct fmpz_poly_mat_t[1]
88+
8289
# flint/fmpz_mod_poly.h:
8390
cdef extern from "flint_wrap.h":
8491
ctypedef struct fmpz_mod_poly_struct:

0 commit comments

Comments
 (0)