Package mglutil :: Package math :: Module TensorModule
[hide private]
[frames] | no frames]

Module TensorModule

source code

Classes [hide private]
  Tensor
Tensor in 3D space Constructor: Tensor([[xx, xy, xz], [yx, yy, yz], [zx, zy, zz]]) Tensors support the usual arithmetic operations ('t1', 't2': tensors, 'v': vector, 's': scalar): - 't1+t2' (addition) - 't1-t2' (subtraction) - 't1*t2' (tensorial (outer) product) - 't1*v' (contraction with a vector, same as t1.dot(v.asTensor())) - 's*t1', 't1*s' (multiplication with a scalar) - 't1/s' (division by a scalar) The coordinates can be extracted by indexing; a tensor of rank N can be indexed like an array of dimension N.

Functions [hide private]
  isTensor(x)
Return 1 if |x| is a tensor.

Variables [hide private]
  _undocumented = 1
  delta = Tensor([[1 0 0] [0 1 0] [0 0 1]])
  epsilon = Tensor([[[ 0 0 0] [ 0 0 1] [ 0 -1 0]] [[ 0 0 -1] [ 0...

Function Details [hide private]

isTensor(x)

source code 
Return 1 if |x| is a tensor.

Variables Details [hide private]

_undocumented

None
Value:
1                                                                     
      

delta

None
Value:
Tensor([[1 0 0]
 [0 1 0]
 [0 0 1]])                                                             
      

epsilon

None
Value:
Tensor([[[ 0  0  0]
  [ 0  0  1]
  [ 0 -1  0]]
 [[ 0  0 -1]
  [ 0  0  0]
  [ 1  0  0]]
 [[ 0  1  0]
  [-1  0  0]
...