Skip to content

Commit

Permalink
Merge pull request #715 from gridap/fix_test_broken_in_gridapdistributed
Browse files Browse the repository at this point in the history
Fixes test_broken in GridapDistributed
  • Loading branch information
fverdugo authored Nov 22, 2021
2 parents 2add527 + 2c7d73b commit 6082973
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Arrays/Arrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import Base: size
import Base: getindex, setindex!
import Base: similar
import Base: IndexStyle
import Base: unaliascopy

# CachedArray

Expand Down
1 change: 1 addition & 0 deletions src/Arrays/SubVectors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ end

Base.IndexStyle(::Type{SubVector{T,A}}) where {T,A} = IndexLinear()

Base.unaliascopy(A::SubVector) = typeof(A)(unaliascopy(A.vector), A.pini, A.pend)
13 changes: 12 additions & 1 deletion test/ArraysTests/SubVectorsTests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module SubVectorsTests

using Gridap
using Gridap.Arrays

a = collect(1:10)
Expand All @@ -13,4 +13,15 @@ pend = 9
b = SubVector(a,pini,pend)
test_array(b,collect(pini:pend))

inds = Int32[1,4,3]
a = rand(10)
sa = Gridap.Arrays.SubVector(a,1,5)
vsa = view(sa,inds)

b = rand(10)
vb = view(b,inds)

x = Base.broadcasted(+,vb,vsa)
Base.materialize!(vb,x)

end # module

0 comments on commit 6082973

Please sign in to comment.