Package jline.lib.perm
Class AdaPartSampler
-
- All Implemented Interfaces:
public final class AdaPartSampler extends PermSolver
Sampling method to approximate the permanent using Adaptive Partitioning (AdaPart).
The AdaPart algorithm uses importance sampling with adaptive partitioning to estimate the permanent. It iteratively refines the sampling space by partitioning based on upper bounds, leading to more efficient sampling than naive approaches.
The algorithm provides three sampling modes:
Classic: Samples until reaching maximum accepted samples
Time: Samples for a maximum time duration
Sample: Samples for a maximum total number of samples
-
-
Method Summary
Modifier and Type Method Description final List<Integer>
getSampleAccepted()
final Unit
setSampleAccepted(List<Integer> sampleAccepted)
final List<Long>
getSampleTime()
final Unit
setSampleTime(List<Long> sampleTime)
final List<Double>
getPermStep()
final Unit
setPermStep(List<Double> permStep)
Unit
compute()
Compute the permanent or approximation for the given matrix. -
-
Constructor Detail
-
AdaPartSampler
AdaPartSampler(Matrix matrix, Integer maximumAcceptedSamples, Long maximumTime, Integer maximumSamples, String mode, Boolean solve)
- Parameters:
matrix
- The matrix for which to compute the permanent approximationmaximumAcceptedSamples
- Maximum number of accepted samples for classic mode (default: 100)maximumTime
- Maximum time in seconds for time mode (default: 30)maximumSamples
- Maximum total samples for sample mode (default: 450)mode
- Sampling mode: "classic", "time", or "sample" (default: "classic")solve
- Whether to automatically run solve() after construction (default: false)
-
-
Method Detail
-
getSampleAccepted
final List<Integer> getSampleAccepted()
-
setSampleAccepted
final Unit setSampleAccepted(List<Integer> sampleAccepted)
-
getSampleTime
final List<Long> getSampleTime()
-
setSampleTime
final Unit setSampleTime(List<Long> sampleTime)
-
getPermStep
final List<Double> getPermStep()
-
setPermStep
final Unit setPermStep(List<Double> permStep)
-
-
-
-