def test_nan_inf(self): a=numpy.array([0.0, 0.0, 0.0],floattype) x=util.INF y=numpy.array([-23.1, util.NAN, 18.208],floattype) result = sasmath.vec_scale(a,x,y) expected = util.list_to_floattype(x*y,floattype) self.assert_list_almost_equal(result,expected)
def test_inf_2(self): a=numpy.array([util.HUGE, 103.0, -30.0],floattype) x=util.INF y=numpy.array([-23.1, 0.98, 18.208],floattype) result = sasmath.vec_scale(a,x,y) expected = util.list_to_floattype(x*y,floattype) self.assert_list_almost_equal(result,expected)
def test_arb_arrays(self): a=numpy.array([0.0, 0.0, 0.0],floattype) x=util.num_to_floattype(-35.01,floattype) y=numpy.array([-23.1, 0.98, 18.208],floattype) result = sasmath.vec_scale(a,x,y) expected = util.list_to_floattype(x*y,floattype) self.assert_list_almost_equal(result,expected)
def test_inf_1(self): a=numpy.array([0.02, 5.2, -10.0],floattype) x=util.HUGE y=numpy.array([-23.1, 19.8, 18.208],floattype) result = sasmath.vec_scale(a,x,y) expected = util.list_to_floattype(x*y,floattype) self.assert_list_almost_equal(result,expected)
def test_unit_arrays(self): a=numpy.array([0.0, 0.0, 0.0],floattype) x=util.num_to_floattype(1.0,floattype) y=numpy.array([1.0, 1.0, 1.0],floattype) result = sasmath.vec_scale(a,x,y) expected = util.list_to_floattype(x*y,floattype) self.assert_list_almost_equal(result,expected)