PartIsPerfect: Check if the partition is perfect.

Description Usage Arguments Value Examples

Description

A partition is perfect if the difference between the sum of integers of S1 and S2 is equal to 0 (resp. 1) for a even (resp. odd) set.

Usage

1
PartIsPerfect(sizes, part)

Arguments

sizes

a numeric vector which represents the integers (>0) in the set S.

part

a logical vector which represents the indicator function of S1 in the partition S=S1+S2.

Value

true if the partition is perfect.

Examples

1
2

arnaud-m/partition documentation built on May 10, 2019, 1:44 p.m.