def test_inf_nan(self): a = numpy.array([util.INF, 0.0, 0.0], floattype) x = numpy.array([-2.3, util.NAN, 0.2], floattype) y = numpy.array([12.01, -109.3, util.HUGE], floattype) result = sasmath.vec_sub(a, x, y) expected = numpy.subtract(x, y) self.assert_list_almost_equal(result, expected)
def test_unit_arrays(self): a = numpy.array([0.0, 0.0, 0.0], floattype) x = numpy.array([1.0, 1.0, 1.0], floattype) y = numpy.array([1.0, 1.0, 1.0], floattype) result = sasmath.vec_sub(a, x, y) expected = numpy.subtract(x, y) self.assert_list_almost_equal(result, expected)
def test_arb_arrays(self): a = numpy.array([0.0, 0.0, 0.0], floattype) x = numpy.array([-2.3, 5.6, 0.2], floattype) y = numpy.array([12.01, -109.3, 3.87], floattype) result = sasmath.vec_sub(a, x, y) expected = numpy.subtract(x, y) self.assert_list_almost_equal(result, expected)
def test_zero(self): a = numpy.array([util.ZERO, 2.0, 3.0], floattype) x = numpy.array([-2.3, util.ZERO, 0.2], floattype) y = numpy.array([12.01, -109.3, 3.87], floattype) result = sasmath.vec_sub(a, x, y) expected = numpy.subtract(x, y) self.assert_list_almost_equal(result, expected)
def test_inf_nan(self): a=numpy.array([util.INF, 0.0, 0.0],floattype) x=numpy.array([-2.3, util.NAN, 0.2],floattype) y=numpy.array([12.01, -109.3, util.HUGE],floattype) result = sasmath.vec_sub(a,x,y) expected = numpy.subtract(x,y) self.assert_list_almost_equal(result,expected)
def test_arb_arrays(self): a=numpy.array([0.0, 0.0, 0.0],floattype) x=numpy.array([-2.3, 5.6, 0.2],floattype) y=numpy.array([12.01, -109.3, 3.87],floattype) result = sasmath.vec_sub(a,x,y) expected = numpy.subtract(x,y) self.assert_list_almost_equal(result,expected)
def test_unit_arrays(self): a=numpy.array([0.0, 0.0, 0.0],floattype) x=numpy.array([1.0, 1.0, 1.0],floattype) y=numpy.array([1.0, 1.0, 1.0],floattype) result = sasmath.vec_sub(a,x,y) expected = numpy.subtract(x,y) self.assert_list_almost_equal(result,expected)
def test_zero(self): a=numpy.array([util.ZERO, 2.0, 3.0],floattype) x=numpy.array([-2.3, util.ZERO, 0.2],floattype) y=numpy.array([12.01, -109.3, 3.87],floattype) result = sasmath.vec_sub(a,x,y) expected = numpy.subtract(x,y) self.assert_list_almost_equal(result,expected)