Logo Search packages:      
Sourcecode: python-scientific version File versions  Download package

Scientific::Geometry::TensorModule::Tensor Class Reference

List of all members.


Detailed Description

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.

Tensors are *immutable*, i.e. their elements cannot be changed.

Tensor elements can be any objects on which the standard
arithmetic operations are defined. However, eigenvalue calculation
is supported only for float elements.

Definition at line 13 of file TensorModule.py.


Public Member Functions

def __add__
def __cmp__
def __div__
def __getitem__
def __init__
def __len__
def __mul__
def __neg__
def __rdiv__
def __repr__
def __rmul__
def __rsub__
def __str__
def __sub__
def asVector
def asymmetricalPart
def diagonal
def diagonalization
def dot
def eigenvalues
def inverse
def symmetricalPart
def trace
def transpose

Public Attributes

 array
 rank

Static Public Attributes

int is_tensor = 1

Static Private Attributes

 __radd__ = __add__

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index