GeneralBrokenLines V03-00-00
gblpy
Public Member Functions | Private Attributes | List of all members
gblpy.gblnum.BorderedBandMatrix Class Reference

(Symmetric) Bordered Band Matrix. More...

Inheritance diagram for gblpy.gblnum.BorderedBandMatrix:

Public Member Functions

def __init__ (self, nSize, nBorder=1, nBand=7)
 Create new BBmatrix. More...
 
def addBlockMatrix (self, aIndex, aMatrix)
 Add (compressed) block to BBmatrix: More...
 
def getBlockMatrix (self, aIndex)
 Retrieve (compressed) block from BBmatrix: More...
 
def printMatrix (self)
 Print BBmatrix. More...
 
def solveAndInvertBorderedBand (self, aRightHandSide)
 Solve linear equation A*x=b system with BBmatrix A, calculate BB part of inverse of A. More...
 

Private Attributes

 __numSize
 size of matrix; int More...
 
 __numBorder
 size of border; int More...
 
 __numBand
 size of border; int More...
 
 __numCol
 size of band part of matrix; int More...
 
 __border
 border part B; matrix(float) More...
 
 __mixed
 mixed part M; matrix(float) More...
 
 __band
 band part C; matrix(float) More...
 

Detailed Description

(Symmetric) Bordered Band Matrix.

Separate storage of border, mixed and band parts.

  Example for matrix size=8 with border size and band width of two:
  
     +-                                 -+
     |  B11 B12 M13 M14 M15 M16 M17 M18  |
     |  B12 B22 M23 M24 M25 M26 M27 M28  |
     |  M13 M23 C33 C34 C35  0.  0.  0.  |
     |  M14 M24 C34 C44 C45 C46  0.  0.  |
     |  M15 M25 C35 C45 C55 C56 C57  0.  |
     |  M16 M26  0. C46 C56 C66 C67 C68  |
     |  M17 M27  0.  0. C57 C67 C77 C78  |
     |  M18 M28  0.  0.  0. C68 C78 C88  |
     +-                                 -+
     
  Is stored as: 
  
     +-         -+     +-                         -+
     |  B11 B12  |     |  M13 M14 M15 M16 M17 M18  | 
     |  B12 B22  |     |  M23 M24 M25 M26 M27 M28  |
     +-         -+     +-                         -+
     
                       +-                         -+
                       |  C33 C44 C55 C66 C77 C88  |
                       |  C34 C45 C56 C67 C78  0.  |
                       |  C35 C46 C57 C68  0.  0.  |
                       +-                         -+

Definition at line 65 of file gblnum.py.

Constructor & Destructor Documentation

◆ __init__()

def gblpy.gblnum.BorderedBandMatrix.__init__ (   self,
  nSize,
  nBorder = 1,
  nBand = 7 
)

Create new BBmatrix.

Parameters
nSizesize of matrix; int
nBordersize of border (default: 1, 'curvature'); int
nBand(maximal) band width (7); int

Definition at line 73 of file gblnum.py.

Member Function Documentation

◆ addBlockMatrix()

def gblpy.gblnum.BorderedBandMatrix.addBlockMatrix (   self,
  aIndex,
  aMatrix 
)

Add (compressed) block to BBmatrix:

BBmatrix(aIndex(i),aIndex(j)) += aMatrix(i,j)

Parameters
aIndexlist of indices; list(int)
aMatrix(compressed) matrix; matrix(float)

Definition at line 98 of file gblnum.py.

References gblpy.gblnum.BorderedBandMatrix.__band, gblpy.gblnum.BorderedBandMatrix.__border, gblpy.gblnum.BorderedBandMatrix.__mixed, gblpy.gblnum.BorderedBandMatrix.__numBand, and gblpy.gblnum.BorderedBandMatrix.__numBorder.

◆ getBlockMatrix()

def gblpy.gblnum.BorderedBandMatrix.getBlockMatrix (   self,
  aIndex 
)

Retrieve (compressed) block from BBmatrix:

aMatrix(i,j) = BBmatrix(aIndex(i),aIndex(j))

Parameters
aIndexlist of indices; list(int)
Returns
(compressed) matrix; matrix(float)

Definition at line 124 of file gblnum.py.

References gblpy.gblnum.BorderedBandMatrix.__band, gblpy.gblnum.BorderedBandMatrix.__border, gblpy.gblnum.BorderedBandMatrix.__mixed, gblpy.gblnum.BorderedBandMatrix.__numBand, and gblpy.gblnum.BorderedBandMatrix.__numBorder.

◆ printMatrix()

def gblpy.gblnum.BorderedBandMatrix.printMatrix (   self)

◆ solveAndInvertBorderedBand()

def gblpy.gblnum.BorderedBandMatrix.solveAndInvertBorderedBand (   self,
  aRightHandSide 
)

Solve linear equation A*x=b system with BBmatrix A, calculate BB part of inverse of A.

Parameters
aRightHandSideright hand side 'b' of linear equation system; vector(float)
Returns
solution; vector(float)
Exceptions
ZeroDivisionErrorBand matrix is not positive definite
Note
BBmatrix is replaced by BB part of it's inverse

Definition at line 170 of file gblnum.py.

Member Data Documentation

◆ __band

gblpy.gblnum.BorderedBandMatrix.__band
private

◆ __border

gblpy.gblnum.BorderedBandMatrix.__border
private

◆ __mixed

gblpy.gblnum.BorderedBandMatrix.__mixed
private

◆ __numBand

gblpy.gblnum.BorderedBandMatrix.__numBand
private

◆ __numBorder

gblpy.gblnum.BorderedBandMatrix.__numBorder
private

◆ __numCol

gblpy.gblnum.BorderedBandMatrix.__numCol
private

size of band part of matrix; int

Definition at line 82 of file gblnum.py.

◆ __numSize

gblpy.gblnum.BorderedBandMatrix.__numSize
private

size of matrix; int

Definition at line 76 of file gblnum.py.


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