1
1
module DiffResults
2
2
3
- using StaticArrays
3
+ using StaticArraysCore : StaticArray, similar_type, Size
4
4
5
5
# ########
6
6
# Types #
@@ -76,7 +76,7 @@ shape information. If you want to allocate storage yourself, use the `DiffResult
76
76
constructor instead.
77
77
"""
78
78
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)))))
80
80
81
81
"""
82
82
JacobianResult(y::AbstractArray, x::AbstractArray)
@@ -89,7 +89,7 @@ Like the single argument version, `y` and `x` are only used for type and
89
89
shape information and are not stored in the returned `DiffResult`.
90
90
"""
91
91
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)))))
93
93
94
94
"""
95
95
HessianResult(x::AbstractArray)
@@ -102,7 +102,7 @@ shape information. If you want to allocate storage yourself, use the `DiffResult
102
102
constructor instead.
103
103
"""
104
104
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)))))
106
106
107
107
# ############
108
108
# Interface #
0 commit comments