File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
stdlib/public/Differentiation Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,17 @@ extension Optional: Differentiable where Wrapped: Differentiable {
19
19
20
20
public var value : Wrapped . TangentVector ?
21
21
22
+ @inlinable
22
23
public init ( _ value: Wrapped . TangentVector ? ) {
23
24
self . value = value
24
25
}
25
26
27
+ @inlinable
26
28
public static var zero : Self {
27
29
return Self ( . zero)
28
30
}
29
31
32
+ @inlinable
30
33
public static func + ( lhs: Self , rhs: Self ) -> Self {
31
34
switch ( lhs. value, rhs. value) {
32
35
case ( nil , nil ) : return Self ( nil )
@@ -36,6 +39,7 @@ extension Optional: Differentiable where Wrapped: Differentiable {
36
39
}
37
40
}
38
41
42
+ @inlinable
39
43
public static func - ( lhs: Self , rhs: Self ) -> Self {
40
44
switch ( lhs. value, rhs. value) {
41
45
case ( nil , nil ) : return Self ( nil )
@@ -45,13 +49,15 @@ extension Optional: Differentiable where Wrapped: Differentiable {
45
49
}
46
50
}
47
51
52
+ @inlinable
48
53
public mutating func move( by offset: TangentVector ) {
49
54
if let value = offset. value {
50
55
self . value? . move ( by: value)
51
56
}
52
57
}
53
58
}
54
59
60
+ @inlinable
55
61
public mutating func move( by offset: TangentVector ) {
56
62
if let value = offset. value {
57
63
self ? . move ( by: value)
You can’t perform that action at this time.
0 commit comments