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 f85bebc + ab09334 commit 986b697Copy full SHA for 986b697
Project.toml
@@ -1,7 +1,7 @@
1
name = "RecursiveArrayTools"
2
uuid = "731186ca-8d62-57ce-b412-fbd966d074cd"
3
authors = ["Chris Rackauckas <[email protected]>"]
4
-version = "2.4.2"
+version = "2.4.3"
5
6
[deps]
7
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
src/array_partition.jl
@@ -331,11 +331,11 @@ function LinearAlgebra.ldiv!(A::T, bb::ArrayPartition) where T<:Union{UnitUpperT
331
lens = map(length, b)
332
@inbounds for j in n:-1:1
333
Ajj = T(getblock(A, lens, j, j))
334
- xj = ldiv!(Ajj, b[j])
+ xj = ldiv!(Ajj, vec(b[j]))
335
for i in j-1:-1:1
336
Aij = getblock(A, lens, i, j)
337
# bi = -Aij * xj + bi
338
- mul!(b[i], Aij, xj, -1, true)
+ mul!(vec(b[i]), Aij, xj, -1, true)
339
end
340
341
return bb
@@ -348,11 +348,11 @@ function LinearAlgebra.ldiv!(A::T, bb::ArrayPartition) where T<:Union{UnitLowerT
348
349
@inbounds for j in 1:n
350
351
352
for i in j+1:n
353
354
# bi = -Aij * xj + b[i]
355
356
357
358
test/upstream.jl
@@ -14,19 +14,17 @@ sol = solve(prob,AutoTsit5(Rosenbrock23()))
14
15
@test all(Array(sol) .== sol)
16
17
-function f!(F, vars)
18
- x = vars.x[1]
19
- F.x[1][1] = (x[1]+3)*(x[2]^3-7)+18
20
- F.x[1][2] = sin(x[2]*exp(x[1])-1)
21
- y=vars.x[2]
22
- F.x[2][1] = (y[1]+3)*(y[2]^3-7)+18
23
- F.x[2][2] = sin(y[2]*exp(y[1])-1)
+function mymodel(F, vars)
+ for i in 1:2
+ x = vars.x[i]
+ F.x[i][1,1] = (x[1,1]+3)*(x[1,2]^3-7)+18.0
+ F.x[i][1,2] = sin(x[1,2]*exp(x[1,1])-1)
+ F.x[i][2,1] = (x[2,1]+3)*(x[2,2]^3-7)+19.0
+ F.x[i][2,2] = sin(x[2,2]*exp(x[2,1])-3)
24
+ end
25
-
26
# To show that the function works
27
-F = ArrayPartition([0.0 0.0],[0.0, 0.0])
28
-u0= ArrayPartition([0.1; 1.2], [0.1; 1.2])
29
-result = f!(F, u0)
30
31
-# To show the NLsolve error that results with ArrayPartitions:
32
-nlsolve(f!, ArrayPartition([0.1; 1.2], [0.1; 1.2]))
+F = ArrayPartition([0.0 0.0; 0.0 0.0],[0.0 0.0; 0.0 0.0])
+u0= ArrayPartition([0.1 1.2; 0.1 1.2], [0.1 1.2; 0.1 1.2])
+result = mymodel(F, u0)
+nlsolve(mymodel, u0)
0 commit comments