@@ -59,20 +59,18 @@ public protocol ShapedVectorNumeric : VectorNumeric {
59
59
/// A type that mathematically represents a differentiable manifold whose
60
60
/// tangent spaces are finite-dimensional.
61
61
public protocol Differentiable {
62
- /// The tangent vector space of this differentiable manifold.
63
- associatedtype TangentVector : Differentiable & VectorNumeric
62
+ /// The tangent bundle of this differentiable manifold.
63
+ associatedtype TangentVector : Differentiable & AdditiveArithmetic
64
64
// FIXME(SR-9595): Unexpected error when type checking constrained
65
65
// associated types.
66
- where // TangentVector.Scalar : FloatingPoint,
67
- TangentVector. TangentVector == TangentVector ,
66
+ where TangentVector. TangentVector == TangentVector ,
68
67
TangentVector. CotangentVector == CotangentVector
69
68
70
- /// The cotangent vector space of this differentiable manifold.
71
- associatedtype CotangentVector : Differentiable & VectorNumeric
69
+ /// The cotangent bundle of this differentiable manifold.
70
+ associatedtype CotangentVector : Differentiable & AdditiveArithmetic
72
71
// FIXME(SR-9595): Unexpected error when type checking constrained
73
72
// associated types.
74
- where // CotangentVector.Scalar : FloatingPoint,
75
- CotangentVector. TangentVector == CotangentVector ,
73
+ where CotangentVector. TangentVector == CotangentVector ,
76
74
CotangentVector. CotangentVector == TangentVector
77
75
78
76
/// Returns `self` moved along the value space towards the given tangent
@@ -84,11 +82,11 @@ public protocol Differentiable {
84
82
func tangentVector( from cotangent: CotangentVector ) -> TangentVector
85
83
}
86
84
87
- // FIXME: The `Self : VectorNumeric ` constraint should be implied by
85
+ // FIXME: The `Self : AdditiveArithmetic ` constraint should be implied by
88
86
// `TangentVector == Self`, but the type checker errors out when it does not
89
87
// exist.
90
88
public extension Differentiable
91
- where TangentVector == Self , Self : VectorNumeric {
89
+ where TangentVector == Self , Self : AdditiveArithmetic {
92
90
func moved( along direction: TangentVector ) -> Self {
93
91
return self + direction
94
92
}
0 commit comments