[go-nuts] Re: Newbie Implementation of Set Partitions Generator

2017-10-13 Thread john lynch
"I'm sure it'll reveal an error in my thinking" To avoid importing math I had changed my upper limit early on but I 'd misread it. The critical line in error should be changed to: for j := 0; j < int(math.Pow(2.0, float64(len(set)))/2.0); j++ { -- You received this message because you are

[go-nuts] Re: Newbie Implementation of Set Partitions Generator

2017-10-13 Thread john lynch
Thanks Ian, You are correct (although the post I submitted yesterday had the clobbering lines incorrect - that was one of my experiments to see if rebuilding the 3D slice differently would overcome the problem). The code below is my original. Yes, the function works by building fresh version

[go-nuts] Re: Newbie Implementation of Set Partitions Generator

2017-10-13 Thread john lynch
The top 3 lines of the function I posted yesterday were not correct but I couldn't edit them. Unfortunately, in my experiments with the slice I had changed them and didn't realize before posting. The correct version is: package main import ( "fmt" "time") func get_partitions(set []s