Template Function libwalrus::permanent

Function Documentation

template<typename T>
T libwalrus::permanent(std::vector<T> &mat)

Returns the permanent of an matrix.

Returns the permanent of a matrix using Ryser’s algorithm with Gray code ordering.

Return

permanent of the input matrix

Parameters
  • mat: a flattened vector of size \(n^2\), representing an \(n\times n\) row-ordered symmetric matrix.