Skip to content

pyrix.matrix package Reference


Categorization Of Methods

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
    pyrix                               <-[package]
    |
    ----matrix                          <-[sub-package]
        |
        ----zeroMatrix()                <-[function]
        ----unitMatrix()                <-[function]
        ----identityMatrix()            <-[function]
        ----randomMatrix()              <-[function]
        ----matrixData                  <-[class]
        ----Matrix                      <-[class]

pyrix.matrix.matrixData Class Reference

Category 0: Matrix DataType

The Core Mechanism which is used to store the Matrix Object Data. Having Applied Elements of Dynamic Programming , It is quite effective in making decisions when it comes to calculating certain values in a cost effective way and on the other hand maintains a Character Profile of the Matrix . All The Matrix Data is stored here which allows for implementing Dynamic Programming Principles such as Memoization:

Property Description
1. nrow [int] Number of Rows
2. ncol [int] Number of Columns
3. dimensions [list] list format of nrow,ncol together
4. data [list] All the Matrix Values stored in nested-list format
5. invertibility [Boolean] returns True if matrix is invertible ,default-value=None
6. determinant [int] stores determinant value,default-value=None
7. singular [Boolean] returns False if matrix is invertible ,default-value=None
8. eigenvals [list] list of eigen values
9. eigenvects [list] list of eigen vectors
10. rank [int] stores the rank of the matrix
11. triangularity [int] returns 2 for upperT. ,1 for lowerT.,0 for No Triangularity
12. binaryMatrix [Boolean] returns True if binary matrix//reserved for binary matrix class
13. singularvalue [int/float] returns singular value,None By default
14. orthogonalMatrix [Boolean] returns True if matrix is orthogonal in nature
15. minor [list] contains minor values,By default None
16. listifieddata [list] contains all the data values in a flattened list
17. classType [str] defines the type of pyrix/matrix implementation(occours in inheriting classes)
18. symmetry [Boolean] True for symmetrical,None by default,False otherwise

pyrix.matrix.Matrix Class Reference

Category 1: Base Class Methods and Operator Overriding Methods

These Methods are extensions for adding operator support to custom Matrix object type.

  Method Description
1. __init__() Initializer constructor method
2. __repr__() Describes/represents the object and returns sensible/expected values.
3. __str__() String value of the Object.
4. __add__() Addition of two matrices [operator override].
5. __sub__() Subtraction of two matrices [operator override].
6. __mul__() Multiplication of two matrices [operator override].
7. __truediv__() Dummy Method to prevent operator failure [operator override].
8. __floordiv__() Dummy Method to prevent operator failure [operator override].
9. __pow__() Raises a matrix to the specified power.
10. __abs__() Returns the absolute or determinant value of the matrix.
11. __mod__() Dummy Method to prevent operator misuse raises divisionErrorException exception [operator override].
12. __lshift__() Dummy Method to prevent operator misuse raises bitWiseOnMatrix exception [operator override].
13. __rshift__() Dummy Method to prevent operator misuse raises bitWiseOnMatrix exception [operator override].
14. __and__() Dummy Method to prevent operator misuse raises bitWiseOnMatrix exception [operator override].
15. __or__() Dummy Method to prevent operator misuse raises bitWiseOnMatrix exception [operator override].
16. __xor__() Dummy Method to prevent operator misuse raises bitWiseOnMatrix exception [operator override].
17. __invert__() Dummy Method to prevent operator misuse raises bitWiseOnMatrix exception [operator override].
18. __eq__() returns boolean values based on matrix equality.
20. __ceil__()
19. __floor__()
21. __trunc__()

Category 2 : Matrix Analysis Methods

These methods are useful for analyzing charactaristicts of the matrix for some interpretation and helps saving computation costs in certain cases.

  Method Description
