Skip to content

Commit 276d1d7

Browse files
authored
Merge pull request #22 from mcabbott/static
use StaticArraysCore
2 parents 89f5a06 + f38c413 commit 276d1d7

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
version:
19-
- '1.0'
19+
- '1.6'
2020
- '1'
2121
- 'nightly'
2222
os:

Project.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
name = "DiffResults"
22
uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
3-
version = "1.0.3"
3+
version = "1.1.0"
44

55
[deps]
6-
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
6+
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
77

88
[compat]
9-
StaticArrays = "0.8, 0.9, 0.10, 0.11, 0.12, 1.0"
10-
julia = "1"
9+
StaticArrays = "1.5.8"
10+
StaticArraysCore = "1.4.0"
11+
julia = "1.6"
1112

1213
[extras]
14+
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1315
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1416

1517
[targets]
16-
test = ["Test"]
18+
test = ["Test", "StaticArrays"]

src/DiffResults.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module DiffResults
22

3-
using StaticArrays
3+
using StaticArraysCore: StaticArray, similar_type, Size
44

55
#########
66
# Types #
@@ -76,7 +76,7 @@ shape information. If you want to allocate storage yourself, use the `DiffResult
7676
constructor instead.
7777
"""
7878
JacobianResult(x::AbstractArray) = DiffResult(similar(x), similar(x, length(x), length(x)))
79-
JacobianResult(x::StaticArray) = DiffResult(x, zeros(StaticArrays.similar_type(typeof(x), Size(length(x),length(x)))))
79+
JacobianResult(x::StaticArray) = DiffResult(x, zeros(similar_type(typeof(x), Size(length(x),length(x)))))
8080

8181
"""
8282
JacobianResult(y::AbstractArray, x::AbstractArray)
@@ -89,7 +89,7 @@ Like the single argument version, `y` and `x` are only used for type and
8989
shape information and are not stored in the returned `DiffResult`.
9090
"""
9191
JacobianResult(y::AbstractArray, x::AbstractArray) = DiffResult(similar(y), similar(y, length(y), length(x)))
92-
JacobianResult(y::StaticArray, x::StaticArray) = DiffResult(y, zeros(StaticArrays.similar_type(typeof(x), Size(length(y),length(x)))))
92+
JacobianResult(y::StaticArray, x::StaticArray) = DiffResult(y, zeros(similar_type(typeof(x), Size(length(y),length(x)))))
9393

9494
"""
9595
HessianResult(x::AbstractArray)
@@ -102,7 +102,7 @@ shape information. If you want to allocate storage yourself, use the `DiffResult
102102
constructor instead.
103103
"""
104104
HessianResult(x::AbstractArray) = DiffResult(first(x), zeros(eltype(x), size(x)), similar(x, length(x), length(x)))
105-
HessianResult(x::StaticArray) = DiffResult(first(x), x, zeros(StaticArrays.similar_type(typeof(x), Size(length(x),length(x)))))
105+
HessianResult(x::StaticArray) = DiffResult(first(x), x, zeros(similar_type(typeof(x), Size(length(x),length(x)))))
106106

107107
#############
108108
# Interface #

0 commit comments

Comments
 (0)