def setToDiagonalMatrix(matrix, colVect): result = [] vectSubA = matrixMulti.getAllCols(matrix) for index, columnVect in enumerate(vectSubA): vectSubB = setColumnToDiagnolValue(columnVect, colVect, index) result.append(vectSubB) # rotating back to original vector dimensions vectSub = matrixMulti.getAllCols(result) return vectSub
def identityMatrix(vect): result = [] vectSubA = matrixMulti.getAllCols(vect) for index, columnVect in enumerate(vectSubA): vectSubB = matrixSliceMarch(columnVect, index) result.append(vectSubB) # rotating back to original vector dimensions vectSub = matrixMulti.getAllCols(result) return vectSub
def setToStrictlyUpperTriMatrix(matrix): result = [] vectSubA = matrixMulti.getAllCols(matrix) for index, columnVect in enumerate(vectSubA): vectSubB = setSutmColumnValue(columnVect, index) result.append(vectSubB) # rotating back to original vector dimensions vectSub = matrixMulti.getAllCols(result) return vectSub
def setSymmetricFromLowerTri(orgMatrix): colMatrix = matrixMulti.getAllCols(orgMatrix) resultMatrix = [] for index, colVect in enumerate(colMatrix): rowVect = orgMatrix[index] print("\n>>colVect:%s \n>>rowVect:%s \n>> index :%s " % (rowVect, colVect, index)) resultCol = transformVectToLowerSymmetric(rowVect, colVect, index) resultMatrix.append(resultCol) print("\n>>resultMatrix: %s" % (resultMatrix)) return matrixMulti.getAllCols(resultMatrix)