1. equals Checks for equality of the two matrices based on dimensions and the data inside. Returns a Boolean Value.
2. isSquareMatrix Checks if the Matrix is a square Matrix or not. A square matrix is a matrix with equal number of rows and cols. Returns a Boolean value.
3. isInvertible Checks if the Matrix is an Invertible Matrix or not .An Invertible matrix is a matrix with a non zero determinant .Returns a Boolean value.
4. isUpperTriangular This method determines whether a Matrix is a Upper Triangular matrix or not . Returns a Boolean value
5. isLowerTriangular This method determines whether a Matrix is a Lower Triangular matrix or not . Returns a Boolean value
6. isSymmetricMatrix
7. isOrthogonalMatrix
8. getRow Selects a Row of the matrix of specified index .Returns a list of the values.
9. getCol Selects a Column of the matrix of specified index .Returns a list(or nested list) of the values.
10. RoundOff Rounds off the Value of the data in the matrix object to the given extent .Returns NoneType and should not be assigned to a variable.
11. scaleMatrix Scales the Value of the data in the matrix object by the scalar value .Returns NoneType and should not be assigned to a variable.
12. determinantValue Determines the determinant value of the matrix object .Returns int or float depending on the outcome.
13. __determinantHelper This Method specifically helps with recursive implementation of determinant algorithm.
14. matrixRank Calculates the Rank of the matrix object .Returns integer value of rank.
15. matrixTrace The trace of a square matrix is defined to be the sum of elements on the main diagonal of a Matrix. Returns a Int/float value.
16. minorSpecific Finds a specific minor value for a certain position.Returns a Int/Float Value.
17. getAllMinors Finds all the minor values of the matrix object. Returns a new Matrix Object of minors.
18. cofactorSpecific Finds a specific cofactor Value of a certain position. Returns a Int/Float Value.
19. getAllCofactors Finds all the cofactor values of the matrix object. Returns a new Matrix Object of cofactors.
20. __minor Finds minor values (Private method) . Returns a nested list of minors
21. __cofactor Finds cofactor values (Private method). Returns a nested list of cofactors.
22. __minor2x2 Finds minor values for 2x2 matrices (Private method). Returns a nested list.
23. __matrixsplitter

Category 3 : Intra-Matrix Methods

These Methods deal with Row and Column operations on the same matrix.

  Method Description
1. addRow Adds row values of one matrix to same matrix .Returns NoneType and should not be assigned to a variable.
2. subRow Subtracts row values of one matrix to same matrix .Returns NoneType and should not be assigned to a variable

Category 4: Inter-Matrix Methods

These Methods deal with Row and Column operations on different matrices

  Method Description
1. addRows Adds row values of one matrix to another matrix Returns NoneType and should not be assigned to a variable.
2. subRows Subtracts row values of one matrix to another matrix .Returns NoneType and should not be assigned to a variable.

Category 5: Matrix Transformations

These Methods apply to matrices where they are transformed in some way or the other

  Method Description
1. invertMatrix Creates an Inverse Matrix of the given matrix .Returns a Matrix object.
2. __verify This method verifies a inverse of the matrix by multiplying it with the original input matrix to get identity matrix.
3. rowEchleonTransform
4. RrowEchleonTransform
5. transposeTransform Transpose of the original matrix is created. Returns a Matrix Object.
6. adjointTransform
7. __row__add An internal method for adding row values.["legacy method"]
8. __row__sub An internal method for subtracting row values.["legacy method"]
9. __row__mult An internal method for scaling a specific row with a value.["legacy method"]
10. __scalarDivideRow An internal method for scaling down a row.["legacy method"]

Category 6: Statistical Methods

These Methods perform statistical operations over the matrix

  Method Description
1. globalMean Finds the mean value of all data points in the matrix.
2. globalMedian Finds the median value of all data points in the matrix.
3. globalMode Finds the Mode value of all data points in the matrix.
4. localRowMean Finds the mean value of all data points in the matrix for a specified row.
5. localRowMedian Finds the median value of all data points in the matrix for a specified row.
6. localRowMode Finds the Mode value of all data points in the matrix for a specified row.
7. localColumnMean Finds the mean value of all data points in the matrix for a specified column.
8. localColumnMedian Finds the median value of all data points in the matrix for a specified column.
9. localColumnMode Finds the Mode value of all data points in the matrix for a specified column.

Category 7: Supplementary Methods

A few of the Extras Methods

  Method Description
1. vectorMultiplication Vector multiplication with a compatible matrix object.[Experimental method]

Quick Initialization functions and Utility Functions

Util Methods

A few ways to create a new matrix object

  Method Description
1. zeroMatrix Create a zero matrix of the given dimensions. Returns a Matrix Object.
2. unitMatrix Create a unit matrix of the given dimensions. Returns a Matrix Object .
3. identityMatrix Create a identity matrix of the given dimensions Works for square Matrices. Retuns a Matrix Object.
4. randomMatrix Aids in creating Pseudo-Random matrix of an estimated size and dimensions with options to configure paramaters.
5. copy Creates a DEEP(HARD) copy of the Matrix object. Returns a Matrix Object

Last update: December 31, 2020