本文整理汇总了Python中Matrix.Matrix.inputMatrix方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.inputMatrix方法的具体用法?Python Matrix.inputMatrix怎么用?Python Matrix.inputMatrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix.Matrix
的用法示例。
在下文中一共展示了Matrix.inputMatrix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from Matrix import Matrix [as 别名]
# 或者: from Matrix.Matrix import inputMatrix [as 别名]
def main():
# Gets coefficient matrix
print("Input the coefficient matrix: ")
coeff = Matrix(0,0,m=[])
coeff.inputMatrix()
# Gets constant matrix
print("Input the constant matrix: ")
const = Matrix(0,0,m=[])
const.inputMatrix()
if DoesSolutionExist(coeff):
sol = SystemSolution(coeff, const)
print("The solution matrix is:", sol)
print("The solutions to the system are: ", end='')
for v in sol.getMatrix():
print(v, end=' ')
else:
print("Solution does not exist!")
示例2: Matrix
# 需要导入模块: from Matrix import Matrix [as 别名]
# 或者: from Matrix.Matrix import inputMatrix [as 别名]
from Matrix import Matrix
m1 = Matrix()
m2 = Matrix()
m1.inputMatrix()
m2.inputMatrix()
#m = m1.addMatrix(m2)
#m3 = m1.subMatrix(m2)
#m.printMatrix()
#m3.printMatrix()
#m1.transMatrix()
#m1.printMatrix()
#print(m1.detMatrix())
#m4 = m1.mulMatrix(m2)
#m4.printMatrix()
#m1.mulScalarMatrix(5)
#m1.divScalarMatrix(5)
#m1.printMatrix()
#m5 = m1.cofactorMatrix()
#m5.printMatrix()
#m6 = m1.inverseMatrix()
#m6.printMatrix()