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 {
1919
2020 public var value : Wrapped . TangentVector ?
2121
22+ @inlinable
2223 public init ( _ value: Wrapped . TangentVector ? ) {
2324 self . value = value
2425 }
2526
27+ @inlinable
2628 public static var zero : Self {
2729 return Self ( . zero)
2830 }
2931
32+ @inlinable
3033 public static func + ( lhs: Self , rhs: Self ) -> Self {
3134 switch ( lhs. value, rhs. value) {
3235 case ( nil , nil ) : return Self ( nil )
@@ -36,6 +39,7 @@ extension Optional: Differentiable where Wrapped: Differentiable {
3639 }
3740 }
3841
42+ @inlinable
3943 public static func - ( lhs: Self , rhs: Self ) -> Self {
4044 switch ( lhs. value, rhs. value) {
4145 case ( nil , nil ) : return Self ( nil )
@@ -45,13 +49,15 @@ extension Optional: Differentiable where Wrapped: Differentiable {
4549 }
4650 }
4751
52+ @inlinable
4853 public mutating func move( by offset: TangentVector ) {
4954 if let value = offset. value {
5055 self . value? . move ( by: value)
5156 }
5257 }
5358 }
5459
60+ @inlinable
5561 public mutating func move( by offset: TangentVector ) {
5662 if let value = offset. value {
5763 self ? . move ( by: value)
You can’t perform that action at this time.
0 commit comments