From bcc1bbb956e50d582c65d24f30d68ef6b75026a5 Mon Sep 17 00:00:00 2001 From: ageay Date: Fri, 7 Jun 2013 14:04:45 +0000 Subject: [PATCH] DataArrayInt::accumulatePerChunk --- src/MEDCoupling_Swig/MEDCouplingBasicsTest.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py index a90b8fd89..6fe9040bc 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py @@ -12936,6 +12936,16 @@ class MEDCouplingBasicsTest(unittest.TestCase): # d=DataArrayInt.Range(0,20,1) self.assertTrue(d.accumulatePerChunck([2,4,12]).isEqual(DataArrayInt([5,60]))) + # + a=DataArrayDouble(12) ; a.iota() ; a.rearrange(3) + b=DataArrayDouble(12) ; b.iota(20) ; b.rearrange(3) + ids=DataArrayInt([]) + self.assertEqual(len(a[ids]),0) + self.assertEqual(len(b[ids]),0) + a2=a.deepCpy() ; a2[ids]+=b[ids] ; self.assertTrue(a2.isEqual(a,1e-15)) + a2=a.deepCpy() ; a2[ids]*=b[ids] ; self.assertTrue(a2.isEqual(a,1e-15)) + a2=a.deepCpy() ; a2[ids]/=b[ids] ; self.assertTrue(a2.isEqual(a,1e-15)) + a2=a.deepCpy() ; a2[ids]-=b[ids] ; self.assertTrue(a2.isEqual(a,1e-15)) pass def setUp(self): -- 2.39.2