ca_mat_det_berkowitz, ca_mat_det_lu, ca_mat_det_bareiss, ca_mat_det_cofactor, ca_mat_det
Synopsis
#include <flint/ca_mat.h>Sets det to the determinant of the square matrix A.
- The berkowitz version uses the division-free Berkowitz algorithm with O(n^4) operations. It needs no zero tests and always succeeds.
- The cofactor version uses cofactor expansion; it is meant for matrices of size up to 4.
- The lu and bareiss versions use LU decomposition and fraction-free LU decomposition with O(n^3) operations. They need zero tests for pivoting and return 0 if one fails (1 on success).
- The default version computes the determinant of a rational matrix of size at least 3 over \mathbb{Z} or \mathbb{Q} (fmpz_mat.h, fmpq_mat.h), uses cofactor expansion for n \le 4, LU decomposition if all entries lie in one number field, and the Berkowitz algorithm otherwise.
Different algorithms can give different symbolic representations of the same determinant, and which one is fastest depends strongly on the structure of the matrix. All but the Bareiss version are wrappers of the corresponding gr_mat_det functions.
Cite this page
The FLINT team, “ca_mat_det_berkowitz, ca_mat_det_lu, ca_mat_det_bareiss, ca_mat_det_cofactor, ca_mat_det (ca_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ca_mat/ca_mat_det_berkowitz.html (generated 2026-10-20).
@misc{flint-doc-ca-mat-ca-mat-det-berkowitz,
author = {{The FLINT team}},
title = {{ca\_mat\_det\_berkowitz, ca\_mat\_det\_lu, ca\_mat\_det\_bareiss, ca\_mat\_det\_cofactor, ca\_mat\_det (ca\_mat.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/ca_mat/ca_mat_det_berkowitz.html},
note = {Generated 2026-10-20}
}