Skip to content

Commit

Permalink
Revert "Merge pull request JuliaDiff#22 from mcabbott/static"
Browse files Browse the repository at this point in the history
This reverts commit 276d1d7, reversing
changes made to 89f5a06.
  • Loading branch information
KristofferC committed Dec 29, 2022
1 parent 276d1d7 commit 7ad36ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.0'
- '1'
- 'nightly'
os:
Expand Down
12 changes: 5 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
name = "DiffResults"
uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
version = "1.1.0"
version = "1.0.3"

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

[compat]
StaticArrays = "1.5.8"
StaticArraysCore = "1.4.0"
julia = "1.6"
StaticArrays = "0.8, 0.9, 0.10, 0.11, 0.12, 1.0"
julia = "1"

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

[targets]
test = ["Test", "StaticArrays"]
test = ["Test"]
8 changes: 4 additions & 4 deletions src/DiffResults.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module DiffResults

using StaticArraysCore: StaticArray, similar_type, Size
using StaticArrays

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

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

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

#############
# Interface #
Expand Down

0 comments on commit 7ad36ed

Please sign in to comment.