summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anderson <ejona86@gmail.com>2014-07-03 19:34:50 -0700
committerEric Anderson <ejona86@gmail.com>2014-07-03 19:52:20 -0700
commit7f5c9f30dc5d85bf4d197ca77215ce1e9677cb1e (patch)
tree6148f9e10e755d8952e53cc01206d3556aa23bab
parent4cbd7844ced1d1da19f7470e556a3fbf426e9ca1 (diff)
downloadcapset-7f5c9f30dc5d85bf4d197ca77215ce1e9677cb1e.tar.gz
capset-7f5c9f30dc5d85bf4d197ca77215ce1e9677cb1e.zip
Add option to keep maxim fixed
-rw-r--r--capset.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/capset.go b/capset.go
index c0b9bbe..2b182cb 100644
--- a/capset.go
+++ b/capset.go
@@ -190,6 +190,9 @@ type Capset struct {
maxim int
// hasSet is true if the current tableau contains at least one set.
hasSet bool
+ // fixedMaxim is false when maxim should be increased as larger capsets are
+ // found.
+ fixedMaxim bool
}
// NewCapset makes an initialized Capset for the provided deck. If maxim is -1,
@@ -301,7 +304,9 @@ func (cs *Capset) FindNextCapset() bool {
if len(cs.tableau) < cs.maxim {
continue
}
- cs.maxim = len(cs.tableau)
+ if !cs.fixedMaxim {
+ cs.maxim = len(cs.tableau)
+ }
return true
}
return false
@@ -339,6 +344,8 @@ func main() {
flag.PrintDefaults()
}
initialMaxim := flag.Int("maxim", -1, "initial maxim to use; -1 for auto")
+ fixedMaxim := flag.Bool("fixed-maxim", false,
+ "maxim does not change when larger capset is found")
saveFile := flag.String("save-file", "", "file to save progress to")
flag.Parse()
@@ -371,6 +378,7 @@ func main() {
if cs == nil {
cs = NewCapset(d, *initialMaxim)
}
+ cs.fixedMaxim = *fixedMaxim
fmt.Println("Starting processing with", cs.tableau)
for cs.FindNextCapset() {