We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 855f257 + 70d73d3 commit 3f39dadCopy full SHA for 3f39dad
src/utils.jl
@@ -1,6 +1,8 @@
1
#
2
""" use Base.ReshapedArray """
3
_reshape(a, dims::NTuple{D,Int}) where{D} = reshape(a,dims)
4
+_reshape(a::ReshapedArray, dims::NTuple{D,Int}) where{D} = _reshape(a.parent, dims)
5
+
6
function _reshape(a::AbstractArray, dims::NTuple{D,Int}) where{D}
7
@assert prod(dims) == length(a) "cannot reshape array of size $(size(a)) to size $dims"
8
dims == size(a) && return a
@@ -10,7 +12,6 @@ end
10
12
_vec(a) = vec(a)
11
13
_vec(a::AbstractVector) = a
14
_vec(a::AbstractArray) = _reshape(a,(length(a),))
-_vec(a::ReshapedArray) = _vec(a.parent)
15
16
function _mat_sizes(L::AbstractSciMLOperator, u::AbstractArray)
17
m, n = size(L)
0 commit comments