I also strongly dislike the `linspace` change; I like the idea though of having `linspace` and `linrange`, where the former should give the array. Christoph
On Wednesday, 30 September 2015 10:21:36 UTC+1, Michele Zaffalon wrote: > > I just realize that the thread is about 0.3.11 and I am showing output for > 0.4.0-rc2. Sorry for the noise. > > On Wed, Sep 30, 2015 at 11:17 AM, Michele Zaffalon <michele....@gmail.com > <javascript:>> wrote: > >> >> On Wed, Sep 30, 2015 at 9:50 AM, Milan Bouchet-Valat <nali...@club.fr >> <javascript:>> wrote: >> >>> Le mercredi 30 septembre 2015 à 08:55 +0200, Michele Zaffalon a écrit : >>> > Just curious: linspace returns a Range object, but logspace returns a >>> > vector because there is no much use case for a LogRange object? >>> > >>> > @feza: I have also seen the deprecation warning going away after a >>> > couple of calls, but I am not sure why. If you restart Julia, the >>> > deprecations reappear. >>> Deprecation warnings are only printed once for each call place. The >>> idea is that once you're aware of it, there's no point in nagging you. >>> >>> Anyway, that warning is most probably not related to linspace at all, >>> but rather to the array concatenation syntax resulting in an effect >>> equivalent to collect(). If you show us a piece of code that prints the >>> warning, we can give you more details. >>> >>> >>> Regards >>> >> >> Sorry, you are right, I was referring to the concatenation. >> It prints it exaclty twice if I type it in the REPL, it always prints it >> if I define it within a function e.g. a() = [1:3]. >> >> C:\Users\michele.zaffalon>julia >> _ >> _ _ _(_)_ | A fresh approach to technical computing >> (_) | (_) (_) | Documentation: http://docs.julialang.org >> _ _ _| |_ __ _ | Type "?help" for help. >> | | | | | | |/ _` | | >> | | |_| | | | (_| | | Version 0.4.0-rc2 (2015-09-18 17:51 UTC) >> _/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release >> |__/ | x86_64-w64-mingw32 >> >> julia> [1:3] >> WARNING: [a] concatenation is deprecated; use collect(a) instead >> in depwarn at deprecated.jl:73 >> in oldstyle_vcat_warning at abstractarray.jl:29 >> in vect at abstractarray.jl:32 >> while loading no file, in expression starting on line 0 >> 3-element Array{Int64,1}: >> 1 >> 2 >> 3 >> >> julia> [1:3] >> WARNING: [a] concatenation is deprecated; use collect(a) instead >> in depwarn at deprecated.jl:73 >> in oldstyle_vcat_warning at abstractarray.jl:29 >> in vect at abstractarray.jl:32 >> while loading no file, in expression starting on line 0 >> 3-element Array{Int64,1}: >> 1 >> 2 >> 3 >> >> julia> [1:3] >> 3-element Array{Int64,1}: >> 1 >> 2 >> 3 >> >> julia> a() = [1:3] >> a (generic function with 1 method) >> >> julia> a() >> WARNING: [a] concatenation is deprecated; use collect(a) instead >> in depwarn at deprecated.jl:73 >> in oldstyle_vcat_warning at abstractarray.jl:29 >> in a at none:1 >> while loading no file, in expression starting on line 0 >> 3-element Array{Int64,1}: >> 1 >> 2 >> 3 >> >> julia> a() >> WARNING: [a] concatenation is deprecated; use collect(a) instead >> in depwarn at deprecated.jl:73 >> in oldstyle_vcat_warning at abstractarray.jl:29 >> in a at none:1 >> while loading no file, in expression starting on line 0 >> 3-element Array{Int64,1}: >> 1 >> 2 >> 3 >> >> julia> a() >> WARNING: [a] concatenation is deprecated; use collect(a) instead >> in depwarn at deprecated.jl:73 >> in oldstyle_vcat_warning at abstractarray.jl:29 >> in a at none:1 >> while loading no file, in expression starting on line 0 >> 3-element Array{Int64,1}: >> 1 >> 2 >> 3 >> >> >>> >>> > On Wed, Sep 30, 2015 at 5:40 AM, feza <moham...@gmail.com >>> <javascript:>> wrote: >>> > > Strange it *was* giving me an error saying deprecated and that I >>> > > should use collect, but now it's fine. >>> > > >>> > > >>> > > On Tuesday, September 29, 2015 at 10:28:12 PM UTC-4, Sheehan Olver >>> > > wrote: >>> > > > fez, I'm pretty sure the code works fine without the collect: >>> > > > when exp is called on linspace it converts it to a vector. >>> > > > Though the returned t will be linspace object. >>> > > > >>> > > > On Wednesday, September 30, 2015 at 12:10:55 PM UTC+10, feza >>> > > > wrote: >>> > > > > Here's the code I was using where I needed to use collect (I've >>> > > > > been playing around with Julia, so any suggestions on this code >>> > > > > for perf is welcome ;) ) . In general linspace (or the : >>> > > > > notation) is also used commonly to lay a grid in space for >>> > > > > solving a PDE for some other use cases. >>> > > > > >>> > > > > function gp(n) >>> > > > > n = convert(Int,n) >>> > > > > t0 = 0 >>> > > > > tf = 5 >>> > > > > t = collect( linspace(t0, tf, n+1) ) >>> > > > > sigma = exp( -(t - t[1]) ) >>> > > > > >>> > > > > c = [sigma; sigma[(end-1):-1:2]] >>> > > > > lambda = fft(c) >>> > > > > eta = sqrt(lambda./(2*n)) >>> > > > > >>> > > > > Z = randn(2*n) + im*randn(2*n) >>> > > > > x = real( fft( Z.*eta ) ) >>> > > > > return (x, t) >>> > > > > end >>> > > > > >>> > > > > >>> > > > > On Tuesday, September 29, 2015 at 8:59:52 PM UTC-4, Stefan >>> > > > > Karpinski wrote: >>> > > > > > I'm curious why you need a vector rather than an object. Do >>> > > > > > you mutate it after creating it? Having linspace return an >>> > > > > > object instead of a vector was a bit of a unclear judgement >>> > > > > > call so getting feedback would be good. >>> > > > > > >>> > > > > > On Tuesday, September 29, 2015, Patrick Kofod Mogensen < >>> > > > > > patrick....@gmail.com> wrote: >>> > > > > > > No: >>> > > > > > > >>> > > > > > > julia> logspace(0,3,5) >>> > > > > > > 5-element Array{Float64,1}: >>> > > > > > > 1.0 >>> > > > > > > 5.62341 >>> > > > > > > 31.6228 >>> > > > > > > 177.828 >>> > > > > > > 1000.0 >>> > > > > > > >>> > > > > > > On Tuesday, September 29, 2015 at 8:50:47 PM UTC-4, Luke >>> > > > > > > Stagner wrote: >>> > > > > > > > Thats interesting. Does logspace also return a range? >>> > > > > > > > >>> > > > > > > > On Tuesday, September 29, 2015 at 5:43:28 PM UTC-7, Chris >>> > > > > > > > wrote: >>> > > > > > > > > In 0.4 the linspace function returns a range object, >>> > > > > > > > > and you need to use collect() to expand it. I'm also >>> > > > > > > > > interested in nicer syntax. >>> >> >> >