-
Notifications
You must be signed in to change notification settings - Fork 89
Closed
Description
I get a warning when using pcolor on a matrix generated by reshape on a stridden subvector. For example,
using PyPlot
a = rand(10);
b = @view a[1:3:end]; # stridden subvector
c = reshape(b, 2, :); # reshape subvector into matrix
pcolor(c)produces the following warning:
┌ Warning: The default `strides(a::AbstractArray)` implementation is deprecated for general arrays.
│ Specialize `strides(::Base.ReshapedArray)` if `Base.ReshapedArray` indeed uses a strided representation in memory.
│ Warning: inappropriately implementing this method for an array type that does not use strided
│ storage may lead to incorrect results or segfaults.
│ caller = ip:0x0
└ @ Core :-1
┌ Warning: The default `strides(a::AbstractArray)` implementation is deprecated for general arrays.
│ Specialize `strides(::Base.ReshapedArray)` if `Base.ReshapedArray` indeed uses a strided representation in memory.
│ Warning: inappropriately implementing this method for an array type that does not use strided
│ storage may lead to incorrect results or segfaults.
│ caller = stride at abstractarray.jl:350 [inlined]
└ @ Core ./abstractarray.jl:350If a matrix itself is stridden (instead of a vector being stridden and reshaped into a matrix), then the warning does not occur.
Here is the version information:
julia> VERSION
v"0.7.1-pre.0"dlfivefifty
Metadata
Metadata
Assignees
Labels
No labels