Implement temporary matrix pools

I have made pool use conditional on a tag until we decide to make significant use of it. When that happens I'll move the code into matrix.go.

	BenchmarkPool10by10Uncleared	20000000	        75.2 ns/op
	BenchmarkPool10by10Cleared		10000000	       167 ns/op
	BenchmarkNew10by10	 			 5000000	       404 ns/op
	BenchmarkPool100by100Uncleared	20000000	        75.5 ns/op
	BenchmarkPool100by100Cleared	  500000	      3809 ns/op
	BenchmarkNew100by100	  		  200000	     11998 ns/op

No, because l is declared in the for loop scope, it's a reference to a
different variable each time in the closure.

On Thu, Sep 25, 2014 at 11:11 PM, Brendan Tracey <notifications@github.com>
wrote:

> In mat64/pool.go:
>
> > +	v |= v >> 2
> > +	v |= v >> 4
> > +	v |= v >> 8
> > +	v |= v >> 16
> > +	v |= v >> 32
> > +	return tab64[((v-(v>>1))*0x07EDD5E59A4E28C2)>>58] - 1
> > +}
> > +
> > +var pool [63]sync.Pool
> > +
> > +func init() {
> > +	for i := range pool {
> > +		l := 1 << uint(i)
> > +		pool[i].New = func() interface{} {
> > +			return &Dense{RawMatrix{
> > +				Data: make([]float64, l),
>
> Is this line okay? Doesn't the value of l change as we loop through?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/gonum/matrix/pull/21/files#r18074958>.
>