Package jline.lib.perm
Class Permanent
-
- All Implemented Interfaces:
public final class Permanent extends PermSolver
Implementation of the MATLAB perm.m permanent computation algorithm.
This implementation mirrors the MATLAB perm.m function which computes the permanent of a matrix by applying computational savings when some rows or columns are repeated. It uses the inclusion-exclusion principle with multiplicities to efficiently handle matrices with duplicate rows or columns.
The algorithm:
Detects and counts repeated columns/rows
Uses inclusion-exclusion with multinomial coefficients
Applies pprod iterator for generating all combinations