示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)
示例#5
0
 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)
示例#6
0
 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)
示例#7
0
 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)
示例#8
0
 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)