X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Distribution.cxx;h=574466cc7ef1ba00de342a8b69f53ff2d9c32f5b;hb=5b62e4db7cca70738f4487b2788cc2bae2c2df8f;hp=fce8298f430ac1708e708921c5811f4d104f6d5b;hpb=79b1ac2b6df9117f16f11d444b1f165d477a1813;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_Distribution.cxx b/src/StdMeshers/StdMeshers_Distribution.cxx index fce8298f4..574466cc7 100644 --- a/src/StdMeshers/StdMeshers_Distribution.cxx +++ b/src/StdMeshers/StdMeshers_Distribution.cxx @@ -1,31 +1,31 @@ -// SMESH StdMeshers : implementaion of point distribution algorithm +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// SMESH StdMeshers : implementaion of point distribution algorithm // File : StdMeshers_Distribution.cxx // Author : Alexandre SOLOVYOV // Module : SMESH // $Header$ - +// #include "StdMeshers_Distribution.hxx" #include @@ -41,6 +41,10 @@ #include #endif +using namespace std; + +namespace StdMeshers { + Function::Function( const int conv ) : myConv( conv ) { @@ -128,8 +132,8 @@ bool FunctionTable::value( const double t, double& f ) const double FunctionTable::integral( const int i ) const { - if( i>=0 && i= 0 && i < (int)myData.size()-1 ) + return integral( i, myData[2*(i+1)] - myData[2*i] ); else return 0; } @@ -302,21 +306,21 @@ double dihotomySolve( Function& f, const double val, const double _start, const } bool buildDistribution( const TCollection_AsciiString& f, const int conv, const double start, const double end, - const int nbSeg, vector& data, const double eps ) + const int nbSeg, vector& data, const double eps ) { FunctionExpr F( f.ToCString(), conv ); return buildDistribution( F, start, end, nbSeg, data, eps ); } bool buildDistribution( const std::vector& f, const int conv, const double start, const double end, - const int nbSeg, vector& data, const double eps ) + const int nbSeg, vector& data, const double eps ) { FunctionTable F( f, conv ); return buildDistribution( F, start, end, nbSeg, data, eps ); } bool buildDistribution( const Function& func, const double start, const double end, const int nbSeg, - vector& data, const double eps ) + vector& data, const double eps ) { if( nbSeg<=0 ) return false; @@ -343,3 +347,4 @@ bool buildDistribution( const Function& func, const double start, const double e data[nbSeg] = end; return true; } +}