FLINT3.7.0-dev

bool_mat_trace

Synopsis#include <flint/bool_mat.h>
int bool_mat_trace(const bool_mat_t mat)source

Returns the trace of the square matrix in the Boolean semiring: 1 if some diagonal entry is 1, and 0 otherwise (also for an empty matrix). Throws an exception if the matrix is not square.

Cite this page

The FLINT team, “bool_mat_trace (bool_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/bool_mat/bool_mat_trace.html (generated 2026-10-20).