X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingMemArrayFloat.cxx;h=c351b0b454e9025ece926cd2cbc8c8ac38501564;hb=90b7c9c73054965b8085ab0ecd2646a3d59f475a;hp=dd2f3c5aa03dcb4d1cac847d2e6f35d17efe1f7f;hpb=7993ad46aa1b33253c97499712bc21e4c41c506c;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingMemArrayFloat.cxx b/src/MEDCoupling/MEDCouplingMemArrayFloat.cxx index dd2f3c5aa..c351b0b45 100644 --- a/src/MEDCoupling/MEDCouplingMemArrayFloat.cxx +++ b/src/MEDCoupling/MEDCouplingMemArrayFloat.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2017 CEA/DEN, EDF R&D +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -38,28 +38,10 @@ DataArrayFloat *DataArrayFloat::deepCopy() const return new DataArrayFloat(*this); } -void DataArrayFloat::reprStream(std::ostream& stream) const -{ - stream << "Name of float array : \"" << _name << "\"\n"; - reprWithoutNameStream(stream); -} - -void DataArrayFloat::reprZipStream(std::ostream& stream) const -{ - stream << "Name of float array : \"" << _name << "\"\n"; - reprZipWithoutNameStream(stream); -} - -void DataArrayFloat::reprZipWithoutNameStream(std::ostream& stream) const -{ - DataArray::reprWithoutNameStream(stream); - stream.precision(7); - _mem.repr(getNumberOfComponents(),stream); -} - void DataArrayFloat::reprCppStream(const std::string& varName, std::ostream& stream) const { - int nbTuples(getNumberOfTuples()),nbComp(getNumberOfComponents()); + mcIdType nbTuples(getNumberOfTuples()); + std::size_t nbComp(getNumberOfComponents()); const float *data(begin()); stream.precision(7); stream << "DataArrayFloat *" << varName << "=DataArrayFloat::New();" << std::endl; @@ -81,10 +63,10 @@ void DataArrayFloat::reprQuickOverview(std::ostream& stream) const stream << "DataArrayFloat C++ instance at " << this << ". "; if(isAllocated()) { - int nbOfCompo=(int)_info_on_compo.size(); + std::size_t nbOfCompo=_info_on_compo.size(); if(nbOfCompo>=1) { - int nbOfTuples=getNumberOfTuples(); + mcIdType nbOfTuples=getNumberOfTuples(); stream << "Number of tuples : " << nbOfTuples << ". Number of components : " << nbOfCompo << "." << std::endl; reprQuickOverviewData(stream,MAX_NB_OF_BYTE_IN_REPR); } @@ -98,18 +80,18 @@ void DataArrayFloat::reprQuickOverview(std::ostream& stream) const void DataArrayFloat::reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const { const float *data(begin()); - int nbOfTuples(getNumberOfTuples()); - int nbOfCompo=(int)_info_on_compo.size(); + mcIdType nbOfTuples(getNumberOfTuples()); + std::size_t nbOfCompo=_info_on_compo.size(); std::ostringstream oss2; oss2 << "["; oss2.precision(7); std::string oss2Str(oss2.str()); bool isFinished=true; - for(int i=0;i1) { oss2 << "("; - for(int j=0;j::PerformCopyOrIncrRef(dCpy,*this); -} - DataArrayFloatIterator *DataArrayFloat::iterator() { return new DataArrayFloatIterator(this); @@ -191,14 +141,14 @@ DataArrayFloatIterator::DataArrayFloatIterator(DataArrayFloat *da):DataArrayIter { } -DataArrayFloatTuple::DataArrayFloatTuple(float *pt, int nbOfComp):DataArrayTuple(pt,nbOfComp) +DataArrayFloatTuple::DataArrayFloatTuple(float *pt, std::size_t nbOfComp):DataArrayTuple(pt,nbOfComp) { } std::string DataArrayFloatTuple::repr() const { std::ostringstream oss; oss.precision(7); oss << "("; - for(int i=0;i<_nb_of_compo-1;i++) + for(std::size_t i=0;i<_nb_of_compo-1;i++) oss << _pt[i] << ", "; oss << _pt[_nb_of_compo-1] << ")"; return oss.str(); @@ -215,7 +165,7 @@ float DataArrayFloatTuple::floatValue() const * This method throws an INTERP_KERNEL::Exception is it is impossible to match sizes of \b this that is too say \b nbOfCompo=this->_nb_of_elem and \bnbOfTuples==1 or * \b nbOfCompo=1 and \bnbOfTuples==this->_nb_of_elem. */ -DataArrayFloat *DataArrayFloatTuple::buildDAFloat(int nbOfTuples, int nbOfCompo) const +DataArrayFloat *DataArrayFloatTuple::buildDAFloat(std::size_t nbOfTuples, std::size_t nbOfCompo) const { return this->buildDA(nbOfTuples,nbOfCompo); }