Package sympycore :: Package matrices :: Module algebra :: Class MatrixRing
[hide private]
[frames] | no frames]

Class MatrixRing

source code


Base class to matrix rings that hold matrix element information pairs (<indices>: <element>) stored in Python dictionary.

Represents rectangular matrix.



Nested Classes [hide private]
  __metaclass__
Metaclass for Basic classes.
  ring
Represents an element of a symbolic algebra.
Instance Methods [hide private]
 
__add__(self, other) source code
call graph 
 
__array__(self) source code
 
__div__(self, other) source code
call graph 
 
__eq__(self, other) source code
 
__getitem__(self, key) source code
call graph 
 
__mul__(self, other) source code
call graph 
 
__neg__(self) source code
call graph 
 
__setitem__(self, key, value) source code
call graph 
 
__str__(self)
str(x)
source code
 
__sub__(self, other) source code
call graph 
 
column_indices(self, row=None) source code
 
copy(self) source code
call graph 
 
crop(self)
Remove elements that are out of dimensions.
source code
 
inv(self)
Return inverse of a square matrix.
source code
call graph 
 
inv_l(self)
Return inverse of lower triangular matrix L.
source code
call graph 
 
lu(self)
Perform LU factorization of a m x n matrix A.
source code
call graph 
 
row_indices(self, column=None) source code
 
swap_columns(self, i, j)
Swap i-th and j-th columns inplace.
source code
 
swap_rows(self, i, j)
Swap i-th and j-th rows inplace.
source code

Inherited from basealgebra.ring.CommutativeRing: __pos__, __pow__, __radd__, __rdiv__, __rmul__, __rpow__, __rsub__, __rtruediv__, __truediv__, as_Add_args, as_Factors_args, as_Log_args, as_Mul_args, as_Pow_args, as_Terms_args

Inherited from basealgebra.ring.CommutativeRing (private): _matches

Inherited from basealgebra.algebra.BasicAlgebra: __repr__, as_algebra, as_primitve, as_tree, has, match, matches, subs

Inherited from basealgebra.algebra.BasicAlgebra (private): _subs

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __setattr__

Class Methods [hide private]
 
Number(cls, obj)
Construct algebra number directly from obj.
source code
call graph 
 
random(cls, interval=(-10, 10)) source code
call graph 

Inherited from basealgebra.ring.CommutativeRing: Add, Div, Factors, Log, Mul, Pow, Sub, Terms

Inherited from basealgebra.algebra.BasicAlgebra: Symbol, convert, convert_coefficient, convert_exponent, get_predefined_symbols

Static Methods [hide private]
 
__new__(cls, data={})
Returns: a new object with type S, a subtype of T
source code
call graph 
Class Variables [hide private]
  is_square = None
  one = MatrixRing('[((), 1)]')
  shape = None
  zero = MatrixRing('[((), 0)]')

Inherited from basealgebra.ring.CommutativeRing (private): _symbols

Inherited from basealgebra.algebra.BasicAlgebra (private): _str_value

Properties [hide private]
  T
Return a transposed copy of the matrix.
  data

Inherited from basealgebra.algebra.BasicAlgebra: args, func, symbols

Inherited from object: __class__

Method Details [hide private]

Number(cls, obj)
Class Method

source code 
call graph 
Construct algebra number directly from obj.
Overrides: basealgebra.algebra.BasicAlgebra.Number
(inherited documentation)

__add__(self, other)
(Addition operator)

source code 
call graph 
Overrides: basealgebra.ring.CommutativeRing.__add__

__div__(self, other)

source code 
call graph 
Overrides: basealgebra.ring.CommutativeRing.__div__

__mul__(self, other)

source code 
call graph 
Overrides: basealgebra.ring.CommutativeRing.__mul__

__neg__(self)

source code 
call graph 
Overrides: basealgebra.ring.CommutativeRing.__neg__

__new__(cls, data={})
Static Method

source code 
call graph 
Returns:
a new object with type S, a subtype of T

Overrides: object.__new__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 
str(x)
Overrides: basealgebra.algebra.BasicAlgebra.__str__

__sub__(self, other)
(Subtraction operator)

source code 
call graph 
Overrides: basealgebra.ring.CommutativeRing.__sub__

lu(self)

source code 
call graph 

Perform LU factorization of a m x n matrix A.

Outputs:

P, L, U - LU decomposition matrices of A.

Definitions:

P - m x m permuation matrix
L - m x k lower triangular or trapezoidal matrix with unit-diagonal
U - k x n upper triangular or trapezoidal matrix
k = min(m,n)

A = P * L * U

Property Details [hide private]

T

Return a transposed copy of the matrix.
Get Method:
unreachable.T(self) - Return a transposed copy of the matrix.