diff options
| author | Eric Anderson <ejona86@gmail.com> | 2014-07-03 19:34:50 -0700 | 
|---|---|---|
| committer | Eric Anderson <ejona86@gmail.com> | 2014-07-03 19:52:20 -0700 | 
| commit | 7f5c9f30dc5d85bf4d197ca77215ce1e9677cb1e (patch) | |
| tree | 6148f9e10e755d8952e53cc01206d3556aa23bab | |
| parent | 4cbd7844ced1d1da19f7470e556a3fbf426e9ca1 (diff) | |
| download | capset-7f5c9f30dc5d85bf4d197ca77215ce1e9677cb1e.tar.gz capset-7f5c9f30dc5d85bf4d197ca77215ce1e9677cb1e.zip  | |
Add option to keep maxim fixed
| -rw-r--r-- | capset.go | 10 | 
1 files changed, 9 insertions, 1 deletions
@@ -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() {  | 
