]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
*** empty log message ***
authorageay <ageay>
Tue, 13 Apr 2010 08:00:45 +0000 (08:00 +0000)
committerageay <ageay>
Tue, 13 Apr 2010 08:00:45 +0000 (08:00 +0000)
src/MEDCoupling/MEDCouplingMemArray.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx

index 71d65c10899c9652c0092d4d2d536cd03fc0ba7e..81c34fc2fd960f7210d910472f09c5430447f7fc 100644 (file)
@@ -175,6 +175,7 @@ DataArrayDouble *DataArrayDouble::multiply(const DataArrayDouble *a1, const Data
       ret=DataArrayDouble::New();
       ret->alloc(nbOfTuple,nbOfComp);
       std::transform(a1->getConstPointer(),a1->getConstPointer()+nbOfTuple*nbOfComp,a2->getConstPointer(),ret->getPointer(),std::multiplies<double>());
+      ret->copyStringInfoFrom(*a1);
     }
   else
     {
@@ -199,11 +200,11 @@ DataArrayDouble *DataArrayDouble::multiply(const DataArrayDouble *a1, const Data
           double *res=ret->getPointer();
           for(int i=0;i<nbOfTuple;i++)
             res=std::transform(aMaxPtr+i*nbOfCompMax,aMaxPtr+(i+1)*nbOfCompMax,res,std::bind2nd(std::multiplies<double>(),aMinPtr[i]));
+          ret->copyStringInfoFrom(*aMax);
         }
       else
         throw INTERP_KERNEL::Exception("Nb of components mismatch for array multiply !");
     }
-  ret->copyStringInfoFrom(*a1);
   return ret;
 }
 
index 17c02a8b75b2fdf9d82c7c9f91416345506e9077..99e28e8d92455d75bb9ad2603475c469b6f16fe1 100644 (file)
@@ -1417,6 +1417,13 @@ void MEDCouplingBasicsTest::testOperationsOnFields2()
   for(int i=0;i<15;i++)
     CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],val[i],1.e-12);
   f3->decrRef();
+  //
+  f3=(*f2)*(*f1);
+  val=f3->getArray()->getConstPointer();
+  for(int i=0;i<15;i++)
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],val[i],1.e-12);
+  f3->decrRef();
+  //
   f1->decrRef();
   f2->decrRef();
   //