On Thursday, October 22, 2015 at 9:44:28 AM UTC-4, Gabriel Gellner wrote: > > A related discussion is about a special Ones type representing an array >> of 1, which would allow efficient generic implementations of >> (non-)weighted statistical functions: >> https://github.com/JuliaStats/StatsBase.jl/issues/135 >> >> But regarding zeros(), there might not be any compelling use case to >> return a special type. Anyway, if arrays are changed to initialize to >> zero [1], that function go could away entirely > > > lol never thought of this kind of special case. You could simply have a > "SameVector" object that just stores the value and the length. * + - ^ > would be easy to define and the space/(# of operations) savings could be > massive ;). With this you would have no need to special case zeros(n) > either just have it return a SameVector with value 0. We could even > generalize it to "BlockVector" for sequences of same values storing start > and stop locations. >
- Re: [julia-users] Re: A question of Style: Iterat... Spencer Russell
- Re: [julia-users] Re: A question of Style: Iterators i... Gabriel Gellner
- Re: [julia-users] Re: A question of Style: Iterat... Jonathan Malmaud
- Re: [julia-users] Re: A question of Style: It... Gabriel Gellner
- Re: [julia-users] Re: A question of Style... DNF
- Re: [julia-users] Re: A question of Style... Gabriel Gellner
- Re: [julia-users] Re: A question of Style... Stefan Karpinski
- Re: [julia-users] Re: A question of Style... Spencer Russell
- Re: [julia-users] Re: A question of Style... Milan Bouchet-Valat
- Re: [julia-users] Re: A question of Style... Gabriel Gellner
- Re: [julia-users] Re: A question of Style... Tom Breloff
- Re: [julia-users] Re: A question of Style... DNF
- Re: [julia-users] Re: A question of Style... Jonathan Malmaud
- Re: [julia-users] Re: A question of Style... Gabriel Gellner
- Re: [julia-users] Re: A question of Style... Stefan Karpinski
- Re: [julia-users] Re: A question of Style... Gabriel Gellner
- Re: [julia-users] Re: A question of Style... Tim Holy
- Re: [julia-users] Re: A question of Style... Gabriel Gellner
- Re: [julia-users] Re: A question of Style... Christoph Ortner
- Re: [julia-users] Re: A question of Style... Christoph Ortner
- Re: [julia-users] Re: A question of Style... Andras Niedermayer
