From 9705e900ecd7b2c4c23e21033055dc18ea30afb9 Mon Sep 17 00:00:00 2001 From: ageay Date: Tue, 13 Apr 2010 08:00:45 +0000 Subject: [PATCH] *** empty log message *** --- src/MEDCoupling/MEDCouplingMemArray.cxx | 3 ++- src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index 71d65c108..81c34fc2f 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -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()); + 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(),aMinPtr[i])); + ret->copyStringInfoFrom(*aMax); } else throw INTERP_KERNEL::Exception("Nb of components mismatch for array multiply !"); } - ret->copyStringInfoFrom(*a1); return ret; } diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx index 17c02a8b7..99e28e8d9 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx @@ -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(); // -- 2.39.2