11module 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
7676constructor instead.
7777"""
7878JacobianResult (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
8989shape information and are not stored in the returned `DiffResult`.
9090"""
9191JacobianResult (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
102102constructor instead.
103103"""
104104HessianResult (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