Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy! : indexed assignment not defined for linspace, range #18358

Closed
colbec opened this issue Sep 5, 2016 · 4 comments
Closed

copy! : indexed assignment not defined for linspace, range #18358

colbec opened this issue Sep 5, 2016 · 4 comments
Labels
won't change Indicates that work won't continue on an issue or pull request

Comments

@colbec
Copy link

colbec commented Sep 5, 2016

Hit this issue while doing a test of QuantEcon.jl which passes fine in Julia 0.4.6 but fails in 0.6 current.
From QuantEcon:

Testing markov_approx.jl: Error During Test
  Got an exception of type ErrorException outside of a @test
  indexed assignment not defined for LinSpace{Float64}
   in copy!(::LinSpace{Float64}, ::LinSpace{Float64}) at ./multidimensional.jl:614
   in tauchen(::Int64, ::Float64, ::Float64, ::Float64, ::Int64) at /home/colin/.julia/v0.6/QuantEcon/src/markov/markov_approx.jl:76
   in macro expansion; at /home/colin/.julia/v0.6/QuantEcon/test/test_markov_approx.jl:15 [inlined]

Since this is related to copy! I ran a test

a = linspace(1,4,3)
b = linspace(1,4,3)
copy!(b,a)
ERROR: indexed assignment not defined for LinSpace{Float64}
 in copy!(::LinSpace{Float64}, ::LinSpace{Float64}) at ./multidimensional.jl:614

And the same happens for range objects but is fine for arrays.
It seems reasonable that copy should be defined at least for linspace, so I'm starting the report here, but can move elsewhere if advised.

versioninfo()
Julia Version 0.6.0-dev.488
Commit 79a7172* (2016-09-05 06:23 UTC)
Platform Info:
  System: Linux (x86_64-suse-linux)
  CPU: Intel(R) Core(TM) i5-4460  CPU @ 3.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)




@yuyichao
Copy link
Contributor

yuyichao commented Sep 5, 2016

Linspace is immutable so this can't be done.

FWIW, I don't really think this is a good argument against linspace returning a immutable type.

@yuyichao yuyichao added the won't change Indicates that work won't continue on an issue or pull request label Sep 5, 2016
@yuyichao yuyichao closed this as completed Sep 5, 2016
@yuyichao
Copy link
Contributor

yuyichao commented Sep 5, 2016

And the discussion of LinSpace vs Vector should be continued at #14420 (which is possibly an argument against LinSpace) or #17408

@colbec
Copy link
Author

colbec commented Sep 5, 2016

OK so I will report in QuantEcon. Thanks.

@colbec
Copy link
Author

colbec commented Sep 5, 2016

Also related is QuantEcon/QuantEcon.jl#132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
won't change Indicates that work won't continue on an issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants