Class NaivePermanent

java.lang.Object
jline.lib.perm.PermSolver
jline.lib.perm.NaivePermanent

public class NaivePermanent extends PermSolver
Implementation of the naive exact permanent computation. This solver computes the exact permanent of a matrix by iterating over all possible permutations and summing the products of matrix elements according to each permutation. While this gives the exact result, it has O(n!) complexity and is only practical for small matrices. The permanent of an n×n matrix A is defined as: perm(A) = Σ_π ∏_{i=1}^n a_{i,π(i)} where the sum is over all permutations π of {1,2,...,n}.
  • Constructor Details

    • NaivePermanent

      public NaivePermanent(Matrix matrix)
    • NaivePermanent

      public NaivePermanent(Matrix matrix, boolean solve)
  • Method Details

    • compute

      public void compute()
      Description copied from class: PermSolver
      Compute the permanent or approximation for the given matrix. This method must be implemented by all concrete solver classes. The result should be stored in the value field.
      Specified by:
      compute in class PermSolver