本文整理汇总了Python中Vector.Vector.areLinearlyIndependent方法的典型用法代码示例。如果您正苦于以下问题:Python Vector.areLinearlyIndependent方法的具体用法?Python Vector.areLinearlyIndependent怎么用?Python Vector.areLinearlyIndependent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector.Vector
的用法示例。
在下文中一共展示了Vector.areLinearlyIndependent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_linearIndependenceWorks
# 需要导入模块: from Vector import Vector [as 别名]
# 或者: from Vector.Vector import areLinearlyIndependent [as 别名]
def test_linearIndependenceWorks(self):
one_1 = Vector([1, 1])
three_3 = Vector([3, 3])
self.assertFalse(Vector.areLinearlyIndependent([one_1, three_3]))
one = Vector([1])
three = Vector([3])
self.assertFalse(Vector.areLinearlyIndependent([one, three]))
one_3 = Vector([1, 3])
self.assertTrue(Vector.areLinearlyIndependent([one_1, one_3]))
示例2: test_linearIndependenceShouldNotAcceptVectorsOfDifferentDims
# 需要导入模块: from Vector import Vector [as 别名]
# 或者: from Vector.Vector import areLinearlyIndependent [as 别名]
def test_linearIndependenceShouldNotAcceptVectorsOfDifferentDims(self):
try:
Vector.areLinearlyIndependent([Vector([1]), Vector([2, 3])])
self.fail("expecting ValueError to be thrown")
except(ValueError):
pass