def test_inf_1(self): x=numpy.array([util.HUGE, 3.0, -100.2],floattype) y=numpy.array([2.0, 0.9, -2.2],floattype) result=linear_algebra.cross_product(x,y) print result resultnp = numpy.cross(x,y) self.assert_list_almost_equal(result,resultnp)
def test_inf_1(self): x = numpy.array([util.HUGE, 3.0, -100.2], floattype) y = numpy.array([2.0, 0.9, -2.2], floattype) result = linear_algebra.cross_product(x, y) print result resultnp = numpy.cross(x, y) self.assert_list_almost_equal(result, resultnp)
def test_against_numpy(self): x=numpy.array([3.0, 3.0, -100.2],floattype) y=numpy.array([17.68, 0.9, -2.2],floattype) result=linear_algebra.cross_product(x,y) resultnp = numpy.cross(x,y) self.assert_list_almost_equal(result,resultnp)
def test_arbitary(self): x=numpy.array([3.0, 0.0, 0.0],floattype) y=numpy.array([0.0, 0.0, -2.2],floattype) result=linear_algebra.cross_product(x,y) self.assert_list_almost_equal(result,[0.0, 6.6, 0.0])
def test_2x_axis_cross_3z_axis(self): x=numpy.array([2.0, 0.0, 0.0],floattype) y=numpy.array([0.0, 0.0, 3.0],floattype) result=linear_algebra.cross_product(x,y) self.assert_list_almost_equal(result,[0.0, -6.0, 0.0])
def test_1_zero_array(self): x=numpy.array([0.0, 0.0, 0.0],floattype) y=numpy.array([3.2, 2.6, -0.3],floattype) result=linear_algebra.cross_product(x,y) self.assert_list_almost_equal(result,[0.0, 0.0, 0.0])
def test_two_zero_arrays(self): x=numpy.array([0.0, 0.0, 0.0],floattype) y=numpy.array([0.0, 0.0, 0.0],floattype) result = linear_algebra.cross_product(x,y) self.assert_list_almost_equal(a=result,b=[0.0, 0.0, 0.0])
def test_zero(self): x=numpy.array([util.ZERO, 3.0, -100.2],floattype) y=numpy.array([1.0, 0.9, -2.2],floattype) result=linear_algebra.cross_product(x,y) resultnp = numpy.cross(x,y) self.assert_list_almost_equal(result,resultnp)
def test_against_numpy(self): x = numpy.array([3.0, 3.0, -100.2], floattype) y = numpy.array([17.68, 0.9, -2.2], floattype) result = linear_algebra.cross_product(x, y) resultnp = numpy.cross(x, y) self.assert_list_almost_equal(result, resultnp)
def test_arbitary(self): x = numpy.array([3.0, 0.0, 0.0], floattype) y = numpy.array([0.0, 0.0, -2.2], floattype) result = linear_algebra.cross_product(x, y) self.assert_list_almost_equal(result, [0.0, 6.6, 0.0])
def test_2x_axis_cross_3z_axis(self): x = numpy.array([2.0, 0.0, 0.0], floattype) y = numpy.array([0.0, 0.0, 3.0], floattype) result = linear_algebra.cross_product(x, y) self.assert_list_almost_equal(result, [0.0, -6.0, 0.0])
def test_1_zero_array(self): x = numpy.array([0.0, 0.0, 0.0], floattype) y = numpy.array([3.2, 2.6, -0.3], floattype) result = linear_algebra.cross_product(x, y) self.assert_list_almost_equal(result, [0.0, 0.0, 0.0])
def test_two_zero_arrays(self): x = numpy.array([0.0, 0.0, 0.0], floattype) y = numpy.array([0.0, 0.0, 0.0], floattype) result = linear_algebra.cross_product(x, y) self.assert_list_almost_equal(a=result, b=[0.0, 0.0, 0.0])
def test_zero(self): x = numpy.array([util.ZERO, 3.0, -100.2], floattype) y = numpy.array([1.0, 0.9, -2.2], floattype) result = linear_algebra.cross_product(x, y) resultnp = numpy.cross(x, y) self.assert_list_almost_equal(result, resultnp)