Package geometry :: Package manifolds :: Module tangent_bundle
[hide private]
[frames] | no frames]

Source Code for Module geometry.manifolds.tangent_bundle

 1  from . import DifferentiableManifold, contract 
2 3 4 -class TangentBundle(DifferentiableManifold):
5 ''' This class represents the tangent bundle of a generic manifold 6 using a tuple (base, vel) where vel is tangent at base. 7 8 (MatrixLieGroup has different representation) 9 ''' 10 11 # TODO: create tests for all of this 12
13 - def __init__(self, base_manifold):
14 self.base = base_manifold 15 dimension = 2 * base_manifold.get_dimension() 16 DifferentiableManifold.__init__(self, dimension=dimension)
17
18 - def __str__(self):
19 return "T%s" % self.base
20
21 - def belongs(self, x):
22 return self.base.belongs_ts(x)
23
24 - def belongs_ts(self, bv):
25 # XXX: can we make it recursive? 26 raise ValueError('Not supported')
27
28 - def project_ts(self, bv): # TODO: test
29 # XXX: can we make it recursive? 30 raise ValueError('Not supported')
31 32 @contract(a='belongs', b='belongs', returns='>=0')
33 - def distance(self, a, b):
34 # TODO: make checks for this 35 # TODO: implement 36 raise ValueError('Not supported')
37 38 @contract(base='belongs', p='belongs', returns='belongs_ts')
39 - def logmap(self, base, p):
40 raise ValueError('Not supported')
41 42 @contract(bv='belongs_ts', returns='belongs')
43 - def expmap(self, bv):
44 raise ValueError('Not supported')
45 46 @contract(returns='list(belongs)')
47 - def interesting_points(self):
48 # TODO: write this 49 return []
50 51 @contract(a='belongs')
52 - def friendly(self, a):
53 ''' 54 Returns a friendly description string for a point on the manifold. 55 ''' 56 return "%s" % a
